Acme-AsciiArt2HtmlTable

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

t/01.options.colors.t
t/01.options.id.t
t/01.options.randomize-new-colors.t
t/01.options.table.t
t/01.options.td.t
t/01.options.tr.t
t/01.options.use-default-colors.t
t/02.special.default-color.t
t/02.special.optimization.t
t/03.examples.empty.t
t/03.examples.flag-pt.t
t/03.examples.jose-castro.t
t/pod-coverage.t
t/pod.t
examples/Acme::AsciiArt2HtmlTable.html
examples/acme
examples/acme.html
examples/acme_opt.html
examples/autrijus
examples/autrijus.html
examples/autrijus_opt.html
examples/camel
examples/camel.html
examples/cog
examples/cog.html
examples/create_examples
examples/damian
examples/damian.html
examples/damian_opt.html
examples/flag_portugal
examples/flag_portugal.html
examples/flag_portugal_opt.html
examples/flag_spain
examples/flag_spain.html
examples/flag_spain_opt.html
examples/flag_usa
examples/flag_usa.html
examples/flag_usa_opt.html
examples/heart
examples/heart.html
examples/josecastro
examples/josecastro.html
examples/larry
examples/larry.html
examples/larry_opt.html
examples/merlyn
examples/merlyn.html
examples/merlyn_opt.html

README  view on Meta::CPAN

                "ggggggyyyyrrrrrrrrrrrr\n" .
                "ggggggyyyyrrrrrrrrrrrr\n" .
                "ggggggggrrrrrrrrrrrrrr\n" .
                "ggggggggrrrrrrrrrrrrrr\n" .
                "ggggggggrrrrrrrrrrrrrr\n" .
                "ggggggggrrrrrrrrrrrrrr\n" ;

    my $html = aa2ht( { td => { width => 3 , height => 3 } } , $table);

    # $html now holds a table with a color representation of your
    # ascii art. In this case, the Portuguese flag.

=head1 FUNCTIONS

=head2 aa2ht

Gets ascii text and converts it to an HTML table. This is how it works:

=over 4

=item * each line is a C<tr> element

examples/create_examples  view on Meta::CPAN

_writefile('smile.html',$html);

$ascii = _readfile('heart');
$html = aa2ht($ascii);
_writefile('heart.html',$html);

$ascii = _readfile('josecastro');
$html = aa2ht({td=>{width=>"2px",height=>"1px"},colors=>{"#"=>"ffff00","+"=>"ff0000","."=>"00ff00"}},$ascii);
_writefile('josecastro.html',$html);

# flags
for my $flag (qw/portugal spain usa/) {
  _writefile("flag_$flag.html",aa2ht(_readfile("flag_$flag")));
  _writefile("flag_${flag}_opt.html",aa2ht({'optimization'=>1},_readfile("flag_$flag")));
}

# people
my (%people, %people_opt, %name);

for my $person (qw/acme autrijus damian larry merlyn schwern/) {
  _writefile("$person.html",_people(_readfile("$person")));
  $people{$person} = aa2ht({'randomize-new-colors'=>1},_readfile($person));
  $people_opt{$person} = aa2ht({'randomize-new-colors'=>1,'optimization'=>1},_readfile($person));
  _writefile("${person}_opt.html",_people_opt(_readfile("$person")));

lib/Acme/AsciiArt2HtmlTable.pm  view on Meta::CPAN

                "ggggggyyyyrrrrrrrrrrrr\n" .
                "ggggggyyyyrrrrrrrrrrrr\n" .
                "ggggggggrrrrrrrrrrrrrr\n" .
                "ggggggggrrrrrrrrrrrrrr\n" .
                "ggggggggrrrrrrrrrrrrrr\n" .
                "ggggggggrrrrrrrrrrrrrr\n" ;

    my $html = aa2ht( { td => { width => 3 , height => 3 } } , $table);

    # $html now holds a table with a color representation of your
    # ascii art. In this case, the Portuguese flag.

=cut

our %default_configuration;

=head1 FUNCTIONS

=head2 aa2ht

Gets ascii text and converts it to an HTML table. This is how it works:



( run in 1.784 second using v1.01-cache-2.11-cpan-94b05bcf43c )