DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:ditaa

This is an old revision of the document!


Ditaa-Plugin

Compatible with DokuWiki

lemming, anteater, rincewind, angua, weatherwax, adora belle, detritus

plugin Converts ASCII-Flowcharts to png-Graphics using ditaa

Last updated on
2016-06-24
Provides
Syntax
Repository
Source

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Similar to a2s, dataplot, diagram, flowchartjs, flowcharts, graphviz, svgedit, wavedrom

Tagged with diagram, images, java, media

Previous author: Dennis Ploeger

Ditaa is a tool to convert ASCII-Art flowcharts and diagrams into their graphical equivalents. This Plugin integrates this feature into DokuWiki. See the ditaa homepage for details about ditaa.

Download and Installation

Download and install the plugin using the Plugin Manager using the URL given above. Refer to Plugins on how to install plugins manually.

Changes

Configuration

The plugin provides a configuration setting in the config manager to specify the path to your Java interpreter. When set, the tool will run the original ditaa locally on your server to create the graphics. The ditaa jar file is included in the plugin, you do not need to download it separately.

When you not provide a Java path, the plugin will instead use an alternative implementation of ditaa written in go. The plugin comes with 64bit versions for Windows and Linux, but will try downloading different binaries if needed. Please note that the go version has not all the features of the orginal ditaa in Java.

Syntax

The syntax wraps any ditaa formatted ASCII flowchart into <ditaa></ditaa> tags. The opening tag can have several additional optional parameters (see below).

<ditaa [optional parameters]>
 
... (some ditaa-code) ...
 
</ditaa>

Parameters

Parameter Default Description
width=<num> width=0 Rescale the final image to this width. When set to 0, diita will choose the needed width and no rescaling is done.
height=<num> height=0 Same as above but for height. Only works when a width is given as well
<num>x<num> 0x0 Combines the above parameters into one. That's a lowercase x!
<float>X 1.0X Tells ditaa to scale the image. Eg. 2.0X makes the final image twice as big. That's an uppercase X (only with Java)
(no)round noround Enable or disable round corners for all boxes (only with Java)
(no)shadow shadow Enable or disable box shadows (only with Java)
(no)antialias antialias Enable or disable antialiasing (only with Java)
(no)edgesep edgesep Enable or disabling the separation of box edges where boxes directly touch (only with Java)
left center right Align the image to the left, center or right. Default does no alignment (inline)

Possible tags

Not all shape selector tags are documented on the ditaa site. A quick source scan revealed:

tag Description
{c} decision(Choice)
{d} document
{io} input/output, parallelogram
{mo} manual operation
{o} ellipse, circle
{s} storage
{tr} trapezoid (looks like an inverted {mo} )

Example

Ditaa Example

<ditaa round noedgesep right>
    +--------+   +-------+    +-------+
    |        | --+ ditaa +--> |       |
    |  Text  |   +-------+    |diagram|
    |Document|   |!magic!|    |       |
    |     {d}|   |  c478 |    |       |
    +---+----+   +-------+    +-------+
        :                         ^
        |       Lots of work      :
        +-------------------------+
</ditaa>

Remarks

  • Sorry but tried this new version to replace the previous version on our site.
    No image is produced.
    Bypassed the generating command by putting a bat script (windows install) which launches java with a different set of parameters because the __DIR__ seems not to be substituted.
    logged this via the “report bugs” link (script is included)
    Now … sometimes an image is produced …
    Will roll back to the previous version.
    Tried this in the playground but I guess the plugin is not installed
    Thanks in advance for the effort: this is a great plugin !!
    Vi4Ever 29-jun-2016 07:22
  • On my internal site (git managed, stable branch checked out) the new ditaa plugin works great. It runs on PHP 5.3 on a SLES 11 SP4 server. — Werner Flamme 2016-06-29 08:36
  • Found errors in the drawing (corners having a pipe or = ) causing problems –> found via stderr.
    The dir problem will have to do something with versions of DW. Thanks for the quick feedback Werner.
    Drawings are much better with the new version.
  • HRun … old version … seems to work with the workaround via a script … but not natively. Can this be indicated in the compatibility list?
plugin/ditaa.1467184895.txt.gz · Last modified: 2016-06-29 09:21 by 91.194.202.200

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki