Acme-AsciiArt2HtmlTable
view release on metacpan or search on metacpan
The result will be something like this:
<style>
.special td { width:1; height:1; }
.special tr { }
</style>
<table class="special" cellspacing="0" cellpadding="0" border="0">
=head4 use-default-colors
If set to a false value, no default mappings are used.
my $html = aa2ht( { 'use-default-colors' => 0 }, $ascii);
Behind the curtains, there is still a mapping: the default mapping to
white.
=head4 colors
You can override color definitions or specify your own.
my $html = aa2ht( { 'colors' => { '@' => 'ffddee',
'g' => '00ffff' } }, $ascii);
=head4 randomize-new-colors
If set to a true value, letters with no mappings are assigned a
random one.
my $html = aa2ht( { 'randomize-new-colors' => 1 }, $ascii);
You might want to remove the default mappings if you're really
interested in a completely random effect:
my $html = aa2ht( { 'use-default-colors' => 0,
'randomize-new-colors' => 1 }, $ascii);
lib/Acme/AsciiArt2HtmlTable.pm view on Meta::CPAN
.special tr { }
</style>
<table class="special" cellspacing="0" cellpadding="0" border="0">
=cut
if (defined $new_config->{'id'}) { $config{'id'} = $new_config->{'id'} }
=head4 use-default-colors
If set to a false value, no default mappings are used.
my $html = aa2ht( { 'use-default-colors' => 0 }, $ascii);
Behind the curtains, there is still a mapping: the default mapping to
white.
=cut
if ( defined $new_config->{'use-default-colors'} ) {
if ( not $new_config->{'use-default-colors'}) {
lib/Acme/AsciiArt2HtmlTable.pm view on Meta::CPAN
=cut
if ( ref($new_config->{'colors'}) eq 'HASH' ) {
for (keys %{$new_config->{'colors'}}) {
$config{'colors'}{$_} = $new_config->{'colors'}{$_};
}
}
=head4 randomize-new-colors
If set to a true value, letters with no mappings are assigned a
random one.
my $html = aa2ht( { 'randomize-new-colors' => 1 }, $ascii);
You might want to remove the default mappings if you're really
interested in a completely random effect:
my $html = aa2ht( { 'use-default-colors' => 0,
'randomize-new-colors' => 1 }, $ascii);
( run in 0.535 second using v1.01-cache-2.11-cpan-49f99fa48dc )