App-Basis-ConvertText2
view release on metacpan or search on metacpan
docs/README.html view on Meta::CPAN
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>App::Basis::ConvertText2</title>
<meta name="Created" content="2014-05-12" />
<meta name="Author" content="Kevin Mulholland" />
<meta name="Copyright" content="Kevin Mulholland (c) 2014" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
@media print {
@page {
size: A4 Portrait ;
margin: 60pt 30pt 40pt 30pt ;
@top {
margin: 0pt 0pt 0pt 0pt ;
content: url(/tmp/kmulholland/cache/ct2/501584ba8fd79327876915821268382f.png) ;
}
@bottom-right { content: counter(page) " / " counter(pages) ;}
@bottom-left {content: "Created with ct2";}
@bottom { content: "Kevin Mulholland (c) 2014";}
}
/* remove some header stuff from front page */
@page:first {
@top {content: normal; }
@bottom-right { content: normal; ;}
@bottom { content: normal; ;}
@bottom-left { content: normal; ;}
}
div.footer { display: none;}
a {text-decoration:none ; color: teal; font-weight: bold;}
}
/* setup for web */
@media screen {
#toc a {
text-decoration: none ;
font-weight: normal;
color: teal;
}
}
/* things to do with numbering headings*/
h1 {
display: none;
}
h2, h3 {
color: teal;
}
h4, h5, h6 {
font-weight: normal;
}
body {font-family: sans-serif;}
/* tables*/
table { page-break-inside: avoid ;}/*
/* all normal tables will be styled this way */
table
{
margin: 5px;
text-align: left;
border-collapse: collapse;
}
table tr { vertical-align:top;}
table th
{
/* padding: 8px 2px;*/
font-weight: bold;
border-bottom: 2px solid black;
border-right: 30px solid #fff;
border-left: 30px solid #fff;
}
table td
{
padding: 0px 10px 0px 10px;
border-right: 30px solid #fff;
border-left: 30px solid #fff;
vertical-align:top;
}
/* all boxed tables will be styled this way */
table.box
{
margin: 5px;
text-align: left;
border-collapse: collapse;
}
table.box tr { vertical-align:top;}
table.box th
{
padding: 0px 10px 0px 10px;
background-color: #ccc;
font-weight: bold;
text-align: center;
border: 1px solid black;
}
table.box td
{
padding: 0px 10px 0px 10px;
border: 1px solid black;
}
table.footer { font-size: 10px; width: 100%;}
table.footer td.commercial {
font-weight: bold;
font-size: 12px;
text-align: center;
}
table.coverpage {
width: 90%;
margin-left: auto;
margin-right: auto;
border-collapse: collapse;
border-spacing: 0px;
margin-bottom: 300px;
}
table.coverpage td {
border: 1px silver solid;
padding-left:10px;
padding-right:10px;
}
p.coverpage {
width:88%;
margin-left: auto;
margin-right: auto;
text-align: center;
font-size: 12px ;
}
div.coverpage {
text-align: center;
width: 280px;
margin-left: auto;
margin-right: auto;
text-align: center;
padding-top: 50px;
padding-bottom: 80px;
}
div.coverpage img {
display: block;
}
.frontpage { page-break-after: always;}
/* toc */
#toc {
padding: 0.4em;
page-break-after: always;
}
#toc p {
color: teal;
font-weight: bold;
font-size: 24px;
}
#toc h3 {
text-align: center
}
#toc ul {
/* columns: 1;*/
}
#toc ul, #toc li {
list-style: none;
margin: 0;
padding: 0;
padding-left: 10px ;
}
#toc a::after {
content: leader('.') target-counter(attr(href), page);
font-style: normal;
}
#toc a {
text-decoration: none ;
font-weight: normal;
color: black;
}
/* source code highlighting for pandoc */
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
margin: 0; padding: 0; vertical-align: baseline; border: none;
}
table.sourceCode { width: 100%; line-height: 100%; }
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
td.sourceCode { padding-left: 5px; }
code > span.kw { color: #007020; font-weight: bold; }
code > span.dt { color: #902000; }
code > span.dv { color: #40a070; }
code > span.bn { color: #40a070; }
code > span.fl { color: #40a070; }
code > span.ch { color: #4070a0; }
code > span.st { color: #4070a0; }
code > span.co { color: #60a0b0; font-style: italic; }
code > span.ot { color: #007020; }
code > span.al { color: #ff0000; font-weight: bold; }
code > span.fu { color: #06287e; }
code > span.er { color: #ff0000; font-weight: bold; }
/* add the footnotes section if needed */
section.footnotes:before {
content: "Footnotes";
}
</style>
</head>
<body>
<div class="frontpage">
<div class='coverpage'>
<img src="/tmp/kmulholland/cache/ct2/bd027b5281397f731f95ac53fc0e0544.png" width="280" height="280" alt="coverpage Logo" />
</div>
<table class="coverpage">
<tr><td>Title</td><td>App::Basis::ConvertText2</td></tr>
<tr><td>Author </td><td>Kevin Mulholland</td></tr>
<tr><td>Last Updated</td><td>2014-05-12</td></tr>
<tr><td>Version</td><td>5</td></tr>
</table>
</div>
<div id='toc' >
<p>Contents</p>
<ul>
<li><a href='#1_document_header_and_variables'>1 Document header and variables</a></li>
<li><a href='#2_table_of_contents'>2 Table of contents</a></li>
<li><a href='#3_fenced_code-blocks'>3 Fenced code-blocks</a></li>
<li><a href='#4_buffering_data_for_later_use'>4 Buffering data for later use</a></li>
<li><a href='#5_sparklines'>5 Sparklines</a></li>
<li><a href='#6_charts'>6 Charts</a></li>
<li><a href='#6.1_pie_chart'> 6.1 Pie chart</a></li>
<li><a href='#6.2_bar_chart'> 6.2 Bar chart</a></li>
<li><a href='#6.3_mixed_chart'> 6.3 Mixed chart</a></li>
<li><a href='#7_message_sequence_charts_-_mscgen'>7 Message Sequence Charts - mscgen</a></li>
<li><a href='#8_diagrams_through_ascii_art_-_ditaa'>8 DIagrams Through Ascii Art - ditaa</a></li>
<li><a href='#9_uml_diagrams'>9 UML Diagrams</a></li>
<li><a href='#10_graphviz'>10 Graphviz</a></li>
<li><a href='#11_venn_diagram'>11 Venn diagram</a></li>
<li><a href='#12_barcodes'>12 Barcodes</a></li>
<li><a href='#12.1_code39'> 12.1 Code39</a></li>
<li><a href='#12.2_ean8'> 12.2 EAN8</a></li>
<li><a href='#12.3_ean13'> 12.3 EAN13</a></li>
<li><a href='#12.4_coop2of5'> 12.4 COOP2of5</a></li>
<li><a href='#12.5_iata2of5'> 12.5 IATA2of5</a></li>
<li><a href='#12.6_industrial2of5'> 12.6 Industrial2of5</a></li>
<li><a href='#12.7_itf'> 12.7 ITF</a></li>
<li><a href='#12.8_matrix2of5'> 12.8 Matrix2of5</a></li>
<li><a href='#12.9_nw7'> 12.9 NW7</a></li>
<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>
docs/README.html view on Meta::CPAN
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|
|Document| |!magic!| | |
| {d}| | | | |
+---+----+ +-------+ +-------+
: ^
| Lots of work |
\-------------------------+
~~~~</code></pre>
<p><strong>Output</strong></p>
<p><img src='/tmp/kmulholland/cache/ct2/8ac235932524c7f7b6592ea295b3ad95.png' height='196' width='390' /></p>
<h2 id="uml-diagrams"><a name='9_uml_diagrams'>9 UML Diagrams</a></h2>
<p>Software engineers love to draw diagrams, <a href="http://plantuml.sourceforge.net">PlantUML</a> is a java component to make this simple.</p>
<p>You will need to have a script on your system called âumlâ that calls java with the component.</p>
<p>Here is mine, it is also available in the scripts directory in the</p>
<pre class="shell"><code>#!/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
docs/README.html view on Meta::CPAN
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
set arrow 1 from -10,-5,120 to -10,0,0 nohead
set arrow 2 from -10,-5,120 to 10,0,0 nohead
set arrow 3 from -10,-5,120 to 0,10,0 nohead
set arrow 4 from -10,-5,120 to 0,-10,0 nohead
set xrange [-10:10]
set yrange [-10:10]
( run in 0.493 second using v1.01-cache-2.11-cpan-5735350b133 )