1POD2MAN(1)             Perl Programmers Reference Guide             POD2MAN(1)
2
3
4

NAME

6       pod2man - Convert POD data to formatted *roff input
7

SYNOPSIS

9       pod2man [--section=manext] [--release=version] [--center=string]
10       [--date=string] [--fixed=font] [--fixedbold=font] [--fixeditalic=font]
11       [--fixedbolditalic=font] [--name=name] [--official] [--lax]
12       [--quotes=quotes] [--verbose] [input [output] ...]
13
14       pod2man --help
15

DESCRIPTION

17       pod2man is a front-end for Pod::Man, using it to generate *roff input
18       from POD source.  The resulting *roff code is suitable for display on a
19       terminal using nroff(1), normally via man(1), or printing using
20       troff(1).
21
22       input is the file to read for POD source (the POD can be embedded in
23       code).  If input isn't given, it defaults to STDIN.  output, if given,
24       is the file to which to write the formatted output.  If output isn't
25       given, the formatted output is written to STDOUT.  Several POD files
26       can be processed in the same pod2man invocation (saving module load and
27       compile times) by providing multiple pairs of input and output files on
28       the command line.
29
30       --section, --release, --center, --date, and --official can be used to
31       set the headers and footers to use; if not given, Pod::Man will assume
32       various defaults.  See below or Pod::Man for details.
33
34       pod2man assumes that your *roff formatters have a fixed-width font
35       named CW.  If yours is called something else (like CR), use --fixed to
36       specify it.  This generally only matters for troff output for printing.
37       Similarly, you can set the fonts used for bold, italic, and bold italic
38       fixed-width output.
39
40       Besides the obvious pod conversions, Pod::Man, and therefore pod2man
41       also takes care of formatting func(), func(n), and simple variable ref‐
42       erences like $foo or @bar so you don't have to use code escapes for
43       them; complex expressions like $fred{'stuff'} will still need to be
44       escaped, though.  It also translates dashes that aren't used as hyphens
45       into en dashes, makes long dashes--like this--into proper em dashes,
46       fixes "paired quotes," and takes care of several other troff-specific
47       tweaks.  See Pod::Man for complete information.
48

OPTIONS

50       -c string, --center=string
51           Sets the centered page header to string.  The default is "User Con‐
52           tributed Perl Documentation", but also see --official below.
53
54       -d string, --date=string
55           Set the left-hand footer string to this value.  By default, the
56           modification date of the input file will be used, or the current
57           date if input comes from STDIN.
58
59       --fixed=font
60           The fixed-width font to use for vertabim text and code.  Defaults
61           to CW.  Some systems may want CR instead.  Only matters for
62           troff(1) output.
63
64       --fixedbold=font
65           Bold version of the fixed-width font.  Defaults to CB.  Only mat‐
66           ters for troff(1) output.
67
68       --fixeditalic=font
69           Italic version of the fixed-width font (actually, something of a
70           misnomer, since most fixed-width fonts only have an oblique ver‐
71           sion, not an italic version).  Defaults to CI.  Only matters for
72           troff(1) output.
73
74       --fixedbolditalic=font
75           Bold italic (probably actually oblique) version of the fixed-width
76           font.  Pod::Man doesn't assume you have this, and defaults to CB.
77           Some systems (such as Solaris) have this font available as CX.
78           Only matters for troff(1) output.
79
80       -h, --help
81           Print out usage information.
82
83       -l, --lax
84           No longer used.  pod2man used to check its input for validity as a
85           manual page, but this should now be done by podchecker(1) instead.
86           Accepted for backwards compatibility; this option no longer does
87           anything.
88
89       -n name, --name=name
90           Set the name of the manual page to name.  Without this option, the
91           manual name is set to the uppercased base name of the file being
92           converted unless the manual section is 3, in which case the path is
93           parsed to see if it is a Perl module path.  If it is, a path like
94           ".../lib/Pod/Man.pm" is converted into a name like "Pod::Man".
95           This option, if given, overrides any automatic determination of the
96           name.
97
98           Note that this option is probably not useful when converting multi‐
99           ple POD files at once.  The convention for Unix man pages for com‐
100           mands is for the man page title to be in all-uppercase even if the
101           command isn't.
102
103       -o, --official
104           Set the default header to indicate that this page is part of the
105           standard Perl release, if --center is not also given.
106
107       -q quotes, --quotes=quotes
108           Sets the quote marks used to surround C<> text to quotes.  If
109           quotes is a single character, it is used as both the left and right
110           quote; if quotes is two characters, the first character is used as
111           the left quote and the second as the right quoted; and if quotes is
112           four characters, the first two are used as the left quote and the
113           second two as the right quote.
114
115           quotes may also be set to the special value "none", in which case
116           no quote marks are added around C<> text (but the font is still
117           changed for troff output).
118
119       -r, --release
120           Set the centered footer.  By default, this is the version of Perl
121           you run pod2man under.  Note that some system an macro sets assume
122           that the centered footer will be a modification date and will
123           prepend something like "Last modified: "; if this is the case, you
124           may want to set --release to the last modified date and --date to
125           the version number.
126
127       -s, --section
128           Set the section for the ".TH" macro.  The standard section number‐
129           ing convention is to use 1 for user commands, 2 for system calls, 3
130           for functions, 4 for devices, 5 for file formats, 6 for games, 7
131           for miscellaneous information, and 8 for administrator commands.
132           There is a lot of variation here, however; some systems (like
133           Solaris) use 4 for file formats, 5 for miscellaneous information,
134           and 7 for devices.  Still others use 1m instead of 8, or some mix
135           of both.  About the only section numbers that are reliably consis‐
136           tent are 1, 2, and 3.
137
138           By default, section 1 will be used unless the file ends in .pm in
139           which case section 3 will be selected.
140
141       -v, --verbose
142           Print out the name of each output file as it is being generated.
143

