Sphinx AutoAPI is a Sphinx extension for generating complete API documentation without needing to load, run, or import the project being documented.
In contrast to the traditional Sphinx autodoc, which requires manual authoring and uses code imports, AutoAPI finds and generates documentation by parsing source code.
The following steps will walk through how to add AutoAPI to an existing Sphinx project. For instructions on how to set up a Sphinx project, see Sphinx's documentation on Getting Started.
AutoAPI can be installed through pip:
pip install sphinx-autoapi
Next, add and configure AutoAPI in your Sphinx project's conf.py.
extensions.append('autoapi.extension')
autoapi_dirs = ['path/to/source/files', 'src']
When the documentation is built, AutoAPI will now generate API documentation into an autoapi/ directory and add an entry to the documentation in your top level table of contents!
To configure AutoAPI behaviour further, see the Configuration documentation.
Tests are executed through tox.
tox
Code is formatted using black.
You can check your formatting using black's check mode:
tox -e formatting
You can also get black to format your changes for you:
black autoapi/ tests/
You can even get black to format changes automatically when you commit using pre-commit:
pip install pre-commit
pre-commit install
Release notes are managed through towncrier. When making a pull request you will need to create a news fragment to document your change:
tox -e release_notes -- create --help
We use SemVer for versioning. For the versions available, see the tags on this repository.
This project is licensed under the MIT License. See the LICENSE.rst file for details.