pythonpython-sphinxdocstringgoogle-style-guidesphinx-napoleon

Simple way to convert Python docstrings from reStructured Text to Google style?


Does anyone now a simple way do convert all docstrings in an existing project from reStructured Text to the Google format?

It looks like Napoleon can do something like that, but it looks very complicated, so I figured I'd ask if someone has done that before. Any idea would be much appreciated.


Solution

  • Try using pyment to convert docstrings from reStructuredText to Google format. Then use Napolean to generate documentation via Sphinx.

    Napoleon is a pre-processor that parses NumPy and Google style docstrings and converts them to reStructuredText before Sphinx attempts to parse them.