sphinx generate class modules overview

前端 未结 1 833
猫巷女王i
猫巷女王i 2021-02-08 20:25

I\'d like sphinx to generate a module overview similar to the one generated by doxygen, here is an example

I can\'t find how sphinx can do that

I could use Graph

1条回答
  •  不思量自难忘°
    2021-02-08 20:37

    Sphinx has a built-in extension called sphinx.ext.inheritance_diagram that uses Graphviz. It defines one directive: inheritance-diagram. Here is an example of how you could use it in an .rst file:

    .. inheritance-diagram:: mymodule.MyClass1 mymodule.MyClass2
       :parts: 1
    

    Here are some examples of inheritance diagrams in documents generated by Sphinx:

    • http://matplotlib.org/1.3.1/devel/documenting_mpl.html#inheritance-diagrams
    • http://openalea.gforge.inria.fr/doc/vplants/PlantGL/doc/_build/html/user/math.html#class-inheritance-diagram

    There is also a "generic" sphinx.ext.graphviz extension for embedding graphs in documentation.

    0 讨论(0)
提交回复
热议问题