| 1 |
======== |
| 2 |
Graphviz |
| 3 |
======== |
| 4 |
|
| 5 |
Inheritance Diagram |
| 6 |
------------------- |
| 7 |
|
| 8 |
If you use :mod:`sphinx.ext.inheritance_diagram` to generate inheritance diagrams with |
| 9 |
:mod:`sphinx.ext.graphviz`, and you output the inheritance diagrams in SVG format, |
| 10 |
they will automatically adapt to this theme's light or dark mode. |
| 11 |
|
| 12 |
To have the inheritance-diagram render to SVG, inside ``conf.py``, you need |
| 13 |
the following option. |
| 14 |
|
| 15 |
.. code-block:: python |
| 16 |
|
| 17 |
# conf.py |
| 18 |
... |
| 19 |
graphviz_output_format = 'svg' |
| 20 |
... |
| 21 |
|
| 22 |
Below is an example of the inheritance diagram for ``matplotlib.figure.Figure``. |
| 23 |
Try toggling light/dark mode to see it adapt! |
| 24 |
|
| 25 |
.. inheritance-diagram:: matplotlib.figure.Figure |
| 26 |
|
| 27 |
See the sphinx inheritance-diagram `documentation`_ for more information. |
| 28 |
|
| 29 |
.. _documentation: https://www.sphinx-doc.org/en/master/usage/extensions/inheritance.html |