Skip to main content

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)

Source distribution for sphinx-automagicdoc 0.0.2
File Size Uploaded
sphinx-automagicdoc-0.0.2.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinx-automagicdoc 0.0.2
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page