xref: /openbsd-src/gnu/usr.bin/perl/cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm (revision 3d61058aa5c692477b6d18acfbbdb653a9930ff9)
1b39c5158Smillertpackage Pod::Simple::TextContent;
2b39c5158Smillertuse strict;
3*3d61058aSafresh1use warnings;
4b39c5158Smillertuse Carp ();
5b39c5158Smillertuse Pod::Simple ();
6*3d61058aSafresh1our $VERSION = '3.45';
7*3d61058aSafresh1our @ISA = ('Pod::Simple');
8b39c5158Smillert
9b39c5158Smillertsub new {
10b39c5158Smillert  my $self = shift;
11b39c5158Smillert  my $new = $self->SUPER::new(@_);
12b39c5158Smillert  $new->{'output_fh'} ||= *STDOUT{IO};
13b39c5158Smillert  $new->nix_X_codes(1);
14b39c5158Smillert  return $new;
15b39c5158Smillert}
16b39c5158Smillert
17b39c5158Smillert#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18b39c5158Smillert
19b39c5158Smillertsub _handle_element_start {
20b39c5158Smillert  print {$_[0]{'output_fh'}} "\n"  unless $_[1] =~ m/^[A-Z]$/s;
21b39c5158Smillert  return;
22b39c5158Smillert}
23b39c5158Smillert
24b39c5158Smillertsub _handle_text {
25b8851fccSafresh1  $_[1] =~ s/$Pod::Simple::shy//g;
26b8851fccSafresh1  $_[1] =~ s/$Pod::Simple::nbsp/ /g;
27b39c5158Smillert  print {$_[0]{'output_fh'}} $_[1];
28b39c5158Smillert  return;
29b39c5158Smillert}
30b39c5158Smillert
31b39c5158Smillertsub _handle_element_end {
32b39c5158Smillert  print {$_[0]{'output_fh'}} "\n"  unless $_[1] =~ m/^[A-Z]$/s;
33b39c5158Smillert  return;
34b39c5158Smillert}
35b39c5158Smillert
36b39c5158Smillert#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
37b39c5158Smillert1;
38b39c5158Smillert
39b39c5158Smillert
40b39c5158Smillert__END__
41b39c5158Smillert
42b39c5158Smillert=head1 NAME
43b39c5158Smillert
44b39c5158SmillertPod::Simple::TextContent -- get the text content of Pod
45b39c5158Smillert
46b39c5158Smillert=head1 SYNOPSIS
47b39c5158Smillert
48b39c5158Smillert TODO
49b39c5158Smillert
50b39c5158Smillert  perl -MPod::Simple::TextContent -e \
51b39c5158Smillert   "exit Pod::Simple::TextContent->filter(shift)->any_errata_seen" \
52b39c5158Smillert   thingy.pod
53b39c5158Smillert
54b39c5158Smillert=head1 DESCRIPTION
55b39c5158Smillert
56b39c5158SmillertThis class is that parses Pod and dumps just the text content.  It is
57b39c5158Smillertmainly meant for use by the Pod::Simple test suite, but you may find
58b39c5158Smillertsome other use for it.
59b39c5158Smillert
60b39c5158SmillertThis is a subclass of L<Pod::Simple> and inherits all its methods.
61b39c5158Smillert
62b39c5158Smillert=head1 SEE ALSO
63b39c5158Smillert
64b39c5158SmillertL<Pod::Simple>, L<Pod::Simple::Text>, L<Pod::Spell>
65b39c5158Smillert
66b39c5158Smillert=head1 SUPPORT
67b39c5158Smillert
68b39c5158SmillertQuestions or discussion about POD and Pod::Simple should be sent to the
69b39c5158Smillertpod-people@perl.org mail list. Send an empty email to
70b39c5158Smillertpod-people-subscribe@perl.org to subscribe.
71b39c5158Smillert
72b39c5158SmillertThis module is managed in an open GitHub repository,
73b8851fccSafresh1L<https://github.com/perl-pod/pod-simple/>. Feel free to fork and contribute, or
74*3d61058aSafresh1to clone L<https://github.com/perl-pod/pod-simple.git> and send patches!
75b39c5158Smillert
76b39c5158SmillertPatches against Pod::Simple are welcome. Please send bug reports to
77b39c5158Smillert<bug-pod-simple@rt.cpan.org>.
78b39c5158Smillert
79b39c5158Smillert=head1 COPYRIGHT AND DISCLAIMERS
80b39c5158Smillert
81b39c5158SmillertCopyright (c) 2002 Sean M. Burke.
82b39c5158Smillert
83b39c5158SmillertThis library is free software; you can redistribute it and/or modify it
84b39c5158Smillertunder the same terms as Perl itself.
85b39c5158Smillert
86b39c5158SmillertThis program is distributed in the hope that it will be useful, but
87b39c5158Smillertwithout any warranty; without even the implied warranty of
88b39c5158Smillertmerchantability or fitness for a particular purpose.
89b39c5158Smillert
90b39c5158Smillert=head1 AUTHOR
91b39c5158Smillert
92b39c5158SmillertPod::Simple was created by Sean M. Burke <sburke@cpan.org>.
93b39c5158SmillertBut don't bother him, he's retired.
94b39c5158Smillert
95b39c5158SmillertPod::Simple is maintained by:
96b39c5158Smillert
97b39c5158Smillert=over
98b39c5158Smillert
99b39c5158Smillert=item * Allison Randal C<allison@perl.org>
100b39c5158Smillert
101b39c5158Smillert=item * Hans Dieter Pearcey C<hdp@cpan.org>
102b39c5158Smillert
103b39c5158Smillert=item * David E. Wheeler C<dwheeler@cpan.org>
104b39c5158Smillert
105b39c5158Smillert=back
106b39c5158Smillert
107b39c5158Smillert=cut
108