diff options
author | Norbert Preining <preining@logic.at> | 2008-01-07 13:06:47 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2008-01-07 13:06:47 +0000 |
commit | ccf29645c02dcd2e530892cd3cad48f3b555cd3d (patch) | |
tree | cad04a5175629d1f5b40d3d5c86d61f649126481 /Master/tlpkg/tlperl/lib/Pod/Plainer.pm | |
parent | de02666bc74cb71685aa565c195759e9fd00631d (diff) |
add all the pod stuff, hope now that it is enough
git-svn-id: svn://tug.org/texlive/trunk@6115 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Pod/Plainer.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/Pod/Plainer.pm | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/Master/tlpkg/tlperl/lib/Pod/Plainer.pm b/Master/tlpkg/tlperl/lib/Pod/Plainer.pm new file mode 100644 index 00000000000..373e8d090af --- /dev/null +++ b/Master/tlpkg/tlperl/lib/Pod/Plainer.pm @@ -0,0 +1,69 @@ +package Pod::Plainer; +use strict; +use Pod::Parser; +our @ISA = qw(Pod::Parser); +our $VERSION = '0.01'; + +our %E = qw( < lt > gt ); + +sub escape_ltgt { + (undef, my $text) = @_; + $text =~ s/([<>])/E<$E{$1}>/g; + $text +} + +sub simple_delimiters { + (undef, my $seq) = @_; + $seq -> left_delimiter( '<' ); + $seq -> right_delimiter( '>' ); + $seq; +} + +sub textblock { + my($parser,$text,$line) = @_; + print {$parser->output_handle()} + $parser->parse_text( + { -expand_text => q(escape_ltgt), + -expand_seq => q(simple_delimiters) }, + $text, $line ) -> raw_text(); +} + +1; + +__END__ + +=head1 NAME + +Pod::Plainer - Perl extension for converting Pod to old style Pod. + +=head1 SYNOPSIS + + use Pod::Plainer; + + my $parser = Pod::Plainer -> new (); + $parser -> parse_from_filehandle(\*STDIN); + +=head1 DESCRIPTION + +Pod::Plainer uses Pod::Parser which takes Pod with the (new) +'CE<lt>E<lt> .. E<gt>E<gt>' constructs +and returns the old(er) style with just 'CE<lt>E<gt>'; +'<' and '>' are replaced by 'EE<lt>ltE<gt>' and 'EE<lt>gtE<gt>'. + +This can be used to pre-process Pod before using tools which do not +recognise the new style Pods. + +=head2 EXPORT + +None by default. + +=head1 AUTHOR + +Robin Barker, rmb1@cise.npl.co.uk + +=head1 SEE ALSO + +See L<Pod::Parser>. + +=cut + |