Plan 9 from Bell Labs’s /usr/web/sources/contrib/gabidiaz/root/sys/man/2perl/Pod::Text

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.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.  | will give a
.\" real vertical bar.  \*(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-|\(bv\*(Tr
.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" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
.    de IX
.    tm Index:\\$1\t\\n%\t"\\$2"
..
.    nr % 0
.    rr F
.\}
.\"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
.    \" fudge factors for nroff and troff
.if n \{\
.    ds #H 0
.    ds #V .8m
.    ds #F .3m
.    ds #[ \f1
.    ds #] \fP
.\}
.if t \{\
.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.    ds #V .6m
.    ds #F 0
.    ds #[ \&
.    ds #] \&
.\}
.    \" simple accents for nroff and troff
.if n \{\
.    ds ' \&
.    ds ` \&
.    ds ^ \&
.    ds , \&
.    ds ~ ~
.    ds /
.\}
.if t \{\
.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
.    \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.    \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.    \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.    ds : e
.    ds 8 ss
.    ds o a
.    ds d- d\h'-1'\(ga
.    ds D- D\h'-1'\(hy
.    ds th \o'bp'
.    ds Th \o'LP'
.    ds ae ae
.    ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "Pod::Text 3"
.TH Pod::Text 3 "2002-11-24" "perl v5.8.0" "Perl Programmers Reference Guide"
.SH "NAME"
Pod::Text \- Convert POD data to formatted ASCII text
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 2
\&    use Pod::Text;
\&    my $parser = Pod::Text->new (sentence => 0, width => 78);
.Ve
.PP
.Vb 2
\&    # Read POD from STDIN and write to STDOUT.
\&    $parser->parse_from_filehandle;
.Ve
.PP
.Vb 2
\&    # Read POD from file.pod and write to file.txt.
\&    $parser->parse_from_file ('file.pod', 'file.txt');
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
Pod::Text 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::Text supports the same methods and
interfaces.  See Pod::Parser for all the details; briefly, one creates a
new parser with \f(CW\*(C`Pod::Text\->new()\*(C'\fR and then calls either
\&\fIparse_from_filehandle()\fR or \fIparse_from_file()\fR.
.PP
\&\fInew()\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 "code" 4
.IX Item "code"
If set to a true value, the non-POD parts of the input file will be included
in the output.  Useful for viewing code documented with \s-1POD\s0 blocks with the
\&\s-1POD\s0 rendered and the code left intact.
.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`=head1\*(C'\fR heading.
If set to false (the default), no blank line is printed after \f(CW\*(C`=head1\*(C'\fR,
although one is still printed after \f(CW\*(C`=head2\*(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 "quotes" 4
.IX Item "quotes"
Sets the quote marks used to surround C<> text.  If the value is a
single character, it is used as both the left and right quote; if it is two
characters, the first character is used as the left quote and the second as
the right quoted; and if it is four characters, the first two are used as
the left quote and the second two as the right quote.
.Sp
This may also be set to the special value \f(CW\*(C`none\*(C'\fR, in which case no quote
marks are added around C<> text.
.IP "sentence" 4
.IX Item "sentence"
If set to a true value, Pod::Text 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 \fIparse_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
\&\fIparse_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"
.PD 0
.IP "Item called without tag" 4
.IX Item "Item called without tag"
.PD
(W) Something has gone wrong in internal \f(CW\*(C`=item\*(C'\fR processing.  These
messages indicate a bug in Pod::Text; you should never see them.
.ie n .IP "Can't open %s\fR for reading: \f(CW%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::Text was invoked via the compatibility mode \fIpod2text()\fR interface
and the input file it was given could not be opened.
.ie n .IP "Invalid quote specification ""%s""" 4
.el .IP "Invalid quote specification ``%s''" 4
.IX Item "Invalid quote specification %s"
(F) The quote specification given (the quotes option to the constructor) was
invalid.  A quote specification must be one, two, or four characters long.
.ie n .IP "%s:%d: Unknown command paragraph: %s" 4
.el .IP "%s:%d: Unknown command paragraph: \f(CW%s\fR" 4
.IX Item "%s:%d: Unknown command paragraph: %s"
(W) The \s-1POD\s0 source contained a non-standard command paragraph (something of
the form \f(CW\*(C`=command args\*(C'\fR) that Pod::Man didn't know about.  It was ignored.
.ie n .IP "%s:%d: Unknown escape: %s" 4
.el .IP "%s:%d: Unknown escape: \f(CW%s\fR" 4
.IX Item "%s:%d: Unknown escape: %s"
(W) The \s-1POD\s0 source contained an \f(CW\*(C`E<>\*(C'\fR escape that Pod::Text didn't
know about.
.ie n .IP "%s:%d: Unknown formatting code: %s" 4
.el .IP "%s:%d: Unknown formatting code: \f(CW%s\fR" 4
.IX Item "%s:%d: Unknown formatting code: %s"
(W) The \s-1POD\s0 source contained a non-standard formatting code (something of
the form \f(CW\*(C`X<>\*(C'\fR) that Pod::Text didn't know about.
.IP "%s:%d: Unmatched =back" 4
.IX Item "%s:%d: Unmatched =back"
(W) Pod::Text 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 \fIPod::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"
Pod::Parser, Pod::Text::Termcap, \fIpod2text\fR\|(1)
.PP
The current version of this module is always available from its web site at
<http://www.eyrie.org/~eagle/software/podlators/>.  It is also part of the
Perl core distribution as of 5.6.0.
.SH "AUTHOR"
.IX Header "AUTHOR"
Russ Allbery <rra@stanford.edu>, based \fIvery\fR heavily on the original
Pod::Text by Tom Christiansen <tchrist@mox.perl.com> and its conversion to
Pod::Parser by Brad Appleton <bradapp@enteract.com>.
.SH "COPYRIGHT AND LICENSE"
.IX Header "COPYRIGHT AND LICENSE"
Copyright 1999, 2000, 2001, 2002 by Russ Allbery <rra@stanford.edu>.
.PP
This program is free software; you may redistribute it and/or modify it
under the same terms as Perl itself.

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.