Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sphinx generate class modules overview

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 Graphviz to generate some sort of graph, but I can't find a way to get a clickable object in the graph that operates in the same way as the example above.

Is there any way to do that in sphinx directly or some hack to make it work as the doxygen module overview?

like image 903
Fynn Avatar asked Dec 10 '13 06:12

Fynn


1 Answers

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.

like image 126
mzjn Avatar answered Nov 09 '22 01:11

mzjn