App-Basis-ConvertText2

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

  a->c [ label = "ac1()\nac2()"];
  b<-c [ label = "cb(TRUE)"];
  b->b [ label = "stalled(...)"];
  a<-b [ label = "ab() = FALSE"];
}
~~~~

## 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**

README.md  view on Meta::CPAN

    * used as the generated images 'alt' argument
* size
    * size of image, default 720x540, widthxheight, size is approximate
* transparent
    * flag to use a transparent background

**Example**

    ~~~~{.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)"

README.md  view on Meta::CPAN


    amove pagewidth()/2 0.2
    draw "saddle.bc"
    ~~~~

**Output**

~~~~{.gle}
size 10 9

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)"

bin/ct2  view on Meta::CPAN


        <style type='text/css'>
            \@page { 
                size: %PAGE_SIZE% %ORIENTATION% ; 
                margin: 90pt 30pt 40pt 30pt ;
                \@top { 
                    margin: -10pt 0pt 0pt -90pt ;
                }
                \@bottom-right { content: counter(page) ;}
            }            }
            body {font-style: sans-serif;}
            /* toc */
            #toc { 
              padding: 0.4em;
              page-break-after: always;
            }
            #toc p {
                font-weight: bold;
                font-size: 32;
            }
            #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 ;
                color: black;
            }

            /* tables*/
            table { page-break-inside: avoid ;}
            table.footer { font-size: 10px; width: 100%;}
            table.footer td.commercial { 
                font-weight: bold; 
                font-size: 12px;
                text-align: center;
            }
            /* nice markup for source code */
            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; }

        </style>
    </head>
    <body>
        <h1>%TITLE%</h1>
        <!-- uncomment this if you need a Table of Contents -->
        <!-- <div id='toc' >
            %TOC%
        </div> -->

docs/README.html  view on Meta::CPAN

                    @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;

docs/README.html  view on Meta::CPAN

            {
                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;

docs/README.html  view on Meta::CPAN

            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;
            }

docs/README.html  view on Meta::CPAN


            .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">

docs/README.html  view on Meta::CPAN

  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>

docs/README.html  view on Meta::CPAN

<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 &quot;saddle.z&quot;
   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 &quot;Saddle Plot (3D)&quot;

lib/App/Basis/ConvertText2/Plugin/Chart.pm  view on Meta::CPAN


            legend_placement => 'RC',
        );

        # set the colours for the charts
        # white, lgray, gray, dgray, black, lblue, blue, dblue, gold, lyellow, yellow, dyellow,
        # lgreen, green, dgreen, lred, red, dred, lpurple, purple, dpurple, lorange, orange,
        # pink, dpink, marine, cyan, lbrown, dbrown.
        $chart->set( dclrs => [qw(marine blue lred dgreen orange salmon lbrown gold lgreen yellow gray dred lpurple)] );

        # set the font things
        $chart->set_title_font(gdGiantFont);

        # pie legends are written on the slices, so we don't have this method
        if ( $format eq 'pie' ) {
            $chart->set_value_font(gdMediumBoldFont);
        }
        else {
            # legends comma seperated to allow spaces in descriptions
            $chart->set_legend( split( /,/, $params->{legends} || "" ) );
            $chart->set_legend_font(gdMediumBoldFont);
            $chart->set_x_label_font(gdMediumBoldFont);
            $chart->set_y_label_font(gdMediumBoldFont);
            $chart->set_x_axis_font(gdMediumBoldFont);
            $chart->set_y_axis_font(gdMediumBoldFont);
            $chart->set_values_font(gdMediumBoldFont);
        }

        my ( $stdout, $stderr, $exit ) = capture {
            my $gd = $chart->plot( \@data );
            path($filename)->spew_raw( $gd->png ) if ($$gd);
        };
    }

    my $out;
    if ( -f $filename ) {

lib/App/Basis/ConvertText2/Plugin/Gle.pm  view on Meta::CPAN


=head1 NAME

App::Basis::ConvertText2::Plugin::Gle

=head1 SYNOPSIS

    my $content = "size 12 8
    
    set font texcmr
    begin graph
       title  "Fruit Production"
       xtitle "Weekday"
       ytitle "Production [x100 pound]"
       xticks off
       data   "test.dat"
       bar d1,d2 fill navy,skyblue
    end graph" ;
    my $params = {} ;
    my $obj = App::Basis::ConvertText2::Plugin::Gle->new() ;

t/02_plugins.t  view on Meta::CPAN

  (checkout) -- clerk
}
\@enduml";
        $obj    = App::Basis::ConvertText2::Plugin::Uml->new();
        $params = undef;
        $out    = $obj->process( 'uml', $content, $params, $TEST_DIR );
        ok( has_file($out), 'uml created a file' );

        # gle
        $content = 'size 10 9
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)"



( run in 0.592 second using v1.01-cache-2.11-cpan-5735350b133 )