xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/lib/Pod/Plainer.pm (revision 0:68f95e015346)
1package Pod::Plainer;
2use strict;
3use Pod::Parser;
4our @ISA = qw(Pod::Parser);
5our $VERSION = '0.01';
6
7our %E = qw( < lt > gt );
8
9sub escape_ltgt {
10    (undef, my $text) = @_;
11    $text =~ s/([<>])/E<$E{$1}>/g;
12    $text
13}
14
15sub simple_delimiters {
16    (undef, my $seq) = @_;
17    $seq -> left_delimiter( '<' );
18    $seq -> right_delimiter( '>' );
19    $seq;
20}
21
22sub 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();
29}
30
311;
32
33__END__
34
35=head1 NAME
36
37Pod::Plainer - Perl extension for converting Pod to old style Pod.
38
39=head1 SYNOPSIS
40
41  use Pod::Plainer;
42
43  my $parser = Pod::Plainer -> new ();
44  $parser -> parse_from_filehandle(\*STDIN);
45
46=head1 DESCRIPTION
47
48Pod::Plainer uses Pod::Parser which takes Pod with the (new)
49'CE<lt>E<lt> .. E<gt>E<gt>' constructs
50and 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>'.
52
53This can be used to pre-process Pod before using tools which do not
54recognise the new style Pods.
55
56=head2 EXPORT
57
58None by default.
59
60=head1 AUTHOR
61
62Robin Barker, rmb1@cise.npl.co.uk
63
64=head1 SEE ALSO
65
66See L<Pod::Parser>.
67
68=cut
69
70