App-Basis-ConvertText2

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN


## DIagrams Through Ascii Art - ditaa

This is a special system to turn ASCII art into pretty pictures, nice to render diagrams.
You do need to make sure that you are using a proper monospaced font with your editor otherwise things will go awry with spaces. See [ditaa] for reference.

The content for this code-block must be the same that you would use to with the [ditaa] software

* title
    * used as the generated images 'alt' argument
* size
    * size of image, default 80x20, widthxheight

**Example**

    ~~~~{.ditaa }
    Full example
    +--------+   +-------+    +-------+
    |        | --+ ditaa +--> |       |
    |  Text  |   +-------+    |diagram|
    |Document|   |!magic!|    |       |
    |     {d}|   |       |    |       |
    +---+----+   +-------+    +-------+
        :                         ^
        |       Lots of work      |
        \-------------------------+
    ~~~~

**Output**

~~~~{.ditaa }
Full example
+--------+   +-------+    +-------+
|        | --+ ditaa +--> |       |
|  Text  |   +-------+    |diagram|
|Document|   |!magic!|    |       |
|     {d}|   |       |    |       |
+---+----+   +-------+    +-------+
    :                         ^
    |       Lots of work      |
    \-------------------------+
~~~~

## UML Diagrams

Software engineers love to draw diagrams, [PlantUML] is a java component to make this simple.

You will need to have a script on your system called 'uml' that calls java with the component.

Here is mine, it is also available in the scripts directory in the

~~~~{ .shell}
#!/bin/bash
# run plantuml
# moodfarm@cpan.org

# we assume that the plantuml.jar file is in the same directory as this executable
EXEC_DIR=`dirname $0`
PLANTUML="$EXEC_DIR/plantuml.jar"

INPUT=$1
OUPUT=$2
function show_usage  {
    arg=$1
    err=$2
    if [ "$err" == "" ] ; then
        err=1
    fi
      "Create a UML diagram from an input text file
(see http://plantuml.sourceforge.net/ for reference)
    usage: $0 inputfile outputfile.png
"
    if [ "$arg" != "" ] ; then
        echo "$arg
"
    fi
    exit $err
}
if [ "$INPUT" == "-help" ] ; then
    show_usage "" 0
fi
if [ ! -f "$INPUT" ] ; then
    show_usage "ERROR: Could not find input file $1"
fi
if [ "$OUPUT" == "" ] ; then
    show_usage "ERROR: No output file specified"
fi
# we use the pipe option to control output into the file we want
cat "$INPUT" | java -jar $PLANTUML -nbthread auto -pipe >$OUPUT
# exit 0
~~~~

The content for this code-block must be the same that you would use to with the [PlantUML] software

The arguments allowed are

* title
    * used as the generated images 'alt' argument
* size
    * size of image, default 80x20, widthxheight

**Example**

    ~~~~{.uml }
    ' this is a comment on one line
    /' this is a
    multi-line
    comment'/
    Alice -> Bob: Authentication Request
    Bob --> Alice: Authentication Response

    Alice -> Bob: Another authentication Request
    Alice <-- Bob: another authentication Response
    ~~~~

**Output**

~~~~{.uml }
' this is a comment on one line
/' this is a
multi-line
comment'/
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response

Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response
~~~~

[PlantUML] can also create simple application interfaces [See Salt]

**Example**

    ~~~~{.uml }
    @startuml
    salt
    {
      Just plain text
      [This is my button]
      ()  Unchecked radio
      (X) Checked radio
      []  Unchecked box
      [X] Checked box
      "Enter text here   "
      ^This is a droplist^

      {T
       + World
       ++ America



( run in 0.484 second using v1.01-cache-2.11-cpan-13bb782fe5a )