DIAGNOSTICS

145       If pod2man fails with errors, see Pod::Man and Pod::Parser for informa‐
146       tion about what those errors might mean.
147

EXAMPLES

149           pod2man program > program.1
150           pod2man SomeModule.pm /usr/perl/man/man3/SomeModule.3
151           pod2man --section=7 note.pod > note.7
152
153       If you would like to print out a lot of man page continuously, you
154       probably want to set the C and D registers to set contiguous page num‐
155       bering and even/odd paging, at least on some versions of man(7).
156
157           troff -man -rC1 -rD1 perl.1 perldata.1 perlsyn.1 ...
158
159       To get index entries on stderr, turn on the F register, as in:
160
161           troff -man -rF1 perl.1
162
163       The indexing merely outputs messages via ".tm" for each major page,
164       section, subsection, item, and any "X<>" directives.  See Pod::Man for
165       more details.
166

BUGS

168       Lots of this documentation is duplicated from Pod::Man.
169

NOTES

171       For those not sure of the proper layout of a man page, here are some
172       notes on writing a proper man page.
173
174       The name of the program being documented is conventionally written in
175       bold (using B<>) wherever it occurs, as are all program options.  Argu‐
176       ments should be written in italics (I<>).  Functions are traditionally
177       written in italics; if you write a function as function(), Pod::Man
178       will take care of this for you.  Literal code or commands should be in
179       C<>.  References to other man pages should be in the form "manpage(sec‐
180       tion)", and Pod::Man will automatically format those appropriately.  As
181       an exception, it's traditional not to use this form when referring to
182       module documentation; use "L<Module::Name>" instead.
183
184       References to other programs or functions are normally in the form of
185       man page references so that cross-referencing tools can provide the
186       user with links and the like.  It's possible to overdo this, though, so
187       be careful not to clutter your documentation with too much markup.
188
189       The major headers should be set out using a "=head1" directive, and are
190       historically written in the rather startling ALL UPPER CASE format,
191       although this is not mandatory.  Minor headers may be included using
192       "=head2", and are typically in mixed case.
193
194       The standard sections of a manual page are:
195
196       NAME
197           Mandatory section; should be a comma-separated list of programs or
198           functions documented by this podpage, such as:
199
200               foo, bar - programs to do something
201
202           Manual page indexers are often extremely picky about the format of
203           this section, so don't put anything in it except this line.  A sin‐
204           gle dash, and only a single dash, should separate the list of pro‐
205           grams or functions from the description.  Functions should not be
206           qualified with "()" or the like.  The description should ideally
207           fit on a single line, even if a man program replaces the dash with
208           a few tabs.
209
210       SYNOPSIS
211           A short usage summary for programs and functions.  This section is
212           mandatory for section 3 pages.
213
214       DESCRIPTION
215           Extended description and discussion of the program or functions, or
216           the body of the documentation for man pages that document something
217           else.  If particularly long, it's a good idea to break this up into
218           subsections "=head2" directives like:
219
220               =head2 Normal Usage
221
222               =head2 Advanced Features
223
224               =head2 Writing Configuration Files
225
226           or whatever is appropriate for your documentation.
227
228       OPTIONS
229           Detailed description of each of the command-line options taken by
230           the program.  This should be separate from the description for the
231           use of things like Pod::Usage.  This is normally presented as a
232           list, with each option as a separate "=item".  The specific option
233           string should be enclosed in B<>.  Any values that the option takes
234           should be enclosed in I<>.  For example, the section for the option
235           --section=manext would be introduced with:
236
237               =item B<--section>=I<manext>
238
239           Synonymous options (like both the short and long forms) are sepa‐
240           rated by a comma and a space on the same "=item" line, or option‐
241           ally listed as their own item with a reference to the canonical
242           name.  For example, since --section can also be written as -s, the
243           above would be:
244
245               =item B<-s> I<manext>, B<--section>=I<manext>
246
247           (Writing the short option first is arguably easier to read, since
248           the long option is long enough to draw the eye to it anyway and the
249           short option can otherwise get lost in visual noise.)
250
251       RETURN VALUE
252           What the program or function returns, if successful.  This section
253           can be omitted for programs whose precise exit codes aren't impor‐
254           tant, provided they return 0 on success as is standard.  It should
255           always be present for functions.
256
257       ERRORS
258           Exceptions, error return codes, exit statuses, and errno settings.
259           Typically used for function documentation; program documentation
260           uses DIAGNOSTICS instead.  The general rule of thumb is that errors
261           printed to STDOUT or STDERR and intended for the end user are docu‐
262           mented in DIAGNOSTICS while errors passed internal to the calling
263           program and intended for other programmers are documented in
264           ERRORS.  When documenting a function that sets errno, a full list
265           of the possible errno values should be given here.
266
267       DIAGNOSTICS
268           All possible messages the program can print out--and what they
269           mean.  You may wish to follow the same documentation style as the
270           Perl documentation; see perldiag(1) for more details (and look at
271           the POD source as well).
272
273           If applicable, please include details on what the user should do to
274           correct the error; documenting an error as indicating "the input
275           buffer is too small" without telling the user how to increase the
276           size of the input buffer (or at least telling them that it isn't
277           possible) aren't very useful.
278
279       EXAMPLES
280           Give some example uses of the program or function.  Don't skimp;
281           users often find this the most useful part of the documentation.
282           The examples are generally given as verbatim paragraphs.
283
284           Don't just present an example without explaining what it does.
285           Adding a short paragraph saying what the example will do can
286           increase the value of the example immensely.
287
288       ENVIRONMENT
289           Environment variables that the program cares about, normally pre‐
290           sented as a list using "=over", "=item", and "=back".  For example:
291
292               =over 6
293
294               =item HOME
295
296               Used to determine the user's home directory.  F<.foorc> in this
297               directory is read for configuration details, if it exists.
298
299               =back
300
301           Since environment variables are normally in all uppercase, no addi‐
302           tional special formatting is generally needed; they're glaring
303           enough as it is.
304
305       FILES
306           All files used by the program or function, normally presented as a
307           list, and what it uses them for.  File names should be enclosed in
308           F<>.  It's particularly important to document files that will be
309           potentially modified.
310
311       CAVEATS
312           Things to take special care with, sometimes called WARNINGS.
313
314       BUGS
315           Things that are broken or just don't work quite right.
316
317       RESTRICTIONS
318           Bugs you don't plan to fix.  :-)
319
320       NOTES
321           Miscellaneous commentary.
322
323       SEE ALSO
324           Other man pages to check out, like man(1), man(7), makewhatis(8),
325           or catman(8).  Normally a simple list of man pages separated by
326           commas, or a paragraph giving the name of a reference work.  Man
327           page references, if they use the standard "name(section)" form,
328           don't have to be enclosed in L<> (although it's recommended), but
329           other things in this section probably should be when appropriate.
330
331           If the package has a mailing list, include a URL or subscription
332           instructions here.
333
334           If the package has a web site, include a URL here.
335
336       AUTHOR
337           Who wrote it (use AUTHORS for multiple people).  Including your
338           current e-mail address (or some e-mail address to which bug reports
339           should be sent) so that users have a way of contacting you is a
340           good idea.  Remember that program documentation tends to roam the
341           wild for far longer than you expect and pick an e-mail address
342           that's likely to last if possible.
343
344       COPYRIGHT AND LICENSE
345           For copyright
346
347               Copyright YEAR(s) by YOUR NAME(s)
348
349           (No, (C) is not needed.  No, "all rights reserved" is not needed.)
350
351           For licensing the easiest way is to use the same licensing as Perl
352           itself:
353
354               This library is free software; you may redistribute it and/or modify
355               it under the same terms as Perl itself.
356
357           This makes it easy for people to use your module with Perl.  Note
358           that this licensing is neither an endorsement or a requirement, you
359           are of course free to choose any licensing.
360
361       HISTORY
362           Programs derived from other sources sometimes have this, or you
363           might keep a modification log here.  If the log gets overly long or
364           detailed, consider maintaining it in a separate file, though.
365
366       In addition, some systems use CONFORMING TO to note conformance to rel‐
367       evant standards and MT-LEVEL to note safeness for use in threaded pro‐
368       grams or signal handlers.  These headings are primarily useful when
369       documenting parts of a C library.  Documentation of object-oriented
370       libraries or modules may use CONSTRUCTORS and METHODS sections for
371       detailed documentation of the parts of the library and save the
372       DESCRIPTION section for an overview; other large modules may use FUNC‐
373       TIONS for similar reasons.  Some people use OVERVIEW to summarize the
374       description if it's quite long.
375
376       Section ordering varies, although NAME should always be the first sec‐
377       tion (you'll break some man page systems otherwise), and NAME, SYNOP‐
378       SIS, DESCRIPTION, and OPTIONS generally always occur first and in that
379       order if present.  In general, SEE ALSO, AUTHOR, and similar material
380       should be left for last.  Some systems also move WARNINGS and NOTES to
381       last.  The order given above should be reasonable for most purposes.
382
383       Finally, as a general note, try not to use an excessive amount of
384       markup.  As documented here and in Pod::Man, you can safely leave Perl
385       variables, function names, man page references, and the like unadorned
386       by markup and the POD translators will figure it out for you.  This
387       makes it much easier to later edit the documentation.  Note that many
388       existing translators (including this one currently) will do the wrong
389       thing with e-mail addresses or URLs when wrapped in L<>, so don't do
390       that.
391
392       For additional information that may be more accurate for your specific
393       system, see either man(5) or man(7) depending on your system manual
394       section numbering conventions.
395

SEE ALSO

397       Pod::Man, Pod::Parser, man(1), nroff(1), podchecker(1), troff(1),
398       man(7)
399
400       The man page documenting the an macro set may be man(5) instead of
401       man(7) on your system.
402
403       The current version of this script is always available from its web
404       site at <http://www.eyrie.org/~eagle/software/podlators/>.  It is also
405       part of the Perl core distribution as of 5.6.0.
406

AUTHOR

408       Russ Allbery <rra@stanford.edu>, based very heavily on the original
409       pod2man by Larry Wall and Tom Christiansen.  Large portions of this
410       documentation, particularly the sections on the anatomy of a proper man
411       page, are taken from the pod2man documentation by Tom.
412
414       Copyright 1999, 2000, 2001 by Russ Allbery <rra@stanford.edu>.
415
416       This program is free software; you may redistribute it and/or modify it
417       under the same terms as Perl itself.
418
419
420
421perl v5.8.8                       2008-05-05                        POD2MAN(1)
Impressum