Skip to content

Instantly share code, notes, and snippets.

@thiagopbueno
Last active November 11, 2020 21:50
Show Gist options
  • Save thiagopbueno/ad5c5d2321f3a3bfa66ef821287e2941 to your computer and use it in GitHub Desktop.
Save thiagopbueno/ad5c5d2321f3a3bfa66ef821287e2941 to your computer and use it in GitHub Desktop.
Sphinx commands for generating documentation for python projects.

Quickstart

Installation

Run in the project virtualenv:

$ pip3 install Sphinx

Run in docs/ folder.

$ sphinx-quickstart       # make sure to enable autodoc

Configuration

$ sphinx-apidoc -f -o docs/ <projectdir>

Setting up napoleon extension

Add napoleon to the extensions list in conf.py

extensions = ['sphinx.ext.napoleon']

Changing default settings in conf.py

napoleon_include_private_with_doc = True
napoleon_include_special_with_doc = True

Generating HTML documentation

$ make html

Make sure to install your package beforing generating the documentation.

Installing locally...

$ python3 setup.py develop

Installing in the system ...

$ pip3 install <packagename>

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment