Skip to content

Latest commit

 

History

History
174 lines (115 loc) · 5.47 KB

inheritance.rst

File metadata and controls

174 lines (115 loc) · 5.47 KB

rest

sphinx.ext.inheritance_diagram -- Include inheritance diagrams

sphinx.ext.inheritance_diagram

0.6

This extension allows you to include inheritance diagrams, rendered via the Graphviz extension <sphinx.ext.graphviz>.

It adds this directive:

Examples

The following are different inheritance diagrams for the internal InheritanceDiagram class that implements the directive.

With full names:

.. inheritance-diagram:: sphinx.ext.inheritance_diagram.InheritanceDiagram

sphinx.ext.inheritance_diagram.InheritanceDiagram

Showing class names only:

.. inheritance-diagram:: sphinx.ext.inheritance_diagram.InheritanceDiagram
   :parts: 1

sphinx.ext.inheritance_diagram.InheritanceDiagram

Stopping the diagram at sphinx.util.docutils.SphinxDirective (the highest superclass still part of Sphinx), and dropping the common left-most part (sphinx) from all names:

.. inheritance-diagram:: sphinx.ext.inheritance_diagram.InheritanceDiagram
   :top-classes: sphinx.util.docutils.SphinxDirective
   :parts: -1

sphinx.ext.inheritance_diagram.InheritanceDiagram

Configuration

inheritance_graph_attrs

A dictionary of graphviz graph attributes for inheritance diagrams.

For example:

inheritance_graph_attrs = dict(rankdir="LR", size='"6.0, 8.0"',
                               fontsize=14, ratio='compress')

inheritance_node_attrs

A dictionary of graphviz node attributes for inheritance diagrams.

For example:

inheritance_node_attrs = dict(shape='ellipse', fontsize=14, height=0.75,
                              color='dodgerblue1', style='filled')

inheritance_edge_attrs

A dictionary of graphviz edge attributes for inheritance diagrams.

inheritance_alias

Allows mapping the full qualified name of the class to custom values (useful when exposing the underlying path of a class is not desirable, e.g. it's a private class and should not be instantiated by the user).

For example:

inheritance_alias = {'_pytest.Magic': 'pytest.Magic'}