.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Pod::PlainText 3perl" .TH Pod::PlainText 3perl "2020-06-07" "perl v5.30.3" "Perl Programmers Reference Guide" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Pod::PlainText \- Convert POD data to formatted ASCII text .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Pod::PlainText; \& my $parser = Pod::PlainText\->new (sentence => 0, width => 78); \& \& # Read POD from STDIN and write to STDOUT. \& $parser\->parse_from_filehandle; \& \& # Read POD from file.pod and write to file.txt. \& $parser\->parse_from_file (\*(Aqfile.pod\*(Aq, \*(Aqfile.txt\*(Aq); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fB\s-1NOTE:\s0 This module is considered legacy; modern Perl releases (5.18 and higher) are going to remove Pod-Parser from core and use Pod-Simple for all things \s-1POD.\s0\fR .PP Pod::PlainText is a module that can convert documentation in the \s-1POD\s0 format (the preferred language for documenting Perl) into formatted \s-1ASCII.\s0 It uses no special formatting controls or codes whatsoever, and its output is therefore suitable for nearly any device. .PP As a derived class from Pod::Parser, Pod::PlainText supports the same methods and interfaces. See Pod::Parser for all the details; briefly, one creates a new parser with \f(CW\*(C`Pod::PlainText\->new()\*(C'\fR and then calls either \&\fBparse_from_filehandle()\fR or \fBparse_from_file()\fR. .PP \&\fBnew()\fR can take options, in the form of key/value pairs, that control the behavior of the parser. The currently recognized options are: .IP "alt" 4 .IX Item "alt" If set to a true value, selects an alternate output format that, among other things, uses a different heading style and marks \f(CW\*(C`=item\*(C'\fR entries with a colon in the left margin. Defaults to false. .IP "indent" 4 .IX Item "indent" The number of spaces to indent regular text, and the default indentation for \&\f(CW\*(C`=over\*(C'\fR blocks. Defaults to 4. .IP "loose" 4 .IX Item "loose" If set to a true value, a blank line is printed after a \f(CW\*(C`=headN\*(C'\fR headings. If set to false (the default), no blank line is printed after \f(CW\*(C`=headN\*(C'\fR. This is the default because it's the expected formatting for manual pages; if you're formatting arbitrary text documents, setting this to true may result in more pleasing output. .IP "sentence" 4 .IX Item "sentence" If set to a true value, Pod::PlainText will assume that each sentence ends in two spaces, and will try to preserve that spacing. If set to false, all consecutive whitespace in non-verbatim paragraphs is compressed into a single space. Defaults to true. .IP "width" 4 .IX Item "width" The column at which to wrap text on the right-hand side. Defaults to 76. .PP The standard Pod::Parser method \fBparse_from_filehandle()\fR takes up to two arguments, the first being the file handle to read \s-1POD\s0 from and the second being the file handle to write the formatted output to. The first defaults to \s-1STDIN\s0 if not given, and the second defaults to \s-1STDOUT.\s0 The method \&\fBparse_from_file()\fR is almost identical, except that its two arguments are the input and output disk files instead. See Pod::Parser for the specific details. .SH "DIAGNOSTICS" .IX Header "DIAGNOSTICS" .IP "Bizarre space in item" 4 .IX Item "Bizarre space in item" (W) Something has gone wrong in internal \f(CW\*(C`=item\*(C'\fR processing. This message indicates a bug in Pod::PlainText; you should never see it. .ie n .IP "Can't open %s for reading: %s" 4 .el .IP "Can't open \f(CW%s\fR for reading: \f(CW%s\fR" 4 .IX Item "Can't open %s for reading: %s" (F) Pod::PlainText was invoked via the compatibility mode \fBpod2text()\fR interface and the input file it was given could not be opened. .ie n .IP "Unknown escape: %s" 4 .el .IP "Unknown escape: \f(CW%s\fR" 4 .IX Item "Unknown escape: %s" (W) The \s-1POD\s0 source contained an \f(CW\*(C`E<>\*(C'\fR escape that Pod::PlainText didn't know about. .ie n .IP "Unknown sequence: %s" 4 .el .IP "Unknown sequence: \f(CW%s\fR" 4 .IX Item "Unknown sequence: %s" (W) The \s-1POD\s0 source contained a non-standard internal sequence (something of the form \f(CW\*(C`X<>\*(C'\fR) that Pod::PlainText didn't know about. .IP "Unmatched =back" 4 .IX Item "Unmatched =back" (W) Pod::PlainText encountered a \f(CW\*(C`=back\*(C'\fR command that didn't correspond to an \&\f(CW\*(C`=over\*(C'\fR command. .SH "RESTRICTIONS" .IX Header "RESTRICTIONS" Embedded Ctrl-As (octal 001) in the input will be mapped to spaces on output, due to an internal implementation detail. .SH "NOTES" .IX Header "NOTES" This is a replacement for an earlier Pod::Text module written by Tom Christiansen. It has a revamped interface, since it now uses Pod::Parser, but an interface roughly compatible with the old \fBPod::Text::pod2text()\fR function is still available. Please change to the new calling convention, though. .PP The original Pod::Text contained code to do formatting via termcap sequences, although it wasn't turned on by default and it was problematic to get it to work at all. This rewrite doesn't even try to do that, but a subclass of it does. Look for Pod::Text::Termcap. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBPod::PlainText\fR is part of the Pod::Parser distribution. .PP Pod::Parser, Pod::Text::Termcap, \&\fBpod2text\fR\|(1) .SH "AUTHOR" .IX Header "AUTHOR" Please report bugs using . .PP Russ Allbery , based \fIvery\fR heavily on the original Pod::Text by Tom Christiansen and its conversion to Pod::Parser by Brad Appleton .