1POD2MAN(1) Perl Programmers Reference Guide POD2MAN(1)
2
3
4
6 pod2man - Convert POD data to formatted *roff input
7
9 pod2man [--center=string] [--date=string]
10 [--fixed=font] [--fixedbold=font] [--fixeditalic=font]
11 [--fixedbolditalic=font] [--name=name] [--official]
12 [--quotes=quotes] [--release[=version]]
13 [--section=manext] [--stderr] [--utf8] [--verbose]
14 [input [output] ...]
15
16 pod2man --help
17
19 pod2man is a front-end for Pod::Man, using it to generate *roff input
20 from POD source. The resulting *roff code is suitable for display on a
21 terminal using nroff(1), normally via man(1), or printing using
22 troff(1).
23
24 input is the file to read for POD source (the POD can be embedded in
25 code). If input isn't given, it defaults to "STDIN". output, if
26 given, is the file to which to write the formatted output. If output
27 isn't given, the formatted output is written to "STDOUT". Several POD
28 files can be processed in the same pod2man invocation (saving module
29 load and compile times) by providing multiple pairs of input and output
30 files on the command line.
31
32 --section, --release, --center, --date, and --official can be used to
33 set the headers and footers to use; if not given, Pod::Man will assume
34 various defaults. See below or Pod::Man for details.
35
36 pod2man assumes that your *roff formatters have a fixed-width font
37 named "CW". If yours is called something else (like "CR"), use --fixed
38 to specify it. This generally only matters for troff output for
39 printing. Similarly, you can set the fonts used for bold, italic, and
40 bold italic fixed-width output.
41
42 Besides the obvious pod conversions, Pod::Man, and therefore pod2man
43 also takes care of formatting func(), func(n), and simple variable
44 references like $foo or @bar so you don't have to use code escapes for
45 them; complex expressions like $fred{'stuff'} will still need to be
46 escaped, though. It also translates dashes that aren't used as hyphens
47 into en dashes, makes long dashes--like this--into proper em dashes,
48 fixes "paired quotes," and takes care of several other troff-specific
49 tweaks. See Pod::Man for complete information.
50
52 -c string, --center=string
53 Sets the centered page header to string. The default is "User
54 Contributed Perl Documentation", but also see --official below.
55
56 -d string, --date=string
57 Set the left-hand footer string to this value. By default, the
58 modification date of the input file will be used, or the current
59 date if input comes from "STDIN".
60
61 --fixed=font
62 The fixed-width font to use for verbatim text and code. Defaults
63 to "CW". Some systems may want "CR" instead. Only matters for
64 troff(1) output.
65
66 --fixedbold=font
67 Bold version of the fixed-width font. Defaults to "CB". Only
68 matters for troff(1) output.
69
70 --fixeditalic=font
71 Italic version of the fixed-width font (actually, something of a
72 misnomer, since most fixed-width fonts only have an oblique
73 version, not an italic version). Defaults to "CI". Only matters
74 for troff(1) output.
75
76 --fixedbolditalic=font
77 Bold italic (probably actually oblique) version of the fixed-width
78 font. Pod::Man doesn't assume you have this, and defaults to "CB".
79 Some systems (such as Solaris) have this font available as "CX".
80 Only matters for troff(1) output.
81
82 -h, --help
83 Print out usage information.
84
85 -l, --lax
86 No longer used. pod2man used to check its input for validity as a
87 manual page, but this should now be done by podchecker(1) instead.
88 Accepted for backward compatibility; this option no longer does
89 anything.
90
91 -n name, --name=name
92 Set the name of the manual page to name. Without this option, the
93 manual name is set to the uppercased base name of the file being
94 converted unless the manual section is 3, in which case the path is
95 parsed to see if it is a Perl module path. If it is, a path like
96 ".../lib/Pod/Man.pm" is converted into a name like "Pod::Man".
97 This option, if given, overrides any automatic determination of the
98 name.
99
100 Note that this option is probably not useful when converting
101 multiple POD files at once. The convention for Unix man pages for
102 commands is for the man page title to be in all-uppercase even if
103 the command isn't.
104
105 -o, --official
106 Set the default header to indicate that this page is part of the
107 standard Perl release, if --center is not also given.
108
109 -q quotes, --quotes=quotes
110 Sets the quote marks used to surround C<> text to quotes. If
111 quotes is a single character, it is used as both the left and right
112 quote; if quotes is two characters, the first character is used as
113 the left quote and the second as the right quoted; and if quotes is
114 four characters, the first two are used as the left quote and the
115 second two as the right quote.
116
117 quotes may also be set to the special value "none", in which case
118 no quote marks are added around C<> text (but the font is still
119 changed for troff output).
120
121 -r, --release
122 Set the centered footer. By default, this is the version of Perl
123 you run pod2man under. Note that some system an macro sets assume
124 that the centered footer will be a modification date and will
125 prepend something like "Last modified: "; if this is the case, you
126 may want to set --release to the last modified date and --date to
127 the version number.
128
129 -s, --section
130 Set the section for the ".TH" macro. The standard section
131 numbering convention is to use 1 for user commands, 2 for system
132 calls, 3 for functions, 4 for devices, 5 for file formats, 6 for
133 games, 7 for miscellaneous information, and 8 for administrator
134 commands. There is a lot of variation here, however; some systems
135 (like Solaris) use 4 for file formats, 5 for miscellaneous
136 information, and 7 for devices. Still others use 1m instead of 8,
137 or some mix of both. About the only section numbers that are
138 reliably consistent are 1, 2, and 3.
139
140 By default, section 1 will be used unless the file ends in ".pm",
141 in which case section 3 will be selected.
142
143 --stderr
144 By default, pod2man puts any errors detected in the POD input in a
145 POD ERRORS section in the output manual page. If --stderr is
146 given, errors are sent to standard error instead and the POD ERRORS
147 section is suppressed.
148
149 -u, --utf8
150 By default, pod2man produces the most conservative possible *roff
151 output to try to ensure that it will work with as many different
152 *roff implementations as possible. Many *roff implementations
153 cannot handle non-ASCII characters, so this means all non-ASCII
154 characters are converted either to a *roff escape sequence that
155 tries to create a properly accented character (at least for troff
156 output) or to "X".
157
158 This option says to instead output literal UTF-8 characters. If
159 your *roff implementation can handle it, this is the best output
160 format to use and avoids corruption of documents containing non-
161 ASCII characters. However, be warned that *roff source with
162 literal UTF-8 characters is not supported by many implementations
163 and may even result in segfaults and other bad behavior.
164
165 Be aware that, when using this option, the input encoding of your
166 POD source must be properly declared unless it is US-ASCII or
167 Latin-1. POD input without an "=encoding" command will be assumed
168 to be in Latin-1, and if it's actually in UTF-8, the output will be
169 double-encoded. See perlpod(1) for more information on the
170 "=encoding" command.
171
172 -v, --verbose
173 Print out the name of each output file as it is being generated.
174
176 If pod2man fails with errors, see Pod::Man and Pod::Simple for
177 information about what those errors might mean.
178
180 pod2man program > program.1
181 pod2man SomeModule.pm /usr/perl/man/man3/SomeModule.3
182 pod2man --section=7 note.pod > note.7
183
184 If you would like to print out a lot of man page continuously, you
185 probably want to set the C and D registers to set contiguous page
186 numbering and even/odd paging, at least on some versions of man(7).
187
188 troff -man -rC1 -rD1 perl.1 perldata.1 perlsyn.1 ...
189
190 To get index entries on "STDERR", turn on the F register, as in:
191
192 troff -man -rF1 perl.1
193
194 The indexing merely outputs messages via ".tm" for each major page,
195 section, subsection, item, and any "X<>" directives. See Pod::Man for
196 more details.
197
199 Lots of this documentation is duplicated from Pod::Man.
200
202 For those not sure of the proper layout of a man page, here are some
203 notes on writing a proper man page.
204
205 The name of the program being documented is conventionally written in
206 bold (using B<>) wherever it occurs, as are all program options.
207 Arguments should be written in italics (I<>). Functions are
208 traditionally written in italics; if you write a function as
209 function(), Pod::Man will take care of this for you. Literal code or
210 commands should be in C<>. References to other man pages should be in
211 the form "manpage(section)", and Pod::Man will automatically format
212 those appropriately. As an exception, it's traditional not to use this
213 form when referring to module documentation; use "L<Module::Name>"
214 instead.
215
216 References to other programs or functions are normally in the form of
217 man page references so that cross-referencing tools can provide the
218 user with links and the like. It's possible to overdo this, though, so
219 be careful not to clutter your documentation with too much markup.
220
221 The major headers should be set out using a "=head1" directive, and are
222 historically written in the rather startling ALL UPPER CASE format,
223 although this is not mandatory. Minor headers may be included using
224 "=head2", and are typically in mixed case.
225
226 The standard sections of a manual page are:
227
228 NAME
229 Mandatory section; should be a comma-separated list of programs or
230 functions documented by this POD page, such as:
231
232 foo, bar - programs to do something
233
234 Manual page indexers are often extremely picky about the format of
235 this section, so don't put anything in it except this line. A
236 single dash, and only a single dash, should separate the list of
237 programs or functions from the description. Functions should not
238 be qualified with "()" or the like. The description should ideally
239 fit on a single line, even if a man program replaces the dash with
240 a few tabs.
241
242 SYNOPSIS
243 A short usage summary for programs and functions. This section is
244 mandatory for section 3 pages.
245
246 DESCRIPTION
247 Extended description and discussion of the program or functions, or
248 the body of the documentation for man pages that document something
249 else. If particularly long, it's a good idea to break this up into
250 subsections "=head2" directives like:
251
252 =head2 Normal Usage
253
254 =head2 Advanced Features
255
256 =head2 Writing Configuration Files
257
258 or whatever is appropriate for your documentation.
259
260 OPTIONS
261 Detailed description of each of the command-line options taken by
262 the program. This should be separate from the description for the
263 use of things like Pod::Usage. This is normally presented as a
264 list, with each option as a separate "=item". The specific option
265 string should be enclosed in B<>. Any values that the option takes
266 should be enclosed in I<>. For example, the section for the option
267 --section=manext would be introduced with:
268
269 =item B<--section>=I<manext>
270
271 Synonymous options (like both the short and long forms) are
272 separated by a comma and a space on the same "=item" line, or
273 optionally listed as their own item with a reference to the
274 canonical name. For example, since --section can also be written
275 as -s, the above would be:
276
277 =item B<-s> I<manext>, B<--section>=I<manext>
278
279 (Writing the short option first is arguably easier to read, since
280 the long option is long enough to draw the eye to it anyway and the
281 short option can otherwise get lost in visual noise.)
282
283 RETURN VALUE
284 What the program or function returns, if successful. This section
285 can be omitted for programs whose precise exit codes aren't
286 important, provided they return 0 on success as is standard. It
287 should always be present for functions.
288
289 ERRORS
290 Exceptions, error return codes, exit statuses, and errno settings.
291 Typically used for function documentation; program documentation
292 uses DIAGNOSTICS instead. The general rule of thumb is that errors
293 printed to "STDOUT" or "STDERR" and intended for the end user are
294 documented in DIAGNOSTICS while errors passed internal to the
295 calling program and intended for other programmers are documented
296 in ERRORS. When documenting a function that sets errno, a full
297 list of the possible errno values should be given here.
298
299 DIAGNOSTICS
300 All possible messages the program can print out--and what they
301 mean. You may wish to follow the same documentation style as the
302 Perl documentation; see perldiag(1) for more details (and look at
303 the POD source as well).
304
305 If applicable, please include details on what the user should do to
306 correct the error; documenting an error as indicating "the input
307 buffer is too small" without telling the user how to increase the
308 size of the input buffer (or at least telling them that it isn't
309 possible) aren't very useful.
310
311 EXAMPLES
312 Give some example uses of the program or function. Don't skimp;
313 users often find this the most useful part of the documentation.
314 The examples are generally given as verbatim paragraphs.
315
316 Don't just present an example without explaining what it does.
317 Adding a short paragraph saying what the example will do can
318 increase the value of the example immensely.
319
320 ENVIRONMENT
321 Environment variables that the program cares about, normally
322 presented as a list using "=over", "=item", and "=back". For
323 example:
324
325 =over 6
326
327 =item HOME
328
329 Used to determine the user's home directory. F<.foorc> in this
330 directory is read for configuration details, if it exists.
331
332 =back
333
334 Since environment variables are normally in all uppercase, no
335 additional special formatting is generally needed; they're glaring
336 enough as it is.
337
338 FILES
339 All files used by the program or function, normally presented as a
340 list, and what it uses them for. File names should be enclosed in
341 F<>. It's particularly important to document files that will be
342 potentially modified.
343
344 CAVEATS
345 Things to take special care with, sometimes called WARNINGS.
346
347 BUGS
348 Things that are broken or just don't work quite right.
349
350 RESTRICTIONS
351 Bugs you don't plan to fix. :-)
352
353 NOTES
354 Miscellaneous commentary.
355
356 AUTHOR
357 Who wrote it (use AUTHORS for multiple people). Including your
358 current e-mail address (or some e-mail address to which bug reports
359 should be sent) so that users have a way of contacting you is a
360 good idea. Remember that program documentation tends to roam the
361 wild for far longer than you expect and pick an e-mail address
362 that's likely to last if possible.
363
364 HISTORY
365 Programs derived from other sources sometimes have this, or you
366 might keep a modification log here. If the log gets overly long or
367 detailed, consider maintaining it in a separate file, though.
368
369 COPYRIGHT AND LICENSE
370 For copyright
371
372 Copyright YEAR(s) by YOUR NAME(s)
373
374 (No, (C) is not needed. No, "all rights reserved" is not needed.)
375
376 For licensing the easiest way is to use the same licensing as Perl
377 itself:
378
379 This library is free software; you may redistribute it and/or modify
380 it under the same terms as Perl itself.
381
382 This makes it easy for people to use your module with Perl. Note
383 that this licensing is neither an endorsement or a requirement, you
384 are of course free to choose any licensing.
385
386 SEE ALSO
387 Other man pages to check out, like man(1), man(7), makewhatis(8),
388 or catman(8). Normally a simple list of man pages separated by
389 commas, or a paragraph giving the name of a reference work. Man
390 page references, if they use the standard "name(section)" form,
391 don't have to be enclosed in L<> (although it's recommended), but
392 other things in this section probably should be when appropriate.
393
394 If the package has a mailing list, include a URL or subscription
395 instructions here.
396
397 If the package has a web site, include a URL here.
398
399 In addition, some systems use CONFORMING TO to note conformance to
400 relevant standards and MT-LEVEL to note safeness for use in threaded
401 programs or signal handlers. These headings are primarily useful when
402 documenting parts of a C library. Documentation of object-oriented
403 libraries or modules may use CONSTRUCTORS and METHODS sections for
404 detailed documentation of the parts of the library and save the
405 DESCRIPTION section for an overview; other large modules may use
406 FUNCTIONS for similar reasons. Some people use OVERVIEW to summarize
407 the description if it's quite long.
408
409 Section ordering varies, although NAME should always be the first
410 section (you'll break some man page systems otherwise), and NAME,
411 SYNOPSIS, DESCRIPTION, and OPTIONS generally always occur first and in
412 that order if present. In general, SEE ALSO, AUTHOR, and similar
413 material should be left for last. Some systems also move WARNINGS and
414 NOTES to last. The order given above should be reasonable for most
415 purposes.
416
417 Finally, as a general note, try not to use an excessive amount of
418 markup. As documented here and in Pod::Man, you can safely leave Perl
419 variables, function names, man page references, and the like unadorned
420 by markup and the POD translators will figure it out for you. This
421 makes it much easier to later edit the documentation. Note that many
422 existing translators (including this one currently) will do the wrong
423 thing with e-mail addresses when wrapped in L<>, so don't do that.
424
425 For additional information that may be more accurate for your specific
426 system, see either man(5) or man(7) depending on your system manual
427 section numbering conventions.
428
430 Pod::Man, Pod::Simple, man(1), nroff(1), perlpod(1), podchecker(1),
431 troff(1), man(7)
432
433 The man page documenting the an macro set may be man(5) instead of
434 man(7) on your system.
435
436 The current version of this script is always available from its web
437 site at <http://www.eyrie.org/~eagle/software/podlators/>. It is also
438 part of the Perl core distribution as of 5.6.0.
439
441 Russ Allbery <rra@stanford.edu>, based very heavily on the original
442 pod2man by Larry Wall and Tom Christiansen. Large portions of this
443 documentation, particularly the sections on the anatomy of a proper man
444 page, are taken from the pod2man documentation by Tom.
445
447 Copyright 1999, 2000, 2001, 2004, 2006, 2008 Russ Allbery
448 <rra@stanford.edu>.
449
450 This program is free software; you may redistribute it and/or modify it
451 under the same terms as Perl itself.
452
453
454
455perl v5.10.1 2017-03-22 POD2MAN(1)