File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 31
31
"sphinx.ext.autosummary" ,
32
32
"sphinx.ext.todo" ,
33
33
"sphinx.ext.viewcode" ,
34
+ "sphinx.ext.graphviz" ,
34
35
"sphinxext.rediraffe" ,
35
36
"sphinx_design" ,
36
37
"sphinx_copybutton" ,
90
91
"jupyter" : ("Jupyter" , "https://jupyter.org" ),
91
92
}
92
93
94
+
95
+ # -- sphinx_ext_graphviz options ---------------------------------------------
96
+
97
+ graphviz_output_format = "svg"
98
+ inheritance_graph_attrs = dict (
99
+ rankdir = "LR" ,
100
+ fontsize = 14 ,
101
+ ratio = "compress" ,
102
+ )
103
+
93
104
# -- sphinx_togglebutton options ---------------------------------------------
94
105
togglebutton_hint = str (_ ("Click to expand" ))
95
106
togglebutton_hint_hide = str (_ ("Click to collapse" ))
Original file line number Diff line number Diff line change
1
+ ========
2
+ Graphviz
3
+ ========
4
+
5
+ Inheritance Diagram
6
+ -------------------
7
+
8
+ Using `sphinx.ext.inheritance_diagram `, inheritance diagrams can be generated
9
+ through `sphinx.ext.graphviz `. If the output of the inheritance diagrams are
10
+ in `svg ` format, they can be made to conform to 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
+
24
+ .. inheritance-diagram :: matplotlib.figure.Figure
25
+
26
+ See the sphinx inheritance-diagram `documentation `_ for more information.
27
+
28
+ .. _documentation : https://www.sphinx-doc.org/en/master/usage/extensions/inheritance.html
You can’t perform that action at this time.
0 commit comments