Initial bulk commit for "Git on MSys"
[msysgit/historical-msysgit.git] / lib / perl5 / 5.6.1 / Pod / Plainer.pm
blob373e8d090afc88ef38ce8a1670bed0ed60586395
1 package Pod::Plainer;
2 use strict;
3 use Pod::Parser;
4 our @ISA = qw(Pod::Parser);
5 our $VERSION = '0.01';
7 our %E = qw( < lt > gt );
9 sub escape_ltgt {
10 (undef, my $text) = @_;
11 $text =~ s/([<>])/E<$E{$1}>/g;
12 $text
15 sub simple_delimiters {
16 (undef, my $seq) = @_;
17 $seq -> left_delimiter( '<' );
18 $seq -> right_delimiter( '>' );
19 $seq;
22 sub textblock {
23 my($parser,$text,$line) = @_;
24 print {$parser->output_handle()}
25 $parser->parse_text(
26 { -expand_text => q(escape_ltgt),
27 -expand_seq => q(simple_delimiters) },
28 $text, $line ) -> raw_text();
33 __END__
35 =head1 NAME
37 Pod::Plainer - Perl extension for converting Pod to old style Pod.
39 =head1 SYNOPSIS
41 use Pod::Plainer;
43 my $parser = Pod::Plainer -> new ();
44 $parser -> parse_from_filehandle(\*STDIN);
46 =head1 DESCRIPTION
48 Pod::Plainer uses Pod::Parser which takes Pod with the (new)
49 'CE<lt>E<lt> .. E<gt>E<gt>' constructs
50 and returns the old(er) style with just 'CE<lt>E<gt>';
51 '<' and '>' are replaced by 'EE<lt>ltE<gt>' and 'EE<lt>gtE<gt>'.
53 This can be used to pre-process Pod before using tools which do not
54 recognise the new style Pods.
56 =head2 EXPORT
58 None by default.
60 =head1 AUTHOR
62 Robin Barker, rmb1@cise.npl.co.uk
64 =head1 SEE ALSO
66 See L<Pod::Parser>.
68 =cut