SP
sphinx-contrib/autofile
A sphinx extension to generate module for many files from a glob expression. maintainers: @Freed-Wu
sphinxcontrib-autofile
A sphinx extension to generate module for many files from a glob expression.
Usage
Take MyST as an example. rst is similar.
docs/conf.py:
# ...
extensions = [
"myst_parser",
"sphinxcontrib.autofile",
]
# ...docs/index.md:
```{autofile} ../src/sphinxcontrib/autofile/*.py
:members:
```It will be translated to
```{eval-rst}
.. automodule:: sphinxcontrib.autofile
:members:
.. automodule:: sphinxcontrib.autofile.directive
:members:
... (more modules)
```When your modules is too many, it will save your time.
Customize
```{autofile} ../src/sphinxcontrib/autofile/*.py
:prefix: your_prefix
:template: /the/path/of/your/template
```prefix: If you don't use src-layout, change it.template: template use
jinja syntax.
See
examples.
Alternatives
On this page
Languages
Python90.1%Jinja9.9%
Contributors
GNU General Public License v3.0
Created September 2, 2023
Updated January 10, 2026