sphinxcontrib-seqdiag is sphinx extension for embedding seqdiag diagrams. You can embed block diagrams with seqdiag directive.
.. seqdiag::
seqdiag admin {
A -> B -> C;
}
You can get archive file at http://bitbucket.org/birkenfeld/sphinx-contrib/
$ sudo easy_install sphinxcontrib-seqdiag
To enable this extension, add sphinxcontrib.seqdiag module to extensions option at conf.py.
# Enabled extensions
extensions = ['sphinxcontrib.seqdiag']
# Fontpath for seqdiag (truetype font)
seqdiag_fontpath = '/usr/share/fonts/truetype/ipafont/ipagp.ttf'
This directive insert a sequence diagram into the generated document. If filename is specified, sphinx reads external file as source script of blockfile. In another case, seqdiag directive takes code block as source script.
Examples:
.. seqdiag:: foobar.diag
.. seqdiag::
seqdiag {
// some diagrams are here.
}
This directive is able to generate thumbnail images using maxwidth option. maxwidth option takes pixel-size of image’s width.
Examples:
.. seqdiag::
:maxwidth: 240
seqdiag {
// some diagrams are here.
}
New in version 0.2.0.
This directive is able to generate description table using desctable option and description attribute
Input:
.. seqdiag::
:desctable:
seqdiag {
A -> B -> C;
A [description = "first node"];
B [description = "second node"];
C [description = "third node"];
}
Output
| Name | Description |
|---|---|
| A | first node |
| B | second node |
| C | third node |
This is a path for renderring fonts. You can use truetype font (.ttf) file path. You can specify single path with string, or multiple paths using array.
New in version 0.1.1.
If seqdiag_antialias: is True, seqdiag generates images with anti-alias filter.
You can specify image format on converting docs to HTML using seqdiag_html_image_format . seqdiag_html_image_format accepts ‘PNG’ or ‘SVG’ .
You can specify image format on converting docs to TeX using seqdiag_html_image_format . seqdiag_html_image_format accepts ‘PNG’ or ‘PDF’ .
If you set PDF, you will get clear diagram images as vector format. (*) reportlab is needed .