HTML::SyntaxHighlighter is a Perl module for converting raw HTML into html-escaped, highlighted code; suitable for inclusion within a web page.
SYNOPSIS
Standalone
my $p = HTML::SyntaxHighlighter->new();
$p->parse_file( "$file" ) or die "Cannot open '$file': $!"...
From within HTML::Mason
< & /lib/header.m, title => "Formatted source code for '$file'", stylesheet => [ 'html_highlight.css' ] & >
< %perl >
my $path = "/usr/data/www/hyperspeed.org/projects/html/examples";
my $p = HTML::SyntaxHighlighter->new(
out_func => sub{ $m->out( @_ ) },
header => 0,
);
$p->parse_file( "$path/$file" ) or die "Cannot open '$path/$file': $!";
< /%perl >
< & /lib/footer.m & >
< %once >
use HTML::SyntaxHighlighter;
< /%once >
< %args >
$file
< /%args>
This module is designed to take raw HTML code, either from a variable or a file, html-escape it and highlight it (using stylesheets), rendering it suitable for inclusion in a web page. It is build on top of HTML::Parser.
It is intended primarily for people wanting to include 'example HTML code' in an dynamically generated web page (be it created with CGI, HTML::Mason, or whatever); if you find other uses, please let me know.
Product's homepage
Requirements:
· Perl