Customize templates for `sphinx-apidoc`

前端 未结 3 1497
天命终不由人
天命终不由人 2020-12-03 02:01

I\'ve recently tried using sphinx-apidoc from Sphinx to help generate Sphinx specific reStructuredText from the API of a Python project.

However, the result I\'m get

3条回答
  •  青春惊慌失措
    2020-12-03 02:21

    I implemented better-apidoc, a patched version of the sphinx-apidoc script that adds full support for templates.

    It adds a -t/--template option, allowing to pass a template directory that must contain template files package.rst and module.rst. See package.rst and module.rst for an example. These render to e.g. http://qnet.readthedocs.io/en/latest/API/qnet.algebra.operator_algebra.html.

提交回复
热议问题