Sorting display by class using sphinx with 'autodoc'?

梦想与她 提交于 2019-11-27 09:08:35

The autosummary extension, with the autosummary_generate configuration variable set to True, can be used to 1) generate compact summary listings and 2) generate class documentation with one page per class.

You have to explicitly specify each class to be included, but once this is done you have a setup for generating clear documentation where the classes are visually well separated.

The following markup will output one "stub" .rst page for each class (Class1, Class2, Class3). Each page is based on a template and includes an .. autoclass:: directive that extracts the full documentation. In the final HTML output, each class page is linked from the corresponding entry in the main autosummary table.

:mod:`mymodule` --- Some module
===============================

This module contains several classes. 

.. currentmodule:: mymodule

Class overview
--------------

.. autosummary::
   :toctree: stubs
   :template: class.rst

   Class1
   Class2
   Class3

Details here: http://sphinx-doc.org/ext/autosummary.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!