pod2text - Convert POD data to formatted ASCII text |
pod2text - Convert POD data to formatted ASCII text
pod2text [-aclostu] [--code] [--errors=style] [-i indent] [-q quotes] [--nourls] [--stderr] [-w width] [input [output ...]]
pod2text -h
pod2text is a front-end for Pod::Text and its subclasses. It uses them to generate formatted ASCII text from POD source. It can optionally use either termcap sequences or ANSI color escape sequences to format the text.
input is the file to read for POD source (the POD can be embedded in
code). If input isn't given, it defaults to STDIN
. output, if
given, is the file to which to write the formatted output. If output
isn't given, the formatted output is written to STDOUT
. Several POD
files can be processed in the same pod2text invocation (saving module
load and compile times) by providing multiple pairs of input and
output files on the command line.
=item
entries with a colon in the left margin.
=over
blocks. Defaults to 4 spaces if this option isn't given.
die
says to throw an exception on any
POD formatting error. stderr
says to report errors on standard error,
but not to throw an exception. pod
says to include a POD ERRORS
section in the resulting documentation summarizing the errors. none
ignores POD errors entirely, as much as possible.
The default is die
.
=head1
heading. Normally, no blank line is
printed after =head1
, although one is still printed after =head2
,
because this is the expected formatting for manual pages; if you're
formatting arbitrary text documents, using this option is recommended.
L<foo|http://example.com/>
is formatted as:
foo <http://example.com/>
This flag, if given, suppresses the URL when anchor text is given, so this
example would be formatted as just foo
. This can produce less
cluttered output in cases where the URLs are not particularly important.
quotes may also be set to the special value none
, in which case no
quote marks are added around C<> text.
--errors=stderr
and is supported for backward
compatibility.
Be aware that, when using this option, the input encoding of your POD
source must be properly declared unless it is US-ASCII or Latin-1. POD
input without an =encoding
command will be assumed to be in Latin-1,
and if it's actually in UTF-8, the output will be double-encoded. See
perlpod(1) for more information on the =encoding
command.
As long as all documents processed result in some output, even if that
output includes errata (a POD ERRORS
section generated with
--errors=pod
), pod2text will exit with status 0. If any of the
documents being processed do not result in an output document, pod2text
will exit with status 1. If there are syntax errors in a POD document
being processed and the error handling style is set to the default of
die
, pod2text will abort immediately with exit status 255.
If pod2text fails with errors, see the Pod::Text manpage and the Pod::Simple manpage for information about what those errors might mean. Internally, it can also produce the following diagnostics:
In addition, other the Getopt::Long manpage error messages may result from invalid command-line options.
the Pod::Text manpage, the Pod::Text::Color manpage, the Pod::Text::Overstrike manpage, the Pod::Text::Termcap manpage, the Pod::Simple manpage, perlpod(1)
The current version of this script 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.
Russ Allbery <rra@stanford.edu>.
Copyright 1999, 2000, 2001, 2004, 2006, 2008, 2010, 2012, 2013 Russ Allbery <rra@stanford.edu>.
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
pod2text - Convert POD data to formatted ASCII text |