This plugin eases the inclusion of Graphs using the Graphiz tools (dot, ...).

The Graphviz tools must be installed to use this plugin.

Usage:

$ stog --package stog.dot ...

This plugin adds a new base rule dot. Here are the possible ways to use it:

CodeResult
Output to graph1.svg, using an <img> node to show the image:
digraph g { rankdir = LR; a [ shape="box" ] ; a -> b; a -> c ; b -> c ; }]]>
Output a png file to graph2.png, use neato instead of dot in the command and read source from graph.dot:
]]>
With graph.dot:
With <doc-...> rules to get links and labels, using attribute defer_="1" in the <dot> so that rewriting is performed in its children before the code is being passed to dot:
digraph g { rankdir = LR; plugins -> asy ; plugins -> dot ; plugins [ href="" ] asy [ href="", label="" ] ; dot [ href="" ] ; }]]>
Since no outfile attribute is given, the svg file produced is included (no use of <img>).
The node labels are clickable and the links are generated (and so valid) by Stog:
Including again the produced svg file. To avoid conflicts in ids, we use the prefix-svg-ids="foo" attribute:
digraph g { rankdir = LR; a [ shape="box" ] ; a -> b; a -> c ; b -> c ; }]]>
The contents of the args attribute is used as additional argument to the command which is run:
digraph g { rankdir = LR; a -> b; a -> c ; b -> c ; }]]>