The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Syntax::Highlight::Mason - Perl extension to Highlight HTML::Mason code

SYNOPSIS

  use Syntax::Highlight::Mason;
  use IO::All;
  my $compiler = Syntax::Highlight::Mason->new();
  while (my $file = shift @ARGV) {
    my $source < io($file);
    print $compiler->compile($source);
  }

DESCRIPTION

Produce colorized and HTML escaped code from HTML::Mason source suitable for displaying on the WWW and perhaps even in an Mason environment. Lots of things are customizable, but the defaults are pretty reasonable.

Customization

The following items can be customized:

 $debug          Set it to 1 to enable debugging output
 $style_sheet    A CSS style sheet that maps HTML ids to colors
 $preamble       HTML that gets inserted at the beginning of a page
 $postamble      HTML that gets inserted at the end of a page
 $color_table    A mapping of perl syntax elements to colors
 @mason_highlight An array, element[0] is inserted before mason code
                            element[1] is inserted after mason code

These are all package Global variables, which you can just set to your own values if desired. A simple: $Syntax::Highlight::Mason::debug = 1; should do the trick.

Further Customization

More customization can be done by passing parmeters to the new() method if desired. You can set the preamble, postamble, and color_table parameters here too. In addition, you can specify your own callback subroutines which encode perl, html, plain (text), and mason code. The defaults use Syntax::Highlight::Perl::Improved for perl, Syntax::Highlight::HTML for HTML, HTML::Entities::encode for plain text, and bold blue HTML::Entities::encode for mason code.

$self->highlight($type,@args)

calls the apropriate callback subroutine set up in new() above, depending on the type of encoding (perl, html, plain, mason) to be performed. Output is collected for later. You could also subclass this if you wanted to generate your own highlighting

AUTHOR

Henry Laxen nadine.and.henry@pobox.com

SEE ALSO

Syntax::Highlight::HTML Syntax::Highlight::Perl::Improved HTML::Mason

4 POD Errors

The following errors were encountered while parsing the POD:

Around line 225:

'=item' outside of any '=over'

Around line 240:

=cut found outside a pod block. Skipping to next block.

Around line 246:

=cut found outside a pod block. Skipping to next block.

Around line 360:

You forgot a '=back' before '=head1'