Graphviz Example
There is a plugin for sphinx
called sphinx.ext.graphviz
which adds support for embedding graphviz
graphs
in your documents. One can achieve this by following these instructions:
Make sure
graphviz
is properly installed on your machine/environment, for instance it can be installed viaconda
like this:conda install -c conda-forge graphviz
Make sure that this plugin would be recognized in your
conf.py
by adding it to theextentions
listNote
In this project the
conf.py
is generated bycmake
from theconf.py.in
file and therefore this addition should be added toconf.py.in
since it’s the template file for the generatedconf.py
.extentions = [ ... "sphinx.ext.graphviz", ... ]
After those instructions you should be able to add the following directives in your .rst
files
.. graphviz::
digraph foo {
"bar" -> "baz";
}
Here is how it looks:
