Sphinx extension to auto-generate API tree.
Project description
sphinx-apitree
apitree
is a small library to generate a ready-to-use documentation with minimal friction!
apitree
takes care of everything, so you can only focus on the code.
Usage
In docs/conf.py
, replace everything by:
import apitree
apitree.make_project(
# e.g. `import visu3d as v3d` -> {'v3d': 'visu3d'}
project_name={'alias': 'my_module'},
globals=globals(),
)
Then to generate the doc:
sphinx-build -b html docs/ docs/_build
To add api/my_module/index
somewhere in your toctree, like:
..toctree:
:caption: API
api/my_module/index
Features
- Theme
- Auto-generate the API tree, with better features
- Do not require
__all__
(smart detect of which symbols are documented) - Add expandable toc tree with all symbols
- Do not require
- ...
Installation in a project
-
In
pyproject.toml
[project.optional-dependencies] # Installed through `pip install .[docs]` docs = [ # Install `apitree` with all extensions (sphinx, theme,...) "sphinx-apitree[ext]", ]
-
In
.readthedocs.yaml
sphinx: configuration: docs/conf.py python: install: - method: pip path: . extra_requirements: - docs
Examples of projects using apitree
- https://github.com/google-research/visu3d (https://visu3d.readthedocs.io/)
- https://github.com/google-research/dataclass_array (https://dataclass-array.readthedocs.io/)
- https://github.com/google-research/etils (https://etils.readthedocs.io/)
- https://github.com/google-research/kauldron (https://kauldron.readthedocs.io/)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sphinx_apitree-1.2.0.tar.gz
(13.9 kB
view hashes)
Built Distribution
Close
Hashes for sphinx_apitree-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 926395dc0d380d02ed3de2898f075cf5a8e94c24a980f8071642328f979d9726 |
|
MD5 | 85325d7374dd12ccd2262b92466bcabe |
|
BLAKE2b-256 | aa030076e1a8f9c810e39c9509e5e46d2bb7b46f569e6af3c0c2aae187994ff7 |