How to create one page for each module using sphinx

We use Sphinx to create our Python documentation.

This is the command line we use:

sphinx-apidoc -F -o %WORKSPACE%\docs_rst %PACKAGE% sphinx-build -b html %WORKSPACE%\docs_rst %WORKSPACE%\docs 

The problem is that we get one page for each package. However, we really need one page for each module, since the page will be too long otherwise.

How can I customize this please?

+6
source share
2 answers

I sent a patch for Sphinx to accomplish exactly what you are asking for - it adds a command line option for apidoc that will put each module on its page.

The patch can be viewed here: https://bitbucket.org/birkenfeld/sphinx/pull-request/161/added-option-to-apidoc-to-write-each

A merger with Sphinx is currently expected.

+5
source

Perhaps you can do something like this using the autosummary extension and sphinx-autogen script (possibly using your own templates).

0
source

Source: https://habr.com/ru/post/921266/


All Articles