pod2man

NAME

pod2man - translate embedded perl pod directives into man pages

SYNOPSIS

pod2man [--section=manext] [--release=relpatch]
		[--center=string] [--date=string]
		[--fixed=font] [--official]
		[--lax] inputfile

DESCRIPTION

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.

OPTIONS

center
Set the centered header to a specific string. The default is "User Contributed Perl Documentation", unless the --official flag is given, in which case the default is "Perl Programmers Reference Guide."
date
Set the left-hand footer string to this value. By default, the modification date of the input file is used.
fixed
The fixed font to use for code refs. Defaults to CW.
official
Set the default header to indicate that this page is of the standard release if --center is not given.
release
Set the centered footer. By default, this is the current perl release.
section
Set the section for the .TH macro. The standard conventions on sections are to use 1 for user commands, 2 for system calls, 3 for functions, 4 for devices, 5 for file formats, 6 for games, 7 for miscellaneous information, and 8 for administrator commands. This works best if you put your perl man pages in a separate tree, like /usr/local/perl/man/. By default, section 1 will be used unless the file ends in .pm, in which case section 3 will be selected.
lax
Do not complain when required sections are not present.

ANATOMY OF A PROPER MAN PAGE

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.

NAME

Mandatory section; should be a comma-separated list of programs or functions documented by this podpage, such as:

cat, dog - programs to do something

SYNOPSIS

A short usage summary for programs and functions; might someday be deemed mandatory.

DESCRIPTION

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

OPTIONS

Some people make this separate from the description.

RETURN VALUE

What the program or function returns if successful.

ERRORS

Exceptions, return codes, exit stati, and errno settings.

EXAMPLES

Give some examples of how the program is used.

ENVIRONMENT

Environment variables this program might use.

FILES

All files used by the program. You should probably use the F<> for these.

SEE ALSO

Other relevant man pages. For example:

man(1)

NOTES

Additional commentary.

CAVEATS

Things that require special attention; sometimes called WARNINGS.

DIAGNOSTICS

All possible messages the program can print out, and what those messages mean.

BUGS

Things that either do not work, or do not work correctly.

RESTRICTIONS

Bugs you do not plan to fix.

AUTHOR

The person who wrote it (AUTHORS if multiple).

HISTORY

Programs derived from other sources sometimes include this; alternatively, you might keep a modification log in this section.

EXAMPLES

pod2man program > program.1

pod2man some_module.pm > /usr/perl/man/man3/some_module.3

pod2man --section=7 note.pod > note.7

DIAGNOSTICS

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.

Bad option in paragraph %d of %s: "%s" should be [%s]<%s>
(W) If you start include an option, you should set it off as bold, italic, or code.
Cannot open %s: %s
(F) The input file was not available for the given reason.
Improper man page - no dash in NAME header in paragraph %d of %s
(W) The NAME header did not include an isolated dash; this is considered important.
Invalid man page - no NAME line in %s
(F) You did not include a NAME header, which is essential.
The roff font should be 1 or 2 chars, not %s
(F) The font specified with the --fixed option was not a one- or two-digit roff font.
The %s is missing required section: %s
(W) Required sections include NAME, DESCRIPTION, and, if you are using a section starting with a 3, a SYNOPSIS. Not including a NAME is fatal.
Unknown escape: %s in %s
(W) An unknown HTML entity (probably for an eight-bit character) was given using an E<> directive.

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.
Unmatched =back
(W) You have a =back without a corresponding =over.
Unrecognized pod directive: %s
(W) You specified a pod directive that is not in the known list that includes =head1, =head2, =item, =over, =back, or =cut.

NOTES

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.

RESTRICTIONS

None at this time.

BUGS

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.

AUTHORS

Original prototype by Larry Wall, but so massively hacked over by Tom Christiansen such that Larry probably doesn't recognize it anymore.