Pod::Parser

Pod::Parser is a base Perl class for creating POD filters and translators.
Download

Pod::Parser Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Brad Appleton
  • Publisher web site:
  • http://search.cpan.org/~marekr/Pod-Parser-1.35/lib/Pod/Parser.pm

Pod::Parser Tags


Pod::Parser Description

Pod::Parser is a base Perl class for creating POD filters and translators. Pod::Parser is a base Perl class for creating POD filters and translators.SYNOPSIS use Pod::Parser; package MyParser; @ISA = qw(Pod::Parser); sub command { my ($parser, $command, $paragraph, $line_num) = @_; ## Interpret the command and its text; sample actions might be: if ($command eq 'head1') { ... } elsif ($command eq 'head2') { ... } ## ... other commands and their actions my $out_fh = $parser->output_handle(); my $expansion = $parser->interpolate($paragraph, $line_num); print $out_fh $expansion; } sub verbatim { my ($parser, $paragraph, $line_num) = @_; ## Format verbatim paragraph; sample actions might be: my $out_fh = $parser->output_handle(); print $out_fh $paragraph; } sub textblock { my ($parser, $paragraph, $line_num) = @_; ## Translate/Format this block of text; sample actions might be: my $out_fh = $parser->output_handle(); my $expansion = $parser->interpolate($paragraph, $line_num); print $out_fh $expansion; } sub interior_sequence { my ($parser, $seq_command, $seq_argument) = @_; ## Expand an interior sequence; sample actions might be: return "*$seq_argument*" if ($seq_command eq 'B'); return "`$seq_argument'" if ($seq_command eq 'C'); return "_${seq_argument}_'" if ($seq_command eq 'I'); ## ... other sequence commands and their resulting text } package main; ## Create a parser object and have it parse file whose name was ## given on the command-line (use STDIN if no files were given). $parser = new MyParser(); $parser->parse_from_filehandle(*STDIN) if (@ARGV == 0); for (@ARGV) { $parser->parse_from_file($_); } Requirements: · Perl


Pod::Parser Related Software