Commit | Line | Data |
---|---|---|
86530b38 AT |
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 "Pod::Man 3" | |
132 | .TH Pod::Man 3 "2002-06-01" "perl v5.8.0" "Perl Programmers Reference Guide" | |
133 | .SH "NAME" | |
134 | Pod::Man \- Convert POD data to formatted *roff input | |
135 | .SH "SYNOPSIS" | |
136 | .IX Header "SYNOPSIS" | |
137 | .Vb 2 | |
138 | \& use Pod::Man; | |
139 | \& my $parser = Pod::Man->new (release => $VERSION, section => 8); | |
140 | .Ve | |
141 | .PP | |
142 | .Vb 2 | |
143 | \& # Read POD from STDIN and write to STDOUT. | |
144 | \& $parser->parse_from_filehandle; | |
145 | .Ve | |
146 | .PP | |
147 | .Vb 2 | |
148 | \& # Read POD from file.pod and write to file.1. | |
149 | \& $parser->parse_from_file ('file.pod', 'file.1'); | |
150 | .Ve | |
151 | .SH "DESCRIPTION" | |
152 | .IX Header "DESCRIPTION" | |
153 | Pod::Man is a module to convert documentation in the \s-1POD\s0 format (the | |
154 | preferred language for documenting Perl) into *roff input using the man | |
155 | macro set. The resulting *roff code is suitable for display on a terminal | |
156 | using \fInroff\fR\|(1), normally via \fIman\fR\|(1), or printing using \fItroff\fR\|(1). | |
157 | It is conventionally invoked using the driver script \fBpod2man\fR, but it can | |
158 | also be used directly. | |
159 | .PP | |
160 | As a derived class from Pod::Parser, Pod::Man supports the same methods and | |
161 | interfaces. See Pod::Parser for all the details; briefly, one creates a | |
162 | new parser with \f(CW\*(C`Pod::Man\->new()\*(C'\fR and then calls either | |
163 | \&\fIparse_from_filehandle()\fR or \fIparse_from_file()\fR. | |
164 | .PP | |
165 | \&\fInew()\fR can take options, in the form of key/value pairs that control the | |
166 | behavior of the parser. See below for details. | |
167 | .PP | |
168 | If no options are given, Pod::Man uses the name of the input file with any | |
169 | trailing \f(CW\*(C`.pod\*(C'\fR, \f(CW\*(C`.pm\*(C'\fR, or \f(CW\*(C`.pl\*(C'\fR stripped as the man page title, to | |
170 | section 1 unless the file ended in \f(CW\*(C`.pm\*(C'\fR in which case it defaults to | |
171 | section 3, to a centered title of \*(L"User Contributed Perl Documentation\*(R", to | |
172 | a centered footer of the Perl version it is run with, and to a left-hand | |
173 | footer of the modification date of its input (or the current date if given | |
174 | \&\s-1STDIN\s0 for input). | |
175 | .PP | |
176 | Pod::Man assumes that your *roff formatters have a fixed-width font named | |
177 | \&\s-1CW\s0. If yours is called something else (like \s-1CR\s0), use the \f(CW\*(C`fixed\*(C'\fR option to | |
178 | specify it. This generally only matters for troff output for printing. | |
179 | Similarly, you can set the fonts used for bold, italic, and bold italic | |
180 | fixed-width output. | |
181 | .PP | |
182 | Besides the obvious pod conversions, Pod::Man also takes care of formatting | |
183 | \&\fIfunc()\fR, \fIfunc\fR\|(3), and simple variable references like \f(CW$foo\fR or \f(CW@bar\fR so you | |
184 | don't have to use code escapes for them; complex expressions like | |
185 | \&\f(CW$fred{'stuff'}\fR will still need to be escaped, though. It also translates | |
186 | dashes that aren't used as hyphens into en dashes, makes long dashes\*(--like | |
187 | this\*(--into proper em dashes, fixes \*(L"paired quotes,\*(R" makes \*(C+ look right, | |
188 | puts a little space between double underbars, makes \s-1ALLCAPS\s0 a teeny bit | |
189 | smaller in \fBtroff\fR, and escapes stuff that *roff treats as special so that | |
190 | you don't have to. | |
191 | .PP | |
192 | The recognized options to \fInew()\fR are as follows. All options take a single | |
193 | argument. | |
194 | .IP "center" 4 | |
195 | .IX Item "center" | |
196 | Sets the centered page header to use instead of \*(L"User Contributed Perl | |
197 | Documentation\*(R". | |
198 | .IP "date" 4 | |
199 | .IX Item "date" | |
200 | Sets the left-hand footer. By default, the modification date of the input | |
201 | file will be used, or the current date if \fIstat()\fR can't find that file (the | |
202 | case if the input is from \s-1STDIN\s0), and the date will be formatted as | |
203 | \&\s-1YYYY\-MM\-DD\s0. | |
204 | .IP "fixed" 4 | |
205 | .IX Item "fixed" | |
206 | The fixed-width font to use for vertabim text and code. Defaults to \s-1CW\s0. | |
207 | Some systems may want \s-1CR\s0 instead. Only matters for \fBtroff\fR output. | |
208 | .IP "fixedbold" 4 | |
209 | .IX Item "fixedbold" | |
210 | Bold version of the fixed-width font. Defaults to \s-1CB\s0. Only matters for | |
211 | \&\fBtroff\fR output. | |
212 | .IP "fixeditalic" 4 | |
213 | .IX Item "fixeditalic" | |
214 | Italic version of the fixed-width font (actually, something of a misnomer, | |
215 | since most fixed-width fonts only have an oblique version, not an italic | |
216 | version). Defaults to \s-1CI\s0. Only matters for \fBtroff\fR output. | |
217 | .IP "fixedbolditalic" 4 | |
218 | .IX Item "fixedbolditalic" | |
219 | Bold italic (probably actually oblique) version of the fixed-width font. | |
220 | Pod::Man doesn't assume you have this, and defaults to \s-1CB\s0. Some systems | |
221 | (such as Solaris) have this font available as \s-1CX\s0. Only matters for \fBtroff\fR | |
222 | output. | |
223 | .IP "name" 4 | |
224 | .IX Item "name" | |
225 | Set the name of the manual page. Without this option, the manual name is | |
226 | set to the uppercased base name of the file being converted unless the | |
227 | manual section is 3, in which case the path is parsed to see if it is a Perl | |
228 | module path. If it is, a path like \f(CW\*(C`.../lib/Pod/Man.pm\*(C'\fR is converted into | |
229 | a name like \f(CW\*(C`Pod::Man\*(C'\fR. This option, if given, overrides any automatic | |
230 | determination of the name. | |
231 | .IP "quotes" 4 | |
232 | .IX Item "quotes" | |
233 | Sets the quote marks used to surround C<> text. If the value is a | |
234 | single character, it is used as both the left and right quote; if it is two | |
235 | characters, the first character is used as the left quote and the second as | |
236 | the right quoted; and if it is four characters, the first two are used as | |
237 | the left quote and the second two as the right quote. | |
238 | .Sp | |
239 | This may also be set to the special value \f(CW\*(C`none\*(C'\fR, in which case no quote | |
240 | marks are added around C<> text (but the font is still changed for troff | |
241 | output). | |
242 | .IP "release" 4 | |
243 | .IX Item "release" | |
244 | Set the centered footer. By default, this is the version of Perl you run | |
245 | Pod::Man under. Note that some system an macro sets assume that the | |
246 | centered footer will be a modification date and will prepend something like | |
247 | \&\*(L"Last modified: \*(R"; if this is the case, you may want to set \f(CW\*(C`release\*(C'\fR to | |
248 | the last modified date and \f(CW\*(C`date\*(C'\fR to the version number. | |
249 | .IP "section" 4 | |
250 | .IX Item "section" | |
251 | Set the section for the \f(CW\*(C`.TH\*(C'\fR macro. The standard section numbering | |
252 | convention is to use 1 for user commands, 2 for system calls, 3 for | |
253 | functions, 4 for devices, 5 for file formats, 6 for games, 7 for | |
254 | miscellaneous information, and 8 for administrator commands. There is a lot | |
255 | of variation here, however; some systems (like Solaris) use 4 for file | |
256 | formats, 5 for miscellaneous information, and 7 for devices. Still others | |
257 | use 1m instead of 8, or some mix of both. About the only section numbers | |
258 | that are reliably consistent are 1, 2, and 3. | |
259 | .Sp | |
260 | By default, section 1 will be used unless the file ends in .pm in which case | |
261 | section 3 will be selected. | |
262 | .PP | |
263 | The standard Pod::Parser method \fIparse_from_filehandle()\fR takes up to two | |
264 | arguments, the first being the file handle to read \s-1POD\s0 from and the second | |
265 | being the file handle to write the formatted output to. The first defaults | |
266 | to \s-1STDIN\s0 if not given, and the second defaults to \s-1STDOUT\s0. The method | |
267 | \&\fIparse_from_file()\fR is almost identical, except that its two arguments are the | |
268 | input and output disk files instead. See Pod::Parser for the specific | |
269 | details. | |
270 | .SH "DIAGNOSTICS" | |
271 | .IX Header "DIAGNOSTICS" | |
272 | .ie n .IP "roff font should be 1 or 2 chars, not ""%s""" 4 | |
273 | .el .IP "roff font should be 1 or 2 chars, not ``%s''" 4 | |
274 | .IX Item "roff font should be 1 or 2 chars, not %s" | |
275 | (F) You specified a *roff font (using \f(CW\*(C`fixed\*(C'\fR, \f(CW\*(C`fixedbold\*(C'\fR, etc.) that | |
276 | wasn't either one or two characters. Pod::Man doesn't support *roff fonts | |
277 | longer than two characters, although some *roff extensions do (the canonical | |
278 | versions of \fBnroff\fR and \fBtroff\fR don't either). | |
279 | .ie n .IP "Invalid link %s" 4 | |
280 | .el .IP "Invalid link \f(CW%s\fR" 4 | |
281 | .IX Item "Invalid link %s" | |
282 | (W) The \s-1POD\s0 source contained a \f(CW\*(C`L<>\*(C'\fR formatting code that | |
283 | Pod::Man was unable to parse. You should never see this error message; it | |
284 | probably indicates a bug in Pod::Man. | |
285 | .ie n .IP "Invalid quote specification ""%s""" 4 | |
286 | .el .IP "Invalid quote specification ``%s''" 4 | |
287 | .IX Item "Invalid quote specification %s" | |
288 | (F) The quote specification given (the quotes option to the constructor) was | |
289 | invalid. A quote specification must be one, two, or four characters long. | |
290 | .ie n .IP "%s:%d: Unknown command paragraph ""%s""." 4 | |
291 | .el .IP "%s:%d: Unknown command paragraph ``%s''." 4 | |
292 | .IX Item "%s:%d: Unknown command paragraph %s." | |
293 | (W) The \s-1POD\s0 source contained a non-standard command paragraph (something of | |
294 | the form \f(CW\*(C`=command args\*(C'\fR) that Pod::Man didn't know about. It was ignored. | |
295 | .IP "%s:%d: Unknown escape E<%s>" 4 | |
296 | .IX Item "%s:%d: Unknown escape E<%s>" | |
297 | (W) The \s-1POD\s0 source contained an \f(CW\*(C`E<>\*(C'\fR escape that Pod::Man didn't | |
298 | know about. \f(CW\*(C`E<%s>\*(C'\fR was printed verbatim in the output. | |
299 | .ie n .IP "%s:%d: Unknown formatting code %s" 4 | |
300 | .el .IP "%s:%d: Unknown formatting code \f(CW%s\fR" 4 | |
301 | .IX Item "%s:%d: Unknown formatting code %s" | |
302 | (W) The \s-1POD\s0 source contained a non-standard formatting code (something of | |
303 | the form \f(CW\*(C`X<>\*(C'\fR) that Pod::Man didn't know about. It was ignored. | |
304 | .IP "%s:%d: Unmatched =back" 4 | |
305 | .IX Item "%s:%d: Unmatched =back" | |
306 | (W) Pod::Man encountered a \f(CW\*(C`=back\*(C'\fR command that didn't correspond to an | |
307 | \&\f(CW\*(C`=over\*(C'\fR command. | |
308 | .SH "BUGS" | |
309 | .IX Header "BUGS" | |
310 | Eight-bit input data isn't handled at all well at present. The correct | |
311 | approach would be to map E<> escapes to the appropriate \s-1UTF\-8\s0 | |
312 | characters and then do a translation pass on the output according to the | |
313 | user-specified output character set. Unfortunately, we can't send eight-bit | |
314 | data directly to the output unless the user says this is okay, since some | |
315 | vendor *roff implementations can't handle eight-bit data. If the *roff | |
316 | implementation can, however, that's far superior to the current hacked | |
317 | characters that only work under troff. | |
318 | .PP | |
319 | There is currently no way to turn off the guesswork that tries to format | |
320 | unmarked text appropriately, and sometimes it isn't wanted (particularly | |
321 | when using \s-1POD\s0 to document something other than Perl). | |
322 | .PP | |
323 | The \s-1NAME\s0 section should be recognized specially and index entries emitted | |
324 | for everything in that section. This would have to be deferred until the | |
325 | next section, since extraneous things in \s-1NAME\s0 tends to confuse various man | |
326 | page processors. | |
327 | .PP | |
328 | Pod::Man doesn't handle font names longer than two characters. Neither do | |
329 | most \fBtroff\fR implementations, but \s-1GNU\s0 troff does as an extension. It would | |
330 | be nice to support as an option for those who want to use it. | |
331 | .PP | |
332 | The preamble added to each output file is rather verbose, and most of it is | |
333 | only necessary in the presence of E<> escapes for non-ASCII | |
334 | characters. It would ideally be nice if all of those definitions were only | |
335 | output if needed, perhaps on the fly as the characters are used. | |
336 | .PP | |
337 | Pod::Man is excessively slow. | |
338 | .SH "CAVEATS" | |
339 | .IX Header "CAVEATS" | |
340 | The handling of hyphens and em dashes is somewhat fragile, and one may get | |
341 | the wrong one under some circumstances. This should only matter for | |
342 | \&\fBtroff\fR output. | |
343 | .PP | |
344 | When and whether to use small caps is somewhat tricky, and Pod::Man doesn't | |
345 | necessarily get it right. | |
346 | .SH "SEE ALSO" | |
347 | .IX Header "SEE ALSO" | |
348 | Pod::Parser, \fIperlpod\fR\|(1), \fIpod2man\fR\|(1), \fInroff\fR\|(1), \fItroff\fR\|(1), | |
349 | \&\fIman\fR\|(1), \fIman\fR\|(7) | |
350 | .PP | |
351 | Ossanna, Joseph F., and Brian W. Kernighan. \*(L"Troff User's Manual,\*(R" | |
352 | Computing Science Technical Report No. 54, \s-1AT&T\s0 Bell Laboratories. This is | |
353 | the best documentation of standard \fBnroff\fR and \fBtroff\fR. At the time of | |
354 | this writing, it's available at | |
355 | <http://www.cs.bell\-labs.com/cm/cs/cstr.html>. | |
356 | .PP | |
357 | The man page documenting the man macro set may be \fIman\fR\|(5) instead of | |
358 | \&\fIman\fR\|(7) on your system. Also, please see \fIpod2man\fR\|(1) for extensive | |
359 | documentation on writing manual pages if you've not done it before and | |
360 | aren't familiar with the conventions. | |
361 | .PP | |
362 | The current version of this module is always available from its web site at | |
363 | <http://www.eyrie.org/~eagle/software/podlators/>. It is also part of the | |
364 | Perl core distribution as of 5.6.0. | |
365 | .SH "AUTHOR" | |
366 | .IX Header "AUTHOR" | |
367 | Russ Allbery <rra@stanford.edu>, based \fIvery\fR heavily on the original | |
368 | \&\fBpod2man\fR by Tom Christiansen <tchrist@mox.perl.com>. | |
369 | .SH "COPYRIGHT AND LICENSE" | |
370 | .IX Header "COPYRIGHT AND LICENSE" | |
371 | Copyright 1999, 2000, 2001, 2002 by Russ Allbery <rra@stanford.edu>. | |
372 | .PP | |
373 | This program is free software; you may redistribute it and/or modify it | |
374 | under the same terms as Perl itself. |