Using Dot Graphs#
Sphinx graphviz prerequisites#
To use Sphinx’s graphviz directive at all, the project documentation’s
conf.py file must have
sphinx.ext.graphviz added to the list of
extensions = ["breathe", "sphinx.ext.graphviz"]
To obtain the dot executable from the Graphviz library, see the library’s downloads section.
Typically, the dot executable’s path should be added to your system’s
variable. This is required for Sphinx, although the configuration option,
can compensate for abnormal dot executable installations.
By default, breathe will translate any dot and dotfile commands into Sphinx graphviz directives. However, there are some caveats:
The only graphviz option supported is the
captionoption. Graph captions are optionally specified using the dot or dotfile command syntax. All other graphviz directive options fallback to their default behavior.
@refcommand within any dot syntax is functionally ignored and treated as literal text.
Generated graphs from Doxygen#
If Doxygen is configured to use the dot executable to generate certain graphs, then some of these
graphs can be translated into Sphinx graphviz directives. Because this feature depends on having
the dot executable installed to generate graphs in Sphinx, the option
allow-dot-graphs must be
specified for the following directives:
Only the following graphs generated by Doxygen can be found in its XML output:
files included within
files included by
caller graphs are not provided by Doxygen’s XML output.
Examples of graphs generated by Doxygen are shown in this documentation’s Diagrams section of the doxygen test suite
Graphs can be placed anywhere. For this example they are placed in a doxygen page.
.. doxygenpage:: dotgraphs :project: dot_graphs
This will render as: