App-Basis-ConvertText2
view release on metacpan or search on metacpan
docs/README.html view on Meta::CPAN
<li><a href='#12.10_qr_code'> 12.10 QR code</a></li>
<li><a href='#13_yaml_convert_to_json'>13 YAML convert to JSON</a></li>
<li><a href='#14_table'>14 Table</a></li>
<li><a href='#15_links'>15 Links</a></li>
<li><a href='#16_version_table'>16 Version table</a></li>
<li><a href='#17_start_a_new_page_-_page'>17 Start a new page - page</a></li>
<li><a href='#18_gle_/_glx'>18 Gle / glx</a></li>
<li><a href='#19_gnuplot'>19 Gnuplot</a></li>
<li><a href='#20_gotchas_about_variables'>20 Gotchas about variables</a></li>
<li><a href='#21_using_ct2_script_to_process_files'>21 Using ct2 script to process files</a></li>
</ul>
</p>
<p>Note that if using a TOC, then the HTML headers are changed to have a number prefixed to them, this helps ensure that all the TOC references are unique.</p>
<h2 id="fenced-code-blocks"><a name='3_fenced_code-blocks'>3 Fenced code-blocks</a></h2>
<p>A fenced code-block is a way of showing that some text needs to be handled differently. Often this is used to allow markdown systems (and <a href="http://johnmacfarlane.net/pandoc">pandoc</a> is no exception) to highlight program code.</p>
<p>code-blocks take the form</p>
<p><strong>Example</strong></p>
<pre><code>~~~~{.tag argument1='fred' arg2=3}
contents ...
~~~~</code></pre>
<p>code-blocks <strong>ALWAYS</strong> start at the start of a line without any preceding whitespace. The âtopâ line of the code-block can wrap onto subsequent lines, this line is considered complete when the final â}â is seen. There should b...
<p>We use this construct to create our own handlers to generate HTML or markdown.</p>
<p>Note that only code-blocks described in this documentation have special handlers and can make use of extra features such as buffering.</p>
<h2 id="buffering-data-for-later-use"><a name='4_buffering_data_for_later_use'>4 Buffering data for later use</a></h2>
<p>Sometimes you may either want to repeatedly use the same information or may want to use the output from one of the fenced code-blocks .</p>
<p>To store data we use the <strong>to_buffer</strong> argument to any code-block.</p>
<p><strong>Example</strong></p>
<pre><code>~~~~{.buffer to_buffer='spark_data'}
1,4,5,20,4,5,3,1
~~~~</code></pre>
<p>If the code-block would normally produce some output that we do not want displayed at the current location then we would need to use the <strong>no_output</strong> argument.</p>
<p><strong>Example</strong></p>
<pre><code>~~~~{.sparkline title='green sparkline' scheme='green'
from_buffer='spark_data' to_buffer='greenspark' no_output=1}
~~~~</code></pre>
<p>We can also have the content of a code-block replaced with content from a buffer by using the <strong>from_buffer</strong> argument. This is also displayed in the example above.</p>
<p>To use the contents (or output of a buffered code-block) we wrap the name of the buffer once again with percent â%â symbols, once again we force upper case.</p>
<p><strong>Example</strong></p>
<pre><code>%SPARK_DATA% has content 1,4,5,20,4,5,3,1
%GREENSPARK% has a generated image <img src='/tmp/kmulholland/cache/ct2/1f38c66e765de08fb292e4e410263519.png' alt='green sparkline' height='20' width='80' /></code></pre>
<p>Buffering also allows us to add content into markdown constructs like bullets.</p>
<p><strong>Example</strong></p>
<pre><code>* %SPARK_DATA%
* %GREENSPARK%</code></pre>
<p><strong>Output</strong></p>
<ul>
<li>1,4,5,20,4,5,3,1</li>
<li><img src='/tmp/kmulholland/cache/ct2/1f38c66e765de08fb292e4e410263519.png' alt='green sparkline' height='20' width='80' /></li>
</ul>
<h2 id="sparklines"><a name='5_sparklines'>5 Sparklines</a></h2>
<p>Sparklines are simple horizontal charts to give an indication of things, sometimes they are barcharts but we have nice smooth lines.</p>
<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>
docs/README.html view on Meta::CPAN
</ul>
<p><strong>Example</strong></p>
<pre><code>~~~~{.version class='versiontable' width='100%'}
0.1 2014-04-12
* removed ConvertFile.pm
* using Path::Tiny rather than other things
* changed to use pandoc fences
~~~~{.tag} rather than xml format <tag>
0.006 2014-04-10
* first release to github
~~~~</code></pre>
<p><strong>Output</strong></p>
<table class='versiontable' width='100%' >
<tr><th>
Version
</th><th>
Date
</th><th>
Changes
</th></tr>
<tr><td valign='top'>
0.1
</td><td valign='top'>
2014-04-12
</td><td valign='top'>
<ul>
<li>removed ConvertFile.pm</li>
<li>using Path::Tiny rather than other things</li>
<li>changed to use pandoc fences ~<sub>~</sub>{.tag} rather than xml format <tag>
</td></tr>
<tr><td valign='top'>
0.006
</td><td valign='top'>
2014-04-10
</td><td valign='top'>
<ul>
<li>first release to github
</td></tr>
</table>
</li>
</ul></li>
</ul>
<h2 id="start-a-new-page---page"><a name='17_start_a_new_page_-_page'>17 Start a new page - page</a></h2>
<p>Nice and simple, starts a new page</p>
<p><strong>Example</strong></p>
<pre><code>~~~~{.page}
~~~~</code></pre>
<h2 id="gle-glx"><a name='18_gle_/_glx'>18 Gle / glx</a></h2>
<p>This is a complex graph/chart drawing package available from http://glx.sourceforge.net/</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>size
<ul>
<li>size of image, default 720x540, widthxheight, size is approximate</li>
</ul></li>
<li>transparent
<ul>
<li>flag to use a transparent background</li>
</ul></li>
</ul>
<p><strong>Example</strong></p>
<pre><code>~~~~{.gle}
set font texcmr hei 0.5 just tc
begin letz
data "saddle.z"
z = 3/2*(cos(3/5*(y-1))+5/4)/(1+(((x-4)/3)^2))
x from 0 to 20 step 0.5
y from 0 to 20 step 0.5
end letz
amove pagewidth()/2 pageheight()-0.1
write "Saddle Plot (3D)"
begin object saddle
begin surface
size 10 9
data "saddle.z"
xtitle "X-axis" hei 0.35 dist 0.7
ytitle "Y-axis" hei 0.35 dist 0.7
ztitle "Z-axis" hei 0.35 dist 0.9
top color blue
zaxis ticklen 0.1 min 0 hei 0.25
xaxis hei 0.25 dticks 4 nolast nofirst
yaxis hei 0.25 dticks 4
end surface
end object
amove pagewidth()/2 0.2
draw "saddle.bc"
~~~~</code></pre>
<p><strong>Output</strong></p>
<p><img src='/tmp/kmulholland/cache/ct2/e555247121c65a85dc45fb78ec7da0f2.png' height='521' width='731' /></p>
<h2 id="gnuplot"><a name='19_gnuplot'>19 Gnuplot</a></h2>
<p>This is the granddaddy of charting/plotting programs, available from http://gnuplot.sourceforge.net/.</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>size
<ul>
<li>size of image, default 720x540, widthxheight</li>
</ul></li>
</ul>
<p><strong>Example</strong></p>
<pre><code>~~~~{.gnuplot}
# $Id: surface1.dem,v 1.11 2004/09/17 05:01:12 sfeam Exp $
#
set samples 21
set isosample 11
set xlabel "X axis" offset -3,-2
set ylabel "Y axis" offset 3,-2
set zlabel "Z axis" offset -5
set title "3D gnuplot demo"
set label 1 "This is the surface boundary" at -10,-5,150 center
( run in 2.234 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )