xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/lib/Pod/Plainer.pm (revision 0:68f95e015346)
1*0Sstevel@tonic-gatepackage Pod::Plainer;
2*0Sstevel@tonic-gateuse strict;
3*0Sstevel@tonic-gateuse Pod::Parser;
4*0Sstevel@tonic-gateour @ISA = qw(Pod::Parser);
5*0Sstevel@tonic-gateour $VERSION = '0.01';
6*0Sstevel@tonic-gate
7*0Sstevel@tonic-gateour %E = qw( < lt > gt );
8*0Sstevel@tonic-gate
9*0Sstevel@tonic-gatesub escape_ltgt {
10*0Sstevel@tonic-gate    (undef, my $text) = @_;
11*0Sstevel@tonic-gate    $text =~ s/([<>])/E<$E{$1}>/g;
12*0Sstevel@tonic-gate    $text
13*0Sstevel@tonic-gate}
14*0Sstevel@tonic-gate
15*0Sstevel@tonic-gatesub simple_delimiters {
16*0Sstevel@tonic-gate    (undef, my $seq) = @_;
17*0Sstevel@tonic-gate    $seq -> left_delimiter( '<' );
18*0Sstevel@tonic-gate    $seq -> right_delimiter( '>' );
19*0Sstevel@tonic-gate    $seq;
20*0Sstevel@tonic-gate}
21*0Sstevel@tonic-gate
22*0Sstevel@tonic-gatesub textblock {
23*0Sstevel@tonic-gate    my($parser,$text,$line) = @_;
24*0Sstevel@tonic-gate    print {$parser->output_handle()}
25*0Sstevel@tonic-gate	$parser->parse_text(
26*0Sstevel@tonic-gate	    { -expand_text => q(escape_ltgt),
27*0Sstevel@tonic-gate	      -expand_seq => q(simple_delimiters) },
28*0Sstevel@tonic-gate	    $text, $line ) -> raw_text();
29*0Sstevel@tonic-gate}
30*0Sstevel@tonic-gate
31*0Sstevel@tonic-gate1;
32*0Sstevel@tonic-gate
33*0Sstevel@tonic-gate__END__
34*0Sstevel@tonic-gate
35*0Sstevel@tonic-gate=head1 NAME
36*0Sstevel@tonic-gate
37*0Sstevel@tonic-gatePod::Plainer - Perl extension for converting Pod to old style Pod.
38*0Sstevel@tonic-gate
39*0Sstevel@tonic-gate=head1 SYNOPSIS
40*0Sstevel@tonic-gate
41*0Sstevel@tonic-gate  use Pod::Plainer;
42*0Sstevel@tonic-gate
43*0Sstevel@tonic-gate  my $parser = Pod::Plainer -> new ();
44*0Sstevel@tonic-gate  $parser -> parse_from_filehandle(\*STDIN);
45*0Sstevel@tonic-gate
46*0Sstevel@tonic-gate=head1 DESCRIPTION
47*0Sstevel@tonic-gate
48*0Sstevel@tonic-gatePod::Plainer uses Pod::Parser which takes Pod with the (new)
49*0Sstevel@tonic-gate'CE<lt>E<lt> .. E<gt>E<gt>' constructs
50*0Sstevel@tonic-gateand returns the old(er) style with just 'CE<lt>E<gt>';
51*0Sstevel@tonic-gate'<' and '>' are replaced by 'EE<lt>ltE<gt>' and 'EE<lt>gtE<gt>'.
52*0Sstevel@tonic-gate
53*0Sstevel@tonic-gateThis can be used to pre-process Pod before using tools which do not
54*0Sstevel@tonic-gaterecognise the new style Pods.
55*0Sstevel@tonic-gate
56*0Sstevel@tonic-gate=head2 EXPORT
57*0Sstevel@tonic-gate
58*0Sstevel@tonic-gateNone by default.
59*0Sstevel@tonic-gate
60*0Sstevel@tonic-gate=head1 AUTHOR
61*0Sstevel@tonic-gate
62*0Sstevel@tonic-gateRobin Barker, rmb1@cise.npl.co.uk
63*0Sstevel@tonic-gate
64*0Sstevel@tonic-gate=head1 SEE ALSO
65*0Sstevel@tonic-gate
66*0Sstevel@tonic-gateSee L<Pod::Parser>.
67*0Sstevel@tonic-gate
68*0Sstevel@tonic-gate=cut
69*0Sstevel@tonic-gate
70