Pod::POM::View::HTML::Filter Perl module can use filters on sections of your pod documents.
SYNOPSIS
In your POD:
Some coloured Perl code:
=begin filter perl
# now in full colour!
$A++;
=end filter
=for filter=perl $A++; # this works too
This should read C:
=begin filter foo
bar foo bar
=end filter
In your code:
my $view = Pod::POM::View::HTML::Filter->new;
$view->add(
foo => {
code => sub { my $s = shift; $s =~ s/foo/bar/gm; $s },
# other options are available
}
);
my $pom = Pod::POM->parse_file( '/my/pod/file' );
$pom->present($view);
/* Perl colouring styles */ .c { color: #228B22;} /* comment */ .cm { color: #000000;} /* comma */ .co { color: #000000;} /* colon */ .h { color: #CD5555; font-weight:bold;} /* here-doc-target */ .hh { color: #CD5555; font-style:italic;} /* here-doc-text */ .i { color: #00688B;} /* identifier */ .j { color: #CD5555; font-weight:bold;} /* label */ .k { color: #8B008B; font-weight:bold;} /* keyword */ .m { color: #FF0000; font-weight:bold;} /* subroutine */ .n { color: #B452CD;} /* numeric */ .p { color: #000000;} /* paren */ .pd { color: #228B22; font-style:italic;} /* pod-text */ .pu { color: #000000;} /* punctuation */ .q { color: #CD5555;} /* quote */ .s { color: #000000;} /* structure */ .sc { color: #000000;} /* semicolon */ .v { color: #B452CD;} /* v-string */ .w { color: #000000;} /* bareword */ -->
The resulting HTML will look like this (modulo the stylesheet):
# now in full colour!
$A++;
$A++; # this works too
Product's homepage
Requirements:
· Perl