python - Customize templates for `sphinx-apidoc` -
i've tried using sphinx-apidoc sphinx generate sphinx specific restructuredtext api of python project.
however, result i'm getting is:
anyone know if can customize template sphinx-api
uses output? specifically, i'd to:
- get rid of "submodules", "subpackages" , "module contents" headings, and
- have results docstring in
__init__.py
files appear directly under packages, if click package name, first thing see package documentation. @ moment, documentation placed under weird "module contents" heading @ end of each package section.
the "submodules" , "subpackages" headings redundant think, since normal headings packages/modules "xxx.yyy package" , "xxx.yyy.zzz module".
the structure above small example is
- orexplore.components package
- orexplore.components.mbg120 module
- orexplore.simulators package
- orexplore.simulators.test package
- orexplore.simulators.test.mbg120 module
- orexplore.simulators.mbg120 module
- orexplore.simulators.test package
where clicking packages, first thing i'd see on page package documentation.
or maybe just
- orexplore.components
- orexplore.components.mbg120
- orexplore.simulators
- orexplore.simulators.test
- orexplore.simulators.test.mbg120
- orexplore.simulators.test
- orexplore.simulators.mbg120
if there way visually distinguish packages/modules (color? emblem?) instead of quite wordy " package" , " module".
the sphinx-apidoc script uses apidoc.py module. not able provide detailed instructions, in order remove headings or otherwise customize output, you'll have write own version of module. there no other "template".
note if api , module structure stable, there no need run sphinx-apidoc repeatedly. can post-process generated rst files liking once , place them under version control. see https://stackoverflow.com/a/28481785/407651.
Comments
Post a Comment