Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can the Sphinx "automodule" be told to automatically insert section breaks between members?

This question is inspired by the Mayavi documentation, which has nice section breaks with the name of the function being described between each module member.

My .rst right now just looks like:

SQLAlchemy Tables
**********************************

.. automodule:: ExperimentOrganizer.table_def
    :members:

(With all of the documentation formatted text in the module itself.)

Is there a simple way to indicate that I'd like to have section headers inserted between each member in :members:? If not, how did the Mayavi folks do it?

like image 721
paradiso Avatar asked Oct 21 '22 00:10

paradiso


1 Answers

Can the Sphinx "automodule" be told to automatically insert section breaks between members?

No. There is no magic option to automodule or something like that. If you want section headers then you'll have to add them yourself (perhaps by using a script) to the reST source. See also the answer to this similar question: Sphinx customizing autoclass output.

The Mayavi documentation that you refer to is not created with autodoc. The functions are documented using the function directive (not autofunction). Click on "Show Source" to see the reST markup.

like image 55
mzjn Avatar answered Oct 30 '22 03:10

mzjn