| 1 | .\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 |
| 2 | .\" |
| 3 | .\" Standard preamble: |
| 4 | .\" ======================================================================== |
| 5 | .de Sh \" Subsection heading |
| 6 | .br |
| 7 | .if t .Sp |
| 8 | .ne 5 |
| 9 | .PP |
| 10 | \fB\\$1\fR |
| 11 | .PP |
| 12 | .. |
| 13 | .de Sp \" Vertical space (when we can't use .PP) |
| 14 | .if t .sp .5v |
| 15 | .if n .sp |
| 16 | .. |
| 17 | .de Vb \" Begin verbatim text |
| 18 | .ft CW |
| 19 | .nf |
| 20 | .ne \\$1 |
| 21 | .. |
| 22 | .de Ve \" End verbatim text |
| 23 | .ft R |
| 24 | .fi |
| 25 | .. |
| 26 | .\" Set up some character translations and predefined strings. \*(-- will |
| 27 | .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left |
| 28 | .\" double quote, and \*(R" will give a right double quote. | will give a |
| 29 | .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to |
| 30 | .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' |
| 31 | .\" expand to `' in nroff, nothing in troff, for use with C<>. |
| 32 | .tr \(*W-|\(bv\*(Tr |
| 33 | .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' |
| 34 | .ie n \{\ |
| 35 | . ds -- \(*W- |
| 36 | . ds PI pi |
| 37 | . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch |
| 38 | . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch |
| 39 | . ds L" "" |
| 40 | . ds R" "" |
| 41 | . ds C` "" |
| 42 | . ds C' "" |
| 43 | 'br\} |
| 44 | .el\{\ |
| 45 | . ds -- \|\(em\| |
| 46 | . ds PI \(*p |
| 47 | . ds L" `` |
| 48 | . ds R" '' |
| 49 | 'br\} |
| 50 | .\" |
| 51 | .\" If the F register is turned on, we'll generate index entries on stderr for |
| 52 | .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index |
| 53 | .\" entries marked with X<> in POD. Of course, you'll have to process the |
| 54 | .\" output yourself in some meaningful fashion. |
| 55 | .if \nF \{\ |
| 56 | . de IX |
| 57 | . tm Index:\\$1\t\\n%\t"\\$2" |
| 58 | .. |
| 59 | . nr % 0 |
| 60 | . rr F |
| 61 | .\} |
| 62 | .\" |
| 63 | .\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 64 | .\" way too many mistakes in technical documents. |
| 65 | .hy 0 |
| 66 | .if n .na |
| 67 | .\" |
| 68 | .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). |
| 69 | .\" Fear. Run. Save yourself. No user-serviceable parts. |
| 70 | . \" fudge factors for nroff and troff |
| 71 | .if n \{\ |
| 72 | . ds #H 0 |
| 73 | . ds #V .8m |
| 74 | . ds #F .3m |
| 75 | . ds #[ \f1 |
| 76 | . ds #] \fP |
| 77 | .\} |
| 78 | .if t \{\ |
| 79 | . ds #H ((1u-(\\\\n(.fu%2u))*.13m) |
| 80 | . ds #V .6m |
| 81 | . ds #F 0 |
| 82 | . ds #[ \& |
| 83 | . ds #] \& |
| 84 | .\} |
| 85 | . \" simple accents for nroff and troff |
| 86 | .if n \{\ |
| 87 | . ds ' \& |
| 88 | . ds ` \& |
| 89 | . ds ^ \& |
| 90 | . ds , \& |
| 91 | . ds ~ ~ |
| 92 | . ds / |
| 93 | .\} |
| 94 | .if t \{\ |
| 95 | . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" |
| 96 | . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' |
| 97 | . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' |
| 98 | . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' |
| 99 | . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' |
| 100 | . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' |
| 101 | .\} |
| 102 | . \" troff and (daisy-wheel) nroff accents |
| 103 | .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' |
| 104 | .ds 8 \h'\*(#H'\(*b\h'-\*(#H' |
| 105 | .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] |
| 106 | .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' |
| 107 | .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' |
| 108 | .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] |
| 109 | .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] |
| 110 | .ds ae a\h'-(\w'a'u*4/10)'e |
| 111 | .ds Ae A\h'-(\w'A'u*4/10)'E |
| 112 | . \" corrections for vroff |
| 113 | .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' |
| 114 | .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' |
| 115 | . \" for low resolution devices (crt and lpr) |
| 116 | .if \n(.H>23 .if \n(.V>19 \ |
| 117 | \{\ |
| 118 | . ds : e |
| 119 | . ds 8 ss |
| 120 | . ds o a |
| 121 | . ds d- d\h'-1'\(ga |
| 122 | . ds D- D\h'-1'\(hy |
| 123 | . ds th \o'bp' |
| 124 | . ds Th \o'LP' |
| 125 | . ds ae ae |
| 126 | . ds Ae AE |
| 127 | .\} |
| 128 | .rm #[ #] #H #V #F C |
| 129 | .\" ======================================================================== |
| 130 | .\" |
| 131 | .IX Title "POD2MAN 1" |
| 132 | .TH POD2MAN 1 "2002-08-28" "perl v5.8.0" "Perl Programmers Reference Guide" |
| 133 | .SH "NAME" |
| 134 | pod2man \- Convert POD data to formatted *roff input |
| 135 | .SH "SYNOPSIS" |
| 136 | .IX Header "SYNOPSIS" |
| 137 | pod2man [\fB\-\-section\fR=\fImanext\fR] [\fB\-\-release\fR=\fIversion\fR] |
| 138 | [\fB\-\-center\fR=\fIstring\fR] [\fB\-\-date\fR=\fIstring\fR] [\fB\-\-fixed\fR=\fIfont\fR] |
| 139 | [\fB\-\-fixedbold\fR=\fIfont\fR] [\fB\-\-fixeditalic\fR=\fIfont\fR] |
| 140 | [\fB\-\-fixedbolditalic\fR=\fIfont\fR] [\fB\-\-name\fR=\fIname\fR] [\fB\-\-official\fR] |
| 141 | [\fB\-\-lax\fR] [\fB\-\-quotes\fR=\fIquotes\fR] [\fB\-\-verbose\fR] |
| 142 | [\fIinput\fR [\fIoutput\fR] ...] |
| 143 | .PP |
| 144 | pod2man \fB\-\-help\fR |
| 145 | .SH "DESCRIPTION" |
| 146 | .IX Header "DESCRIPTION" |
| 147 | \&\fBpod2man\fR is a front-end for Pod::Man, using it to generate *roff input |
| 148 | from \s-1POD\s0 source. The resulting *roff code is suitable for display on a |
| 149 | terminal using \fInroff\fR\|(1), normally via \fIman\fR\|(1), or printing using \fItroff\fR\|(1). |
| 150 | .PP |
| 151 | \&\fIinput\fR is the file to read for \s-1POD\s0 source (the \s-1POD\s0 can be embedded in |
| 152 | code). If \fIinput\fR isn't given, it defaults to \s-1STDIN\s0. \fIoutput\fR, if given, |
| 153 | is the file to which to write the formatted output. If \fIoutput\fR isn't |
| 154 | given, the formatted output is written to \s-1STDOUT\s0. Several \s-1POD\s0 files can be |
| 155 | processed in the same \fBpod2man\fR invocation (saving module load and compile |
| 156 | times) by providing multiple pairs of \fIinput\fR and \fIoutput\fR files on the |
| 157 | command line. |
| 158 | .PP |
| 159 | \&\fB\-\-section\fR, \fB\-\-release\fR, \fB\-\-center\fR, \fB\-\-date\fR, and \fB\-\-official\fR can be |
| 160 | used to set the headers and footers to use; if not given, Pod::Man will |
| 161 | assume various defaults. See below or Pod::Man for details. |
| 162 | .PP |
| 163 | \&\fBpod2man\fR assumes that your *roff formatters have a fixed-width font named |
| 164 | \&\s-1CW\s0. If yours is called something else (like \s-1CR\s0), use \fB\-\-fixed\fR to specify |
| 165 | it. This generally only matters for troff output for printing. Similarly, |
| 166 | you can set the fonts used for bold, italic, and bold italic fixed-width |
| 167 | output. |
| 168 | .PP |
| 169 | Besides the obvious pod conversions, Pod::Man, and therefore pod2man also |
| 170 | takes care of formatting \fIfunc()\fR, func(n), and simple variable references |
| 171 | like \f(CW$foo\fR or \f(CW@bar\fR so you don't have to use code escapes for them; complex |
| 172 | expressions like \f(CW$fred{'stuff'}\fR will still need to be escaped, though. |
| 173 | It also translates dashes that aren't used as hyphens into en dashes, makes |
| 174 | long dashes\*(--like this\*(--into proper em dashes, fixes \*(L"paired quotes,\*(R" and |
| 175 | takes care of several other troff-specific tweaks. See Pod::Man for |
| 176 | complete information. |
| 177 | .SH "OPTIONS" |
| 178 | .IX Header "OPTIONS" |
| 179 | .IP "\fB\-c\fR \fIstring\fR, \fB\-\-center\fR=\fIstring\fR" 4 |
| 180 | .IX Item "-c string, --center=string" |
| 181 | Sets the centered page header to \fIstring\fR. The default is \*(L"User |
| 182 | Contributed Perl Documentation\*(R", but also see \fB\-\-official\fR below. |
| 183 | .IP "\fB\-d\fR \fIstring\fR, \fB\-\-date\fR=\fIstring\fR" 4 |
| 184 | .IX Item "-d string, --date=string" |
| 185 | Set the left-hand footer string to this value. By default, the modification |
| 186 | date of the input file will be used, or the current date if input comes from |
| 187 | \&\s-1STDIN\s0. |
| 188 | .IP "\fB\-\-fixed\fR=\fIfont\fR" 4 |
| 189 | .IX Item "--fixed=font" |
| 190 | The fixed-width font to use for vertabim text and code. Defaults to \s-1CW\s0. |
| 191 | Some systems may want \s-1CR\s0 instead. Only matters for \fItroff\fR\|(1) output. |
| 192 | .IP "\fB\-\-fixedbold\fR=\fIfont\fR" 4 |
| 193 | .IX Item "--fixedbold=font" |
| 194 | Bold version of the fixed-width font. Defaults to \s-1CB\s0. Only matters for |
| 195 | \&\fItroff\fR\|(1) output. |
| 196 | .IP "\fB\-\-fixeditalic\fR=\fIfont\fR" 4 |
| 197 | .IX Item "--fixeditalic=font" |
| 198 | Italic version of the fixed-width font (actually, something of a misnomer, |
| 199 | since most fixed-width fonts only have an oblique version, not an italic |
| 200 | version). Defaults to \s-1CI\s0. Only matters for \fItroff\fR\|(1) output. |
| 201 | .IP "\fB\-\-fixedbolditalic\fR=\fIfont\fR" 4 |
| 202 | .IX Item "--fixedbolditalic=font" |
| 203 | Bold italic (probably actually oblique) version of the fixed-width font. |
| 204 | Pod::Man doesn't assume you have this, and defaults to \s-1CB\s0. Some systems |
| 205 | (such as Solaris) have this font available as \s-1CX\s0. Only matters for \fItroff\fR\|(1) |
| 206 | output. |
| 207 | .IP "\fB\-h\fR, \fB\-\-help\fR" 4 |
| 208 | .IX Item "-h, --help" |
| 209 | Print out usage information. |
| 210 | .IP "\fB\-l\fR, \fB\-\-lax\fR" 4 |
| 211 | .IX Item "-l, --lax" |
| 212 | No longer used. \fBpod2man\fR used to check its input for validity as a manual |
| 213 | page, but this should now be done by \fIpodchecker\fR\|(1) instead. Accepted for |
| 214 | backwards compatibility; this option no longer does anything. |
| 215 | .IP "\fB\-n\fR \fIname\fR, \fB\-\-name\fR=\fIname\fR" 4 |
| 216 | .IX Item "-n name, --name=name" |
| 217 | Set the name of the manual page to \fIname\fR. Without this option, the manual |
| 218 | name is set to the uppercased base name of the file being converted unless |
| 219 | the manual section is 3, in which case the path is parsed to see if it is a |
| 220 | Perl module path. If it is, a path like \f(CW\*(C`.../lib/Pod/Man.pm\*(C'\fR is converted |
| 221 | into a name like \f(CW\*(C`Pod::Man\*(C'\fR. This option, if given, overrides any |
| 222 | automatic determination of the name. |
| 223 | .Sp |
| 224 | Note that this option is probably not useful when converting multiple \s-1POD\s0 |
| 225 | files at once. The convention for Unix man pages for commands is for the |
| 226 | man page title to be in all-uppercase even if the command isn't. |
| 227 | .IP "\fB\-o\fR, \fB\-\-official\fR" 4 |
| 228 | .IX Item "-o, --official" |
| 229 | Set the default header to indicate that this page is part of the standard |
| 230 | Perl release, if \fB\-\-center\fR is not also given. |
| 231 | .IP "\fB\-q\fR \fIquotes\fR, \fB\-\-quotes\fR=\fIquotes\fR" 4 |
| 232 | .IX Item "-q quotes, --quotes=quotes" |
| 233 | Sets the quote marks used to surround C<> text to \fIquotes\fR. If |
| 234 | \&\fIquotes\fR is a single character, it is used as both the left and right |
| 235 | quote; if \fIquotes\fR is two characters, the first character is used as the |
| 236 | left quote and the second as the right quoted; and if \fIquotes\fR is four |
| 237 | characters, the first two are used as the left quote and the second two as |
| 238 | the right quote. |
| 239 | .Sp |
| 240 | \&\fIquotes\fR may also be set to the special value \f(CW\*(C`none\*(C'\fR, in which case no |
| 241 | quote marks are added around C<> text (but the font is still changed for |
| 242 | troff output). |
| 243 | .IP "\fB\-r\fR, \fB\-\-release\fR" 4 |
| 244 | .IX Item "-r, --release" |
| 245 | Set the centered footer. By default, this is the version of Perl you run |
| 246 | \&\fBpod2man\fR under. Note that some system an macro sets assume that the |
| 247 | centered footer will be a modification date and will prepend something like |
| 248 | \&\*(L"Last modified: \*(R"; if this is the case, you may want to set \fB\-\-release\fR to |
| 249 | the last modified date and \fB\-\-date\fR to the version number. |
| 250 | .IP "\fB\-s\fR, \fB\-\-section\fR" 4 |
| 251 | .IX Item "-s, --section" |
| 252 | Set the section for the \f(CW\*(C`.TH\*(C'\fR macro. The standard section numbering |
| 253 | convention is to use 1 for user commands, 2 for system calls, 3 for |
| 254 | functions, 4 for devices, 5 for file formats, 6 for games, 7 for |
| 255 | miscellaneous information, and 8 for administrator commands. There is a lot |
| 256 | of variation here, however; some systems (like Solaris) use 4 for file |
| 257 | formats, 5 for miscellaneous information, and 7 for devices. Still others |
| 258 | use 1m instead of 8, or some mix of both. About the only section numbers |
| 259 | that are reliably consistent are 1, 2, and 3. |
| 260 | .Sp |
| 261 | By default, section 1 will be used unless the file ends in .pm in which case |
| 262 | section 3 will be selected. |
| 263 | .IP "\fB\-v\fR, \fB\-\-verbose\fR" 4 |
| 264 | .IX Item "-v, --verbose" |
| 265 | Print out the name of each output file as it is being generated. |
| 266 | .SH "DIAGNOSTICS" |
| 267 | .IX Header "DIAGNOSTICS" |
| 268 | If \fBpod2man\fR fails with errors, see Pod::Man and Pod::Parser for |
| 269 | information about what those errors might mean. |
| 270 | .SH "EXAMPLES" |
| 271 | .IX Header "EXAMPLES" |
| 272 | .Vb 3 |
| 273 | \& pod2man program > program.1 |
| 274 | \& pod2man SomeModule.pm /usr/perl/man/man3/SomeModule.3 |
| 275 | \& pod2man --section=7 note.pod > note.7 |
| 276 | .Ve |
| 277 | .PP |
| 278 | If you would like to print out a lot of man page continuously, you probably |
| 279 | want to set the C and D registers to set contiguous page numbering and |
| 280 | even/odd paging, at least on some versions of \fIman\fR\|(7). |
| 281 | .PP |
| 282 | .Vb 1 |
| 283 | \& troff -man -rC1 -rD1 perl.1 perldata.1 perlsyn.1 ... |
| 284 | .Ve |
| 285 | .PP |
| 286 | To get index entries on stderr, turn on the F register, as in: |
| 287 | .PP |
| 288 | .Vb 1 |
| 289 | \& troff -man -rF1 perl.1 |
| 290 | .Ve |
| 291 | .PP |
| 292 | The indexing merely outputs messages via \f(CW\*(C`.tm\*(C'\fR for each major page, |
| 293 | section, subsection, item, and any \f(CW\*(C`X<>\*(C'\fR directives. See |
| 294 | Pod::Man for more details. |
| 295 | .SH "BUGS" |
| 296 | .IX Header "BUGS" |
| 297 | Lots of this documentation is duplicated from Pod::Man. |
| 298 | .SH "NOTES" |
| 299 | .IX Header "NOTES" |
| 300 | For those not sure of the proper layout of a man page, here are some notes |
| 301 | on writing a proper man page. |
| 302 | .PP |
| 303 | The name of the program being documented is conventionally written in bold |
| 304 | (using B<>) wherever it occurs, as are all program options. |
| 305 | Arguments should be written in italics (I<>). Functions are |
| 306 | traditionally written in italics; if you write a function as \fIfunction()\fR, |
| 307 | Pod::Man will take care of this for you. Literal code or commands should |
| 308 | be in C<>. References to other man pages should be in the form |
| 309 | \&\f(CW\*(C`manpage(section)\*(C'\fR, and Pod::Man will automatically format those |
| 310 | appropriately. As an exception, it's traditional not to use this form when |
| 311 | referring to module documentation; use \f(CW\*(C`L<Module::Name>\*(C'\fR instead. |
| 312 | .PP |
| 313 | References to other programs or functions are normally in the form of man |
| 314 | page references so that cross-referencing tools can provide the user with |
| 315 | links and the like. It's possible to overdo this, though, so be careful not |
| 316 | to clutter your documentation with too much markup. |
| 317 | .PP |
| 318 | The major headers should be set out using a \f(CW\*(C`=head1\*(C'\fR directive, and are |
| 319 | historically written in the rather startling \s-1ALL\s0 \s-1UPPER\s0 \s-1CASE\s0 format, although |
| 320 | this is not mandatory. Minor headers may be included using \f(CW\*(C`=head2\*(C'\fR, and |
| 321 | are typically in mixed case. |
| 322 | .PP |
| 323 | The standard sections of a manual page are: |
| 324 | .IP "\s-1NAME\s0" 4 |
| 325 | .IX Item "NAME" |
| 326 | Mandatory section; should be a comma-separated list of programs or functions |
| 327 | documented by this podpage, such as: |
| 328 | .Sp |
| 329 | .Vb 1 |
| 330 | \& foo, bar - programs to do something |
| 331 | .Ve |
| 332 | .Sp |
| 333 | Manual page indexers are often extremely picky about the format of this |
| 334 | section, so don't put anything in it except this line. A single dash, and |
| 335 | only a single dash, should separate the list of programs or functions from |
| 336 | the description. Functions should not be qualified with \f(CW\*(C`()\*(C'\fR or the like. |
| 337 | The description should ideally fit on a single line, even if a man program |
| 338 | replaces the dash with a few tabs. |
| 339 | .IP "\s-1SYNOPSIS\s0" 4 |
| 340 | .IX Item "SYNOPSIS" |
| 341 | A short usage summary for programs and functions. This section is mandatory |
| 342 | for section 3 pages. |
| 343 | .IP "\s-1DESCRIPTION\s0" 4 |
| 344 | .IX Item "DESCRIPTION" |
| 345 | Extended description and discussion of the program or functions, or the body |
| 346 | of the documentation for man pages that document something else. If |
| 347 | particularly long, it's a good idea to break this up into subsections |
| 348 | \&\f(CW\*(C`=head2\*(C'\fR directives like: |
| 349 | .Sp |
| 350 | .Vb 1 |
| 351 | \& =head2 Normal Usage |
| 352 | .Ve |
| 353 | .Sp |
| 354 | .Vb 1 |
| 355 | \& =head2 Advanced Features |
| 356 | .Ve |
| 357 | .Sp |
| 358 | .Vb 1 |
| 359 | \& =head2 Writing Configuration Files |
| 360 | .Ve |
| 361 | .Sp |
| 362 | or whatever is appropriate for your documentation. |
| 363 | .IP "\s-1OPTIONS\s0" 4 |
| 364 | .IX Item "OPTIONS" |
| 365 | Detailed description of each of the command-line options taken by the |
| 366 | program. This should be separate from the description for the use of things |
| 367 | like Pod::Usage. This is normally presented as a list, with |
| 368 | each option as a separate \f(CW\*(C`=item\*(C'\fR. The specific option string should be |
| 369 | enclosed in B<>. Any values that the option takes should be |
| 370 | enclosed in I<>. For example, the section for the option |
| 371 | \&\fB\-\-section\fR=\fImanext\fR would be introduced with: |
| 372 | .Sp |
| 373 | .Vb 1 |
| 374 | \& =item B<--section>=I<manext> |
| 375 | .Ve |
| 376 | .Sp |
| 377 | Synonymous options (like both the short and long forms) are separated by a |
| 378 | comma and a space on the same \f(CW\*(C`=item\*(C'\fR line, or optionally listed as their |
| 379 | own item with a reference to the canonical name. For example, since |
| 380 | \&\fB\-\-section\fR can also be written as \fB\-s\fR, the above would be: |
| 381 | .Sp |
| 382 | .Vb 1 |
| 383 | \& =item B<-s> I<manext>, B<--section>=I<manext> |
| 384 | .Ve |
| 385 | .Sp |
| 386 | (Writing the short option first is arguably easier to read, since the long |
| 387 | option is long enough to draw the eye to it anyway and the short option can |
| 388 | otherwise get lost in visual noise.) |
| 389 | .IP "\s-1RETURN\s0 \s-1VALUE\s0" 4 |
| 390 | .IX Item "RETURN VALUE" |
| 391 | What the program or function returns, if successful. This section can be |
| 392 | omitted for programs whose precise exit codes aren't important, provided |
| 393 | they return 0 on success as is standard. It should always be present for |
| 394 | functions. |
| 395 | .IP "\s-1ERRORS\s0" 4 |
| 396 | .IX Item "ERRORS" |
| 397 | Exceptions, error return codes, exit statuses, and errno settings. |
| 398 | Typically used for function documentation; program documentation uses |
| 399 | \&\s-1DIAGNOSTICS\s0 instead. The general rule of thumb is that errors printed to |
| 400 | \&\s-1STDOUT\s0 or \s-1STDERR\s0 and intended for the end user are documented in \s-1DIAGNOSTICS\s0 |
| 401 | while errors passed internal to the calling program and intended for other |
| 402 | programmers are documented in \s-1ERRORS\s0. When documenting a function that sets |
| 403 | errno, a full list of the possible errno values should be given here. |
| 404 | .IP "\s-1DIAGNOSTICS\s0" 4 |
| 405 | .IX Item "DIAGNOSTICS" |
| 406 | All possible messages the program can print out\*(--and what they mean. You |
| 407 | may wish to follow the same documentation style as the Perl documentation; |
| 408 | see \fIperldiag\fR\|(1) for more details (and look at the \s-1POD\s0 source as well). |
| 409 | .Sp |
| 410 | If applicable, please include details on what the user should do to correct |
| 411 | the error; documenting an error as indicating \*(L"the input buffer is too |
| 412 | small\*(R" without telling the user how to increase the size of the input buffer |
| 413 | (or at least telling them that it isn't possible) aren't very useful. |
| 414 | .IP "\s-1EXAMPLES\s0" 4 |
| 415 | .IX Item "EXAMPLES" |
| 416 | Give some example uses of the program or function. Don't skimp; users often |
| 417 | find this the most useful part of the documentation. The examples are |
| 418 | generally given as verbatim paragraphs. |
| 419 | .Sp |
| 420 | Don't just present an example without explaining what it does. Adding a |
| 421 | short paragraph saying what the example will do can increase the value of |
| 422 | the example immensely. |
| 423 | .IP "\s-1ENVIRONMENT\s0" 4 |
| 424 | .IX Item "ENVIRONMENT" |
| 425 | Environment variables that the program cares about, normally presented as a |
| 426 | list using \f(CW\*(C`=over\*(C'\fR, \f(CW\*(C`=item\*(C'\fR, and \f(CW\*(C`=back\*(C'\fR. For example: |
| 427 | .Sp |
| 428 | .Vb 1 |
| 429 | \& =over 6 |
| 430 | .Ve |
| 431 | .Sp |
| 432 | .Vb 1 |
| 433 | \& =item HOME |
| 434 | .Ve |
| 435 | .Sp |
| 436 | .Vb 2 |
| 437 | \& Used to determine the user's home directory. F<.foorc> in this |
| 438 | \& directory is read for configuration details, if it exists. |
| 439 | .Ve |
| 440 | .Sp |
| 441 | .Vb 1 |
| 442 | \& =back |
| 443 | .Ve |
| 444 | .Sp |
| 445 | Since environment variables are normally in all uppercase, no additional |
| 446 | special formatting is generally needed; they're glaring enough as it is. |
| 447 | .IP "\s-1FILES\s0" 4 |
| 448 | .IX Item "FILES" |
| 449 | All files used by the program or function, normally presented as a list, and |
| 450 | what it uses them for. File names should be enclosed in F<>. It's |
| 451 | particularly important to document files that will be potentially modified. |
| 452 | .IP "\s-1CAVEATS\s0" 4 |
| 453 | .IX Item "CAVEATS" |
| 454 | Things to take special care with, sometimes called \s-1WARNINGS\s0. |
| 455 | .IP "\s-1BUGS\s0" 4 |
| 456 | .IX Item "BUGS" |
| 457 | Things that are broken or just don't work quite right. |
| 458 | .IP "\s-1RESTRICTIONS\s0" 4 |
| 459 | .IX Item "RESTRICTIONS" |
| 460 | Bugs you don't plan to fix. :\-) |
| 461 | .IP "\s-1NOTES\s0" 4 |
| 462 | .IX Item "NOTES" |
| 463 | Miscellaneous commentary. |
| 464 | .IP "\s-1SEE\s0 \s-1ALSO\s0" 4 |
| 465 | .IX Item "SEE ALSO" |
| 466 | Other man pages to check out, like \fIman\fR\|(1), \fIman\fR\|(7), \fImakewhatis\fR\|(8), or |
| 467 | \&\fIcatman\fR\|(8). Normally a simple list of man pages separated by commas, or a |
| 468 | paragraph giving the name of a reference work. Man page references, if they |
| 469 | use the standard \f(CW\*(C`name(section)\*(C'\fR form, don't have to be enclosed in |
| 470 | L<> (although it's recommended), but other things in this section |
| 471 | probably should be when appropriate. |
| 472 | .Sp |
| 473 | If the package has a mailing list, include a \s-1URL\s0 or subscription |
| 474 | instructions here. |
| 475 | .Sp |
| 476 | If the package has a web site, include a \s-1URL\s0 here. |
| 477 | .IP "\s-1AUTHOR\s0" 4 |
| 478 | .IX Item "AUTHOR" |
| 479 | Who wrote it (use \s-1AUTHORS\s0 for multiple people). Including your current |
| 480 | e\-mail address (or some e\-mail address to which bug reports should be sent) |
| 481 | so that users have a way of contacting you is a good idea. Remember that |
| 482 | program documentation tends to roam the wild for far longer than you expect |
| 483 | and pick an e\-mail address that's likely to last if possible. |
| 484 | .IP "\s-1COPYRIGHT\s0 \s-1AND\s0 \s-1LICENSE\s0" 4 |
| 485 | .IX Item "COPYRIGHT AND LICENSE" |
| 486 | For copyright |
| 487 | .Sp |
| 488 | .Vb 1 |
| 489 | \& Copyright YEAR(s) by YOUR NAME(s) |
| 490 | .Ve |
| 491 | .Sp |
| 492 | (No, (C) is not needed. No, \*(L"all rights reserved\*(R" is not needed.) |
| 493 | .Sp |
| 494 | For licensing the easiest way is to use the same licensing as Perl itself: |
| 495 | .Sp |
| 496 | .Vb 2 |
| 497 | \& This library is free software; you may redistribute it and/or modify |
| 498 | \& it under the same terms as Perl itself. |
| 499 | .Ve |
| 500 | .Sp |
| 501 | This makes it easy for people to use your module with Perl. Note that |
| 502 | this licensing is neither an endorsement or a requirement, you are of |
| 503 | course free to choose any licensing. |
| 504 | .IP "\s-1HISTORY\s0" 4 |
| 505 | .IX Item "HISTORY" |
| 506 | Programs derived from other sources sometimes have this, or you might keep |
| 507 | a modification log here. If the log gets overly long or detailed, |
| 508 | consider maintaining it in a separate file, though. |
| 509 | .PP |
| 510 | In addition, some systems use \s-1CONFORMING\s0 \s-1TO\s0 to note conformance to relevant |
| 511 | standards and MT-LEVEL to note safeness for use in threaded programs or |
| 512 | signal handlers. These headings are primarily useful when documenting parts |
| 513 | of a C library. Documentation of object-oriented libraries or modules may |
| 514 | use \s-1CONSTRUCTORS\s0 and \s-1METHODS\s0 sections for detailed documentation of the |
| 515 | parts of the library and save the \s-1DESCRIPTION\s0 section for an overview; other |
| 516 | large modules may use \s-1FUNCTIONS\s0 for similar reasons. Some people use |
| 517 | \&\s-1OVERVIEW\s0 to summarize the description if it's quite long. |
| 518 | .PP |
| 519 | Section ordering varies, although \s-1NAME\s0 should \fIalways\fR be the first section |
| 520 | (you'll break some man page systems otherwise), and \s-1NAME\s0, \s-1SYNOPSIS\s0, |
| 521 | \&\s-1DESCRIPTION\s0, and \s-1OPTIONS\s0 generally always occur first and in that order if |
| 522 | present. In general, \s-1SEE\s0 \s-1ALSO\s0, \s-1AUTHOR\s0, and similar material should be left |
| 523 | for last. Some systems also move \s-1WARNINGS\s0 and \s-1NOTES\s0 to last. The order |
| 524 | given above should be reasonable for most purposes. |
| 525 | .PP |
| 526 | Finally, as a general note, try not to use an excessive amount of markup. |
| 527 | As documented here and in Pod::Man, you can safely leave Perl variables, |
| 528 | function names, man page references, and the like unadorned by markup and |
| 529 | the \s-1POD\s0 translators will figure it out for you. This makes it much easier |
| 530 | to later edit the documentation. Note that many existing translators |
| 531 | (including this one currently) will do the wrong thing with e\-mail addresses |
| 532 | or URLs when wrapped in L<>, so don't do that. |
| 533 | .PP |
| 534 | For additional information that may be more accurate for your specific |
| 535 | system, see either \fIman\fR\|(5) or \fIman\fR\|(7) depending on your system manual |
| 536 | section numbering conventions. |
| 537 | .SH "SEE ALSO" |
| 538 | .IX Header "SEE ALSO" |
| 539 | Pod::Man, Pod::Parser, \fIman\fR\|(1), \fInroff\fR\|(1), \fIpodchecker\fR\|(1), |
| 540 | \&\fItroff\fR\|(1), \fIman\fR\|(7) |
| 541 | .PP |
| 542 | The man page documenting the an macro set may be \fIman\fR\|(5) instead of |
| 543 | \&\fIman\fR\|(7) on your system. |
| 544 | .PP |
| 545 | The current version of this script is always available from its web site at |
| 546 | <http://www.eyrie.org/~eagle/software/podlators/>. It is also part of the |
| 547 | Perl core distribution as of 5.6.0. |
| 548 | .SH "AUTHOR" |
| 549 | .IX Header "AUTHOR" |
| 550 | Russ Allbery <rra@stanford.edu>, based \fIvery\fR heavily on the original |
| 551 | \&\fBpod2man\fR by Larry Wall and Tom Christiansen. Large portions of this |
| 552 | documentation, particularly the sections on the anatomy of a proper man |
| 553 | page, are taken from the \fBpod2man\fR documentation by Tom. |
| 554 | .SH "COPYRIGHT AND LICENSE" |
| 555 | .IX Header "COPYRIGHT AND LICENSE" |
| 556 | Copyright 1999, 2000, 2001 by Russ Allbery <rra@stanford.edu>. |
| 557 | .PP |
| 558 | This program is free software; you may redistribute it and/or modify it |
| 559 | under the same terms as Perl itself. |