https://github.com/sphinx-contrib/autofile
A sphinx extension to generate module for many files from a glob expression. maintainers: @Freed-Wu
https://github.com/sphinx-contrib/autofile
autodoc
Last synced: 7 days ago
JSON representation
A sphinx extension to generate module for many files from a glob expression. maintainers: @Freed-Wu
- Host: GitHub
- URL: https://github.com/sphinx-contrib/autofile
- Owner: sphinx-contrib
- License: gpl-3.0
- Created: 2023-09-02T14:17:26.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-19T07:12:39.000Z (about 1 year ago)
- Last Synced: 2024-11-07T17:58:41.675Z (6 months ago)
- Topics: autodoc
- Language: Python
- Homepage: https://sphinxcontrib-requirements-txt.readthedocs.io/
- Size: 34.2 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# sphinxcontrib-autofile
[](https://sphinx-contrib-autofile.readthedocs.io)
[](https://results.pre-commit.ci/latest/github/sphinx-contrib/autofile/main)
[](https://github.com/sphinx-contrib/autofile/actions)
[](https://codecov.io/gh/sphinx-contrib/autofile)[](https://github.com/sphinx-contrib/autofile/releases)
[](https://github.com/sphinx-contrib/autofile/releases/latest)
[](https://github.com/sphinx-contrib/autofile/issues)
[](https://github.com/sphinx-contrib/autofile/issues?q=is%3Aissue+is%3Aclosed)
[](https://github.com/sphinx-contrib/autofile/pulls)
[](https://github.com/sphinx-contrib/autofile/pulls?q=is%3Apr+is%3Aclosed)
[](https://github.com/sphinx-contrib/autofile/discussions)
[](https://github.com/sphinx-contrib/autofile/milestones)
[](https://github.com/sphinx-contrib/autofile/network/members)
[](https://github.com/sphinx-contrib/autofile/stargazers)
[](https://github.com/sphinx-contrib/autofile/watchers)
[](https://github.com/sphinx-contrib/autofile/graphs/contributors)
[](https://github.com/sphinx-contrib/autofile/graphs/commit-activity)
[](https://github.com/sphinx-contrib/autofile/commits)
[](https://github.com/sphinx-contrib/autofile/releases/latest)[](https://github.com/sphinx-contrib/autofile/blob/main/LICENSE)
[](https://github.com/sphinx-contrib/autofile)
[](https://github.com/sphinx-contrib/autofile)
[](https://github.com/sphinx-contrib/autofile)
[](https://github.com/sphinx-contrib/autofile)
[](https://github.com/sphinx-contrib/autofile)
[](https://github.com/sphinx-contrib/autofile)[](https://pypi.org/project/sphinxcontrib-autofile/#description)
[](https://pypi.org/project/sphinxcontrib-autofile/#history)
[](https://pypi.org/project/sphinxcontrib-autofile/#files)
[](https://pypi.org/project/sphinxcontrib-autofile/#files)
[](https://pypi.org/project/sphinxcontrib-autofile/#files)
[](https://pypi.org/project/sphinxcontrib-autofile/#files)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`:
```python
# ...
extensions = [
"myst_parser",
"sphinxcontrib.autofile",
]
# ...
````docs/index.md`:
````markdown
```{autofile} ../src/sphinxcontrib/autofile/*.py
:members:
```
````It will be translated to
````markdown
```{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
````markdown
```{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](https://docs.jinkan.org/docs/jinja2/templates.html).
See
[examples](https://github.com/sphinx-contrib/autofile/tree/main/src/sphinxcontrib/autofile/assets/jinja2).## Alternatives
- [sphinxcontrib-eval](https://github.com/sphinx-contrib/eval#generate-api-document)
See
[](https://sphinxcontrib-autofile.readthedocs.io)
to know more.