sphinxcontrib-seqdiag

sphinxcontrib-seqdiag is sphinx extension for embedding seqdiag diagrams. You can embed block diagrams with seqdiag directive.

.. seqdiag::

    seqdiag admin {
      A -> B -> C;
    }

None

Setting

You can get archive file at http://bitbucket.org/birkenfeld/sphinx-contrib/

Install

$ sudo easy_install sphinxcontrib-seqdiag

Configure Sphinx

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'

Directive

.. seqdiag:: [filename]

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

None

Name Description
A first node
B second node
C third node

Configuration File Options

seqdiag_fontpath

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.

seqdiag_antialias

If seqdiag_antialias: is True, seqdiag generates images with anti-alias filter.

seqdiag_html_image_format

You can specify image format on converting docs to HTML using seqdiag_html_image_format . seqdiag_html_image_format accepts ‘PNG’ or ‘SVG’ .

seqdiag_tex_image_format

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 .

Table Of Contents

Previous topic

Sample diagams

Next topic

Demo - interactive shell for seqdiag

This Page