[openstack-dev] [infra] support graphviz in document publishing

Antoine Musso hashar at free.fr
Mon Nov 13 21:05:05 UTC 2017


On 13/11/2017 10:16, Yujun Zhang (ZTE) wrote:
> Hi, all
> 
> Sometimes a picture worths thousands word. I wonder if it is possible to
> support graphviz in https://docs.openstack.org/
> 
> What I expect is to include a dot file and render it as a picture in
> HTML output. The syntax is simple
> 
> .. graphviz:: aggregate-equivalent-alarms.files/example.dot
> 
> And should be supported by sphinx graphviz plugin[2]
> 
> See full example[1]. Currently I render the picture offline and include
> it manually in the document. It would be much more convenient for
> developer if the extension is added to document build job.
> 
> [1]:
> https://review.openstack.org/#/c/518196/5/proposals/aggregate-equivalent-alarms.rst
> [2]: http://www.sphinx-doc.org/en/stable/ext/graphviz.html

Hello,

I had some success with http://blockdiag.com/ which, IIRC, is pure
python. It supports various kind of graphs (block, sequences, network ...).

The few I did were for Zuul:
https://docs.openstack.org/infra/zuul/user/gating.html

In sphinx that looks like:

.. blockdiag::

  blockdiag foo {
    node_width = 40;
    span_width = 40;
    A <- B <- C <- D <- E;
  }


sphinxcontrib-blockdiag
https://pypi.python.org/pypi/sphinxcontrib-blockdiag

Might be worth looking at if you want something simpler than graphviz
and to not depend on it.

-- 
Antoine "hashar" Musso



More information about the OpenStack-dev mailing list