sphinxcontrib-actdiag

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

.. actdiag::

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

None

Setting

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

Install

$ sudo easy_install sphinxcontrib-actdiag

Configure Sphinx

To enable this extension, add sphinxcontrib.actdiag module to extensions option at conf.py.

# Enabled extensions
extensions = ['sphinxcontrib.actdiag']

# Fontpath for actdiag (truetype font)
actdiag_fontpath = '/usr/share/fonts/truetype/ipafont/ipagp.ttf'

Directive

.. actdiag:: [filename]

This directive insert a actuence diagram into the generated document. If filename is specified, sphinx reads external file as source script of blockfile. In another case, actdiag directive takes code block as source script.

Examples:

.. actdiag:: foobar.diag

.. actdiag::

   actdiag {
      // 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:

.. actdiag::
   :maxwidth: 240

   actdiag {
      // 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:

.. actdiag::
   :desctable:

   actdiag {
      A -> B -> C;
      A [description = "first action"];
      B [description = "second action"];
      C [description = "third action"];

      lane {
         A; B;
      }
      lane {
         C;
      }
   }

Output

None

Name Description
A first action
B second action
C third action

Configuration File Options

actdiag_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.

actdiag_antialias

If actdiag_antialias: is True, actdiag generates images with anti-alias filter.

actdiag_html_image_format

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

actdiag_tex_image_format

You can specify image format on converting docs to TeX using actdiag_html_image_format . actdiag_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 actdiag

This Page