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='spark_data'}
1,4,5,20,4,5,3,1
~~~~
here is a standard sparkline
~~~~{.sparkline title='basic sparkline' }
1,4,5,20,4,5,3,1
~~~~
or we can draw the sparkline using buffered data
~~~~{.sparkline title='blue sparkline' scheme='blue' from_buffer='spark_data'}
~~~~</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='chart_data'}
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='pie' title='chart1' from_buffer='chart_data'
size='400x400' xaxis='things xways' yaxis='Vertical things'
legends='a,b,c,d,e,f,g,h' }
~~~~</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='bars' title='chart1' from_buffer='chart_data'
size='600x400' xaxis='things ways' yaxis='Vertical things'
legends='a,b,c,d,e,f,g,h' }
~~~~</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='mixed' title='chart1' from_buffer='chart_data'
size='600x400' xaxis='things xways' axis='Vertical things'
legends='a,b,c,d,e,f,g,h' types='lines linepoints lines bars' }
~~~~</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="mscgen1" size="600x400}
# MSC for some fictional process
msc {
a,b,c;
a->b [ label = "ab()" ] ;
b->c [ label = "bc(TRUE)"];
c=>c [ label = "process(1)" ];
c=>c [ label = "process(2)" ];
...;
c=>c [ label = "process(n)" ];
c=>c [ label = "process(END)" ];
a<<=c [ label = "callback()"];
--- [ label = "If more to run", ID="*" ];
a->a [ label = "next()"];
a->c [ label = "ac1()\nac2()"];
b<-c [ label = "cb(TRUE)"];
b->b [ label = "stalled(...)"];
a<-b [ label = "ab() = FALSE"];
}
~~~~</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 +--> | |
| 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="graphviz1" size='600x600'}
digraph G {
subgraph cluster_0 {
style=filled;
color=lightgrey;
node [style=filled,color=white];
a0 -> a1 -> a2 -> a3;
label = "process #1";
}
subgraph cluster_1 {
node [style=filled];
b0 -> b1 -> b2 -> b3;
label = "process #2";
color=blue
}
start -> a0;
start -> b0;
a1 -> b3;
b2 -> a3;
a3 -> a0;
a3 -> end;
b3 -> 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="sample venn diagram"
legends="team1 team2 team3" scheme="rgb" explain='1'}
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='code39'}
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='ean8'}
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">"list"</span> <span class="fu">:</span> <span class="ot">[</span>
<span class="fu">{</span>
<span class="dt">"array"</span> <span class="fu">:</span> <span class="ot">[</span>
<span class="st">"1"</span><span class="ot">,</span>
<span class="st">"2"</span><span class="ot">,</span>
<span class="st">"3"</span><span class="ot">,</span>
<span class="st">"7"</span>
<span class="ot">]</span><span class="fu">,</span>
<span class="dt">"channel"</span> <span class="fu">:</span> <span class="st">"BBC3"</span><span class="fu">,</span>
<span class="dt">"date"</span> <span class="fu">:</span> <span class="st">"2013-10-20"</span><span class="fu">,</span>
<span class="dt">"time"</span> <span class="fu">:</span> <span class="st">"20:30"</span>
<span class="fu">}</span><span class="ot">,</span>
<span class="fu">{</span>
<span class="dt">"array"</span> <span class="fu">:</span> <span class="ot">[</span>
<span class="st">"1"</span><span class="ot">,</span>
<span class="st">"2"</span><span class="ot">,</span>
<span class="st">"3"</span><span class="ot">,</span>
<span class="st">"9"</span>
<span class="ot">]</span><span class="fu">,</span>
<span class="dt">"date"</span> <span class="fu">:</span> <span class="st">"2013-11-20"</span><span class="fu">,</span>
<span class="dt">"time"</span> <span class="fu">:</span> <span class="st">"21:00"</span><span class="fu">,</span>
<span class="dt">"channel"</span> <span class="fu">:</span> <span class="st">"BBC4"</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=',' width='100%' legends=1
from_buffer='chart_data'}
~~~~</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 )