-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add example demonstrating inheritance diagram
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
======== | ||
Graphviz | ||
======== | ||
|
||
Inheritance Diagram | ||
------------------- | ||
|
||
Using `sphinx.ext.inheritance_diagram`, inheritance diagrams can be generated | ||
through `sphinx.ext.graphviz`. If the output of the inheritance diagrams are | ||
in `svg` format, they can be made to conform to light or dark mode. | ||
|
||
To have the inheritance-diagram render to `svg`, inside `conf.py`, you need | ||
the following option. | ||
|
||
.. code-block:: python | ||
# conf.py | ||
... | ||
graphviz_output_format = 'svg' | ||
... | ||
Below is an example of the inheritance diagram for ``matplotlib.figure.Figure`` | ||
|
||
.. inheritance-diagram:: matplotlib.figure.Figure | ||
|
||
See the sphinx inheritance-diagram `documentation`_ for more information. | ||
|
||
.. _documentation: https://www.sphinx-doc.org/en/master/usage/extensions/inheritance.html |