How to document Python packages using Sphinx

Here is an outline:

  1. Document your package using docstrings in the sources.
  2. Use sphinx-quickstart to create a Sphinx project.
  3. Run sphinx-apidoc to generate .rst sources set up for use with autodoc. More information here.

    Using this command with the -F flag also creates a complete Sphinx project. If your API changes a lot, you may need to re-run this command several times.

  4. Build the documentation using sphinx-build.

Notes:

Leave a Comment