Sphinx API documentation generator
Project description
NOTE: This is a fork of the original sphinx-autoapi, which intended to make it compatible with MyST-Parser. Hopefully, the changes will eventually be merged upstream. The goals are:
Add a set of templates, for use with MyST-Parser
Make it possible to write files with a specific extension, based on a file regex; we want users to be able to gradually migrate existing codebases to MyST-Parser, so being able to specify only certain files will be very helpful.
Sphinx AutoAPI provides “autodoc” style documentation for multiple programming languages without needing to load, run, or import the project being documented.
In contrast to the traditional Sphinx autodoc, which is Python-only and uses code imports, AutoAPI finds and generates documentation by parsing source code.
Language Support
Language |
Status |
Parser |
---|---|---|
Python |
Stable |
Custom using astroid |
Go |
Alpha |
|
Javascript |
Alpha |
|
.NET |
Alpha |
Getting Started
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.
Installation
AutoAPI can be installed through pip:
pip install sphinx-autoapi
Next, add and configure AutoAPI in your Sphinx project’s conf.py. Other languages may require further configuration:
extensions.append('autoapi.extension')
autoapi_type = 'python'
autoapi_dirs = ['path/to/source/files', 'src']
Where autoapi_type can be one of any of the supported languages:
Language |
autoapi_type |
---|---|
Python |
'python' |
Go |
'go' |
Javascript |
'javascript' |
.NET |
'dotnet' |
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.
Contributing
Running the tests
Tests are executed through tox.
tox
Code Style
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
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
License
This project is licensed under the MIT License. See the LICENSE.rst file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sphinx-autoapi2-2.0.1.1.tar.gz
.
File metadata
- Download URL: sphinx-autoapi2-2.0.1.1.tar.gz
- Upload date:
- Size: 92.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b93d0f933d39381523faf7e300ae0597eb23f95b4058adffc0274c47081a7f97 |
|
MD5 | b94ac0778df70a55321c9ed645a5247e |
|
BLAKE2b-256 | 807758c223840fb16654b60398dc4b1d72c5e01a9d92a15e57c90fa99c8939a8 |
File details
Details for the file sphinx_autoapi2-2.0.1.1-py3-none-any.whl
.
File metadata
- Download URL: sphinx_autoapi2-2.0.1.1-py3-none-any.whl
- Upload date:
- Size: 59.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1a6d3eeaad6ca4cfc376bd3083a184f217096228c20607e5123656ea4e1778c |
|
MD5 | c54b6c0457120de07dedd20d0950ba5b |
|
BLAKE2b-256 | c32f495f87cae5ab28a19edf67e7b8d8ae64908dbaacb028085ba96f17f5ccc3 |