App-Basis-ConvertText2

 view release on metacpan or  search on metacpan

docs/README.html  view on Meta::CPAN

<p>The only valid contents of the code-block is a single line of comma separated numbers.</p>
<p>The full set of optional arguments is</p>
<ul>
<li>title
<ul>
<li>used as the generated images ‘alt’ argument</li>
</ul></li>
<li>bgcolor
<ul>
<li>background color in hex (123456) or transparent</li>
</ul></li>
<li>line
<ul>
<li>color or the line, in hex (abcdef)</li>
</ul></li>
<li>color
<ul>
<li>area under the line, in hex (abcdef)</li>
</ul></li>
<li>scheme
<ul>
<li>color scheme, only things in red blue green orange mono are valid</li>
</ul></li>
<li>size
<ul>
<li>size of image, default 80x20, widthxheight</li>
</ul></li>
</ul>
<p><strong>Example</strong></p>
<pre><code>~~~~{.buffer to_buffer=&#39;spark_data&#39;}
1,4,5,20,4,5,3,1
~~~~

here is a standard sparkline

~~~~{.sparkline title=&#39;basic sparkline&#39; }
1,4,5,20,4,5,3,1
~~~~

or we can draw the sparkline using buffered data

~~~~{.sparkline title=&#39;blue sparkline&#39; scheme=&#39;blue&#39; from_buffer=&#39;spark_data&#39;}
~~~~</code></pre>
<p><strong>Output</strong></p>
<p>here is a standard sparkline</p>
<p><img src='/tmp/kmulholland/cache/ct2/c9a9b4c7e6f8cb1089d82d00ff3eb216.png' alt='basic sparkline' height='20' width='80' /></p>
<p>or we can draw the sparkline using buffered data</p>
<p><img src='/tmp/kmulholland/cache/ct2/fd3d73d870204418c0dd327f7477c09a.png' alt='blue sparkline' height='20' width='80' /></p>
<h2 id="charts"><a name='6_charts'>6 Charts</a></h2>
<p>Displaying charts is very important when creating reports, so we have a simple <strong>chart</strong> code-block.</p>
<p>The various arguments to the code-block are shown in the examples below, hopefully they are self explanatory.</p>
<p>We will buffer some data to start</p>
<p><strong>Example</strong></p>
<pre><code>~~~~{.buffer to=&#39;chart_data&#39;}
apples,bananas,cake,cabbage,edam,fromage,tomatoes,chips
1,2,3,5,11,22,33,55
1,2,3,5,11,22,33,55
1,2,3,5,11,22,33,55
1,2,3,5,11,22,33,55
~~~~</code></pre>
<p>The content comprises a number of lines of comma separated data items. The first line of the content is the legends, the subsequent lines are numbers relating to each of these legends.</p>
<h3 id="pie-chart"><a name='6.1_pie_chart'>6.1 Pie chart</a></h3>
<p><strong>Example</strong></p>
<pre><code>~~~~{.chart format=&#39;pie&#39; title=&#39;chart1&#39; from_buffer=&#39;chart_data&#39;
    size=&#39;400x400&#39; xaxis=&#39;things xways&#39; yaxis=&#39;Vertical things&#39;
    legends=&#39;a,b,c,d,e,f,g,h&#39; }
~~~~</code></pre>
<p><strong>Output</strong></p>
<p><img src='/tmp/kmulholland/cache/ct2/b82cab1f86108fdab6afbe84d1869d6a.png' alt='chart1' height='400' width='400' /></p>
<h3 id="bar-chart"><a name='6.2_bar_chart'>6.2 Bar chart</a></h3>
<p><strong>Example</strong></p>
<pre><code>~~~~{.chart format=&#39;bars&#39; title=&#39;chart1&#39; from_buffer=&#39;chart_data&#39;
    size=&#39;600x400&#39; xaxis=&#39;things ways&#39; yaxis=&#39;Vertical things&#39;
    legends=&#39;a,b,c,d,e,f,g,h&#39; }
~~~~</code></pre>
<p><strong>Output</strong></p>
<p><img src='/tmp/kmulholland/cache/ct2/511c5b56e040bea36912d2b0987f5d1d.png' alt='chart1' height='400' width='600' /></p>
<h3 id="mixed-chart"><a name='6.3_mixed_chart'>6.3 Mixed chart</a></h3>
<p><strong>Example</strong></p>
<pre><code>~~~~{.chart format=&#39;mixed&#39; title=&#39;chart1&#39; from_buffer=&#39;chart_data&#39;
  size=&#39;600x400&#39; xaxis=&#39;things xways&#39; axis=&#39;Vertical things&#39;
  legends=&#39;a,b,c,d,e,f,g,h&#39; types=&#39;lines linepoints lines bars&#39; }
~~~~</code></pre>
<p><strong>Output</strong></p>
<p><img src='/tmp/kmulholland/cache/ct2/a1903dfe13a20e39b9e880ff1ee06b0c.png' alt='chart1' height='400' width='600' /></p>
<h2 id="message-sequence-charts---mscgen"><a name='7_message_sequence_charts_-_mscgen'>7 Message Sequence Charts - mscgen</a></h2>
<p>Software (or process) engineers often want to be able to show the sequence in which a number of events take place. We use the <a href="http://www.mcternan.me.uk/mscgen/">msc</a> program for this. This program needs to be installed onto your system...
<p>The content for this code-block is EXACTLY the same that you would use as input to <a href="http://www.mcternan.me.uk/mscgen/">msc</a></p>
<p>There are only optional 2 arguments</p>
<ul>
<li>title
<ul>
<li>used as the generated images ‘alt’ argument</li>
</ul></li>
<li>size
<ul>
<li>size of image, widthxheight</li>
</ul></li>
</ul>
<p><strong>Example</strong></p>
<pre><code>~~~~{.mscgen  title=&quot;mscgen1&quot; size=&quot;600x400}
# MSC for some fictional process
msc {
  a,b,c;

  a-&gt;b [ label = &quot;ab()&quot; ] ;
  b-&gt;c [ label = &quot;bc(TRUE)&quot;];
  c=&gt;c [ label = &quot;process(1)&quot; ];
  c=&gt;c [ label = &quot;process(2)&quot; ];
  ...;
  c=&gt;c [ label = &quot;process(n)&quot; ];
  c=&gt;c [ label = &quot;process(END)&quot; ];
  a&lt;&lt;=c [ label = &quot;callback()&quot;];
  ---  [ label = &quot;If more to run&quot;, ID=&quot;*&quot; ];
  a-&gt;a [ label = &quot;next()&quot;];
  a-&gt;c [ label = &quot;ac1()\nac2()&quot;];
  b&lt;-c [ label = &quot;cb(TRUE)&quot;];
  b-&gt;b [ label = &quot;stalled(...)&quot;];
  a&lt;-b [ label = &quot;ab() = FALSE&quot;];
}
~~~~</code></pre>
<p><strong>Output</strong></p>
<p><img src='/tmp/kmulholland/cache/ct2/160e2de7aa8dc2a0f02f2117a1cafd4a.png' alt='mscgen1' height='448' width='600' /></p>
<h2 id="diagrams-through-ascii-art---ditaa"><a name='8_diagrams_through_ascii_art_-_ditaa'>8 DIagrams Through Ascii Art - ditaa</a></h2>
<p>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 <a href="http://ditaa.so...
<p>The content for this code-block must be the same that you would use to with the <a href="http://ditaa.sourceforge.net">ditaa</a> software</p>
<ul>
<li>title
<ul>
<li>used as the generated images ‘alt’ argument</li>
</ul></li>
<li>size
<ul>
<li>size of image, default 80x20, widthxheight</li>
</ul></li>
</ul>
<p><strong>Example</strong></p>
<pre><code>~~~~{.ditaa }
Full example
+--------+   +-------+    +-------+
|        | --+ ditaa +--&gt; |       |
|  Text  |   +-------+    |diagram|

docs/README.html  view on Meta::CPAN

   +++ Italy
   +++ Germany
   ++++ Berlin
   ++ Africa
  }
}
@enduml
~~~~</code></pre>
<p><strong>Output</strong></p>
<p><img src='/tmp/kmulholland/cache/ct2/311e4ee5750d33a093ab106219647946.png' height='318' width='168' /></p>
<h2 id="graphviz"><a name='10_graphviz'>10 Graphviz</a></h2>
<p><a href="http://graphviz.org">graphviz</a> allows you to draw connected graphs using text descriptions.</p>
<p>The content for this code-block must be the same that you would use to with the <a href="http://graphviz.org">graphviz</a> software</p>
<p>The arguments allowed are</p>
<ul>
<li>title
<ul>
<li>used as the generated images ‘alt’ argument</li>
</ul></li>
<li>size
<ul>
<li>size of image, default 80x20, widthxheight</li>
</ul></li>
</ul>
<p><strong>Example</strong></p>
<pre><code>~~~~{.graphviz  title=&quot;graphviz1&quot; size=&#39;600x600&#39;}
digraph G {

  subgraph cluster_0 {
    style=filled;
    color=lightgrey;
    node [style=filled,color=white];
    a0 -&gt; a1 -&gt; a2 -&gt; a3;
    label = &quot;process #1&quot;;
  }

  subgraph cluster_1 {
    node [style=filled];
    b0 -&gt; b1 -&gt; b2 -&gt; b3;
    label = &quot;process #2&quot;;
    color=blue
  }
  start -&gt; a0;
  start -&gt; b0;
  a1 -&gt; b3;
  b2 -&gt; a3;
  a3 -&gt; a0;
  a3 -&gt; end;
  b3 -&gt; end;

  start [shape=Mdiamond];
  end [shape=Msquare];
}
~~~~</code></pre>
<p><strong>Output</strong></p>
<p><img src='/tmp/kmulholland/cache/ct2/d25c89fc3008d30afc6dc3fd38178ab2.png' alt='graphviz1' height='600' width='306' /></p>
<h2 id="venn-diagram"><a name='11_venn_diagram'>11 Venn diagram</a></h2>
<p>Creating venn diagrams may sometimes be useful, though to be honest this implementation is not great, if I could find a better way to do this then I would!</p>
<p><strong>Example</strong></p>
<pre><code>~~~~{.venn  title=&quot;sample venn diagram&quot;
    legends=&quot;team1 team2 team3&quot; scheme=&quot;rgb&quot; explain=&#39;1&#39;}
abel edward momo albert jack julien chris
edward isabel antonio delta albert kevin jake
gerald jake kevin lucia john edward
~~~~</code></pre>
<p><strong>Output</strong></p>
<p><img src='/tmp/kmulholland/cache/ct2/9e0b98ce7e0ea5829245653fa0eade79.png' alt='sample venn diagram' height='400' width='400' /></p>
<ul>
<li>only in team1 : julien momo abel chris jack
<ul>
<li>only in team2 : delta isabel antonio</li>
<li>team1 and team2 share : albert</li>
</ul></li>
<li>only in team3 : gerald john lucia
<ul>
<li>team1 and team3 share :</li>
<li>team2 and team3 share : jake kevin</li>
<li>team1, team2 and team3 share : edward</li>
</ul></li>
</ul>
<h2 id="barcodes"><a name='12_barcodes'>12 Barcodes</a></h2>
<p>Sometimes having barcodes in your document may be useful, certainly qrcodes are popular.</p>
<p>The code-block only allows a single line of content. Some of the barcode types need content of a specific length, warnings will be generated if the length is incorrect.</p>
<p>The arguments allowed are</p>
<ul>
<li>title
<ul>
<li>used as the generated images ‘alt’ argument</li>
</ul></li>
<li>height
<ul>
<li>height of image</li>
</ul></li>
<li>notext
<ul>
<li>flag to show we do not want the content text printed underneath the barcode.</li>
</ul></li>
<li>version
<ul>
<li>version of qrcode, defaults to ‘2’</li>
</ul></li>
<li>pixels
<ul>
<li>number of pixels that is a ‘bit’ in a qrcode, defaults to ‘2’</li>
</ul></li>
</ul>
<h3 id="code39"><a name='12.1_code39'>12.1 Code39</a></h3>
<p><strong>Example</strong></p>
<pre><code>~~~~{.barcode type=&#39;code39&#39;}
123456789
~~~~</code></pre>
<p><strong>Output</strong></p>
<p><img src='/tmp/kmulholland/cache/ct2/0e7f2287c82ea14554939a0691e8aae1.png' height='50' width='144' /></p>
<h3 id="ean8"><a name='12.2_ean8'>12.2 EAN8</a></h3>
<p>Only allows 8 characters</p>
<p><strong>Example</strong></p>
<pre><code>~~~~{.barcode type=&#39;ean8&#39;}
12345678
~~~~</code></pre>
<p><strong>Output</strong></p>
<p><img src='/tmp/kmulholland/cache/ct2/3d239d23db81d6fdf1b987b40073e6d4.png' height='50' width='67' /></p>

docs/README.html  view on Meta::CPAN

<p>Software engineers often use <a href="https://en.wikipedia.org/wiki/Json">JSON</a> to transfer data between systems, this often is not nice to create for documentation. <a href="https://en.wikipedia.org/wiki/Yaml">YAML</a> which is a superset of <...
<p><strong>Example</strong></p>
<pre><code>~~~~{.yamlasjson }
list:
  - array: [1,2,3,7]
    channel: BBC3
    date: 2013-10-20
    time: 20:30
  - array: [1,2,3,9]
    channel: BBC4
    date: 2013-11-20
    time: 21:00

~~~~</code></pre>
<p><strong>Output</strong></p>
<pre class="sourceCode json"><code class="sourceCode json"><span class="fu">{</span>
   <span class="dt">&quot;list&quot;</span> <span class="fu">:</span> <span class="ot">[</span>
      <span class="fu">{</span>
         <span class="dt">&quot;array&quot;</span> <span class="fu">:</span> <span class="ot">[</span>
            <span class="st">&quot;1&quot;</span><span class="ot">,</span>
            <span class="st">&quot;2&quot;</span><span class="ot">,</span>
            <span class="st">&quot;3&quot;</span><span class="ot">,</span>
            <span class="st">&quot;7&quot;</span>
         <span class="ot">]</span><span class="fu">,</span>
         <span class="dt">&quot;channel&quot;</span> <span class="fu">:</span> <span class="st">&quot;BBC3&quot;</span><span class="fu">,</span>
         <span class="dt">&quot;date&quot;</span> <span class="fu">:</span> <span class="st">&quot;2013-10-20&quot;</span><span class="fu">,</span>
         <span class="dt">&quot;time&quot;</span> <span class="fu">:</span> <span class="st">&quot;20:30&quot;</span>
      <span class="fu">}</span><span class="ot">,</span>
      <span class="fu">{</span>
         <span class="dt">&quot;array&quot;</span> <span class="fu">:</span> <span class="ot">[</span>
            <span class="st">&quot;1&quot;</span><span class="ot">,</span>
            <span class="st">&quot;2&quot;</span><span class="ot">,</span>
            <span class="st">&quot;3&quot;</span><span class="ot">,</span>
            <span class="st">&quot;9&quot;</span>
         <span class="ot">]</span><span class="fu">,</span>
         <span class="dt">&quot;date&quot;</span> <span class="fu">:</span> <span class="st">&quot;2013-11-20&quot;</span><span class="fu">,</span>
         <span class="dt">&quot;time&quot;</span> <span class="fu">:</span> <span class="st">&quot;21:00&quot;</span><span class="fu">,</span>
         <span class="dt">&quot;channel&quot;</span> <span class="fu">:</span> <span class="st">&quot;BBC4&quot;</span>
      <span class="fu">}</span>
   <span class="ot">]</span>
<span class="fu">}</span></code></pre>
<h2 id="table"><a name='14_table'>14 Table</a></h2>
<p>Create a simple table using CSV style data</p>
<ul>
<li>class
<ul>
<li>HTML/CSS class name</li>
</ul></li>
<li>id
<ul>
<li>HTML/CSS class</li>
</ul></li>
<li>width
<ul>
<li>width of the table</li>
</ul></li>
<li>style
<ul>
<li>style the table if not doing anything else</li>
</ul></li>
<li>legends
<ul>
<li>csv of headings for table, these correspond to the data sets</li>
</ul></li>
<li>separator
<ul>
<li>what should be used to separate cells, defaults to ‘,’</li>
</ul></li>
</ul>
<p><strong>Example</strong></p>
<pre><code>~~~~{.table separator=&#39;,&#39; width=&#39;100%&#39; legends=1
    from_buffer=&#39;chart_data&#39;}
~~~~</code></pre>
<p><strong>Output</strong></p>
<table width='100%' >
<tr><th>
apples
</th><th>
bananas
</th><th>
cake
</th><th>
cabbage
</th><th>
edam
</th><th>
fromage
</th><th>
tomatoes
</th><th>
chips
</th></tr>
<tr><td>
1
</td><td>
2
</td><td>
3
</td><td>
5
</td><td>
11
</td><td>
22
</td><td>
33
</td><td>
55
</td></tr>
<tr><td>
1
</td><td>
2
</td><td>
3
</td><td>
5
</td><td>
11
</td><td>
22
</td><td>
33
</td><td>
55
</td></tr>
<tr><td>
1
</td><td>
2
</td><td>



( run in 1.066 second using v1.01-cache-2.11-cpan-39bf76dae61 )