pod2man - translate embedded perl pod directives into man pages
pod2man [--section=manext] [--release=relpatch]
[--center=string] [--date=string]
[--fixed=font] [--official]
[--lax] inputfile
The pod2man(1) utility converts its input file containing embedded pod directives (see perlpod) into nroff source suitable for viewing with nroff or troff using the man macro set.
In addition to the obvious pod conversions, pod2man(1)
also handles func()
, func(n)
, and simple
variable references like $cat
or @dog
so
you need not use code escapes for them. Complex expressions like
$fred{'stuff'}
, however, still must be escaped.
Other things that it does include translating the minus in
something like cat-dog, making a long dash--like this--into a real
em dash (—), fixing up "paired quotes," putting a small space after
the parentheses in something like func()
, making C++
and pi look correct, placing a very small space between double
underlines, making ALLCAPS somewhat smaller in troff, and
escaping backslashes, which alleviates the need for you to do
so.
This section describes the general structure and layout of a proper manual page. Major headers should be set out as a =head1 directive, and are historically written in the ALL UPPERCASE format, although this is not mandatory. Minor headers use =head2, and are typically mixed case.
Mandatory section; should be a comma-separated list of programs or functions documented by this podpage, such as:
cat, dog - programs to do something
A short usage summary for programs and functions; might someday be deemed mandatory.
Long discussion of the program. It is advisable to break this up into subsections using the =head2 directives, as shown in the following example:
=head2 A Sample Subsection
=head2 Yet Another Sample Subsection
Some people make this separate from the description.
What the program or function returns if successful.
Exceptions, return codes, exit stati, and errno settings.
Give some examples of how the program is used.
Environment variables this program might use.
All files used by the program. You should probably use the F<> for these.
Other relevant man pages. For example:
man(1)
Additional commentary.
Things that require special attention; sometimes called WARNINGS.
All possible messages the program can print out, and what those messages mean.
Things that either do not work, or do not work correctly.
Bugs you do not plan to fix.
The person who wrote it (AUTHORS if multiple).
Programs derived from other sources sometimes include this; alternatively, you might keep a modification log in this section.
pod2man program > program.1
pod2man some_module.pm > /usr/perl/man/man3/some_module.3
pod2man --section=7 note.pod > note.7
The following diagnostics are generated by pod2man(1). Items marked (W) are non-fatal; (F) errors, however, will cause pod2man(1) to exit immediately with a non-zero status.
Besides amp, lt, gt, and quot, recognized entities are as follows:
Aacute, aacute, Acirc, acirc, AElig, aelig, Agrave, agrave, Aring, aring, Atilde, atilde, Auml, auml, Ccedil, ccedil, Eacute, eacute, Ecirc, ecirc, Egrave, egrave, ETH, eth, Euml, euml, Iacute, iacute, Icirc, icirc, Igrave, igrave, Iuml, iuml, Ntilde, ntilde, Oacute, oacute, Ocirc, ocirc, Ograve, ograve, Oslash, oslash, Otilde, otilde, Ouml, ouml, szlig, THORN, thorn, Uacute, uacute, Ucirc, ucirc, Ugrave, ugrave, Uuml, uuml, Yacute, yacute, and yuml.If you want to print out a large amount of man page continuously, set the C and D registers to set contiguous page numbering and even/odd paging, at least on some versions of man(7). Setting the F register will provide you with some additional experimental indexing:
troff -man -rC1 -rD1 -rF1 perl.1 perldata.1 perlsyn.1 ...
The indexing merely outputs messages through .tm for each major page, section, subsection, item, and any X<> directives.
None at this time.
The =over and =back directives do not work correctly. They take absolute positions instead of offsets and nest poorly. In addition, requiring people to count is suboptimal.
Original prototype by Larry Wall, but so massively hacked over by Tom Christiansen such that Larry probably doesn't recognize it anymore.