A sphinx extension to generate module for many files from a glob expression.
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.
```{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.