1Pod::PlainText(3) User Contributed Perl Documentation Pod::PlainText(3)
2
3
4
6 Pod::PlainText - Convert POD data to formatted ASCII text
7
9 use Pod::PlainText;
10 my $parser = Pod::PlainText->new (sentence => 0, width => 78);
11
12 # Read POD from STDIN and write to STDOUT.
13 $parser->parse_from_filehandle;
14
15 # Read POD from file.pod and write to file.txt.
16 $parser->parse_from_file ('file.pod', 'file.txt');
17
19 Pod::PlainText is a module that can convert documentation in the POD
20 format (the preferred language for documenting Perl) into formatted
21 ASCII. It uses no special formatting controls or codes whatsoever, and
22 its output is therefore suitable for nearly any device.
23
24 As a derived class from Pod::Parser, Pod::PlainText supports the same
25 methods and interfaces. See Pod::Parser for all the details; briefly,
26 one creates a new parser with "Pod::PlainText->new()" and then calls
27 either parse_from_filehandle() or parse_from_file().
28
29 new() can take options, in the form of key/value pairs, that control
30 the behavior of the parser. The currently recognized options are:
31
32 alt If set to a true value, selects an alternate output format that,
33 among other things, uses a different heading style and marks
34 "=item" entries with a colon in the left margin. Defaults to
35 false.
36
37 indent
38 The number of spaces to indent regular text, and the default
39 indentation for "=over" blocks. Defaults to 4.
40
41 loose
42 If set to a true value, a blank line is printed after a "=headN"
43 headings. If set to false (the default), no blank line is printed
44 after "=headN". This is the default because it's the expected
45 formatting for manual pages; if you're formatting arbitrary text
46 documents, setting this to true may result in more pleasing output.
47
48 sentence
49 If set to a true value, Pod::PlainText will assume that each
50 sentence ends in two spaces, and will try to preserve that spacing.
51 If set to false, all consecutive whitespace in non-verbatim
52 paragraphs is compressed into a single space. Defaults to true.
53
54 width
55 The column at which to wrap text on the right-hand side. Defaults
56 to 76.
57
58 The standard Pod::Parser method parse_from_filehandle() takes up to two
59 arguments, the first being the file handle to read POD from and the
60 second being the file handle to write the formatted output to. The
61 first defaults to STDIN if not given, and the second defaults to
62 STDOUT. The method parse_from_file() is almost identical, except that
63 its two arguments are the input and output disk files instead. See
64 Pod::Parser for the specific details.
65
67 Bizarre space in item
68 (W) Something has gone wrong in internal "=item" processing. This
69 message indicates a bug in Pod::PlainText; you should never see it.
70
71 Can't open %s for reading: %s
72 (F) Pod::PlainText was invoked via the compatibility mode
73 pod2text() interface and the input file it was given could not be
74 opened.
75
76 Unknown escape: %s
77 (W) The POD source contained an "E<>" escape that Pod::PlainText
78 didn't know about.
79
80 Unknown sequence: %s
81 (W) The POD source contained a non-standard internal sequence
82 (something of the form "X<>") that Pod::PlainText didn't know
83 about.
84
85 Unmatched =back
86 (W) Pod::PlainText encountered a "=back" command that didn't
87 correspond to an "=over" command.
88
90 Embedded Ctrl-As (octal 001) in the input will be mapped to spaces on
91 output, due to an internal implementation detail.
92
94 This is a replacement for an earlier Pod::Text module written by Tom
95 Christiansen. It has a revamped interface, since it now uses
96 Pod::Parser, but an interface roughly compatible with the old
97 Pod::Text::pod2text() function is still available. Please change to
98 the new calling convention, though.
99
100 The original Pod::Text contained code to do formatting via termcap
101 sequences, although it wasn't turned on by default and it was
102 problematic to get it to work at all. This rewrite doesn't even try to
103 do that, but a subclass of it does. Look for Pod::Text::Termcap.
104
106 Pod::PlainText is part of the Pod::Parser distribution.
107
108 Pod::Parser, Pod::Text::Termcap, pod2text(1)
109
111 Please report bugs using <http://rt.cpan.org>.
112
113 Russ Allbery <rra@stanford.edu>, based very heavily on the original
114 Pod::Text by Tom Christiansen <tchrist@mox.perl.com> and its conversion
115 to Pod::Parser by Brad Appleton <bradapp@enteract.com>.
116
117
118
119perl v5.16.3 2013-01-31 Pod::PlainText(3)