sphinx-automagicdoc
Description
This plugin can create API documentation stubs (akin to sphinx-autogen), with the significant difference that the creation is done dynamically and on the fly, and the files remain virtual and are monkey-patched into Sphinx IO routines.
Creating a whole set of files matching the structure of a module violates DRY (don't repeat yourself) and enhances the risk of documentation becoming out of sync during e.g. refactorings. Therefore, sphinx-automagicdoc can be used to dynamically source the rST structure from the Python source as the single source of truth.
Based upon the monkey patched virtual filesystem, additionally, other files or strings can be injected into the Sphinx tree.
Usage
# e.g. added to conf.py
# name the modules automagicdoc should process
automagic_modules = ["nameOfYourPackage"]
automagic_ignore = ["*test*"]
# README.rst and LICENSE from the root directory (outside of doc directory)
# will appear available as README.rst and LICENSE.rst inside doc/
automagic_copy_files = {
"README.rst", "README.rst",
"LICENSE.rst": "LICENSE",
}
# index.rst's content is based upon a string
automagic_files = {
"index.rst": """
Welcome to the documentation!
=============================
.. toctree::
:maxdepth: 1
:caption: Contents:
README
LICENSE
nameOfYourPackage
"""
}
Example
This repo builds its documentation using sphinx-autopyproject as described in .github/workflows/doc.yml using Github Actions and deploys to Github pages.
See also
sphinx-autopyproject to use pyproject.toml instead of conf.py.
License
MIT
Metadata
Release files for sphinx-automagicdoc 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sphinx-automagicdoc-0.0.2.tar.gz | 5.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sphinx_automagicdoc-0.0.2-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 13.3 kB
Release files / sphinx-automagicdoc-0.0.2.tar.gz
| Download URL | sphinx-automagicdoc-0.0.2.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eed3a281152d92267dcd36ae0717a3c381e655e5007e50a05997da6e07a64856
|
|
BLAKE2b-256 checksum How to use checksums |
5cc62b585cee5fb33be9bc0a533a1ab72d244727b241f1fcbeaa1a0a0c99e5c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.14
|
Release files / sphinx_automagicdoc-0.0.2-py2.py3-none-any.whl
| Download URL | sphinx_automagicdoc-0.0.2-py2.py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
bf1b7224f37ba7f5a6c47f04b85c091c9565c87f149074d82056f373aa43ee89
|
|
BLAKE2b-256 checksum How to use checksums |
4a9e06ae64ea59a25cc7bc9abffa9e0ca99bf46707f579ab0950b8d8a992c29c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.14
|