Name

cx:ditaa — Convert a “DIagrams Through ASCII Art” diagram into an image.

Synopsis

<p:declare-step type="cx:ditaa" xmlns:cx="http://xmlcalabash.com/ns/extensions">
     <p:input port="source" sequence="true"/>
     <p:output port="result" sequence="true"/>
     <p:option name="shadows" select="true()"/>                    <!-- boolean -->
     <p:option name="antialias" select="true()"/>                  <!-- boolean -->
     <p:option name="corners" select="'square'"/>                  <!-- "rounded" | "square" -->
     <p:option name="separation" select="true()"/>                 <!-- boolean -->
     <p:option name="scale"/>                                      <!-- float -->
     <p:option name="html" select="false()"/>                      <!-- boolean -->
</p:declare-step>

Description

This step converts ditaa diagrams into PNG images. The step returns a base64 encoded data: URI.

If the html option is true, an HTML img is returned, otherwise a c:data element that contains the URI is returned.

Here's an example from the ditaa site:


+--------+   +-------+    +-------+
|        | --+ ditaa +--> |       |
|  Text  |   +-------+    |diagram|
|Document|   |!magic!|    |       |
|     {d}|   |       |    |       |
+---+----+   +-------+    +-------+
    :                         ^
    |       Lots of work      |
    +-------------------------+

Run through the cx:ditaa step, you get:

There are lots of other examples on the ditaa site.

Implementation

To use this step you must have the xmlcalabash1-ditaa module. The jar file from that project must be in the class path in order to use this step.