Install Perl 5.8.8
[msysgit.git] / mingw / html / lib / Pod / Man.html
blob2d99bd1238c3c3eb4e61e1243639305465c58c31
1 <?xml version="1.0" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <title>Pod::Man - Convert POD data to formatted *roff input</title>
6 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7 <link rev="made" href="mailto:" />
8 </head>
10 <body style="background-color: white">
11 <table border="0" width="100%" cellspacing="0" cellpadding="3">
12 <tr><td class="block" style="background-color: #cccccc" valign="middle">
13 <big><strong><span class="block">&nbsp;Pod::Man - Convert POD data to formatted *roff input</span></strong></big>
14 </td></tr>
15 </table>
17 <p><a name="__index__"></a></p>
18 <!-- INDEX BEGIN -->
20 <ul>
22 <li><a href="#name">NAME</a></li>
23 <li><a href="#synopsis">SYNOPSIS</a></li>
24 <li><a href="#description">DESCRIPTION</a></li>
25 <li><a href="#diagnostics">DIAGNOSTICS</a></li>
26 <li><a href="#bugs">BUGS</a></li>
27 <li><a href="#caveats">CAVEATS</a></li>
28 <li><a href="#see_also">SEE ALSO</a></li>
29 <li><a href="#author">AUTHOR</a></li>
30 <li><a href="#copyright_and_license">COPYRIGHT AND LICENSE</a></li>
31 </ul>
32 <!-- INDEX END -->
34 <hr />
35 <p>
36 </p>
37 <h1><a name="name">NAME</a></h1>
38 <p>Pod::Man - Convert POD data to formatted *roff input</p>
39 <p>
40 </p>
41 <hr />
42 <h1><a name="synopsis">SYNOPSIS</a></h1>
43 <pre>
44 use Pod::Man;
45 my $parser = Pod::Man-&gt;new (release =&gt; $VERSION, section =&gt; 8);</pre>
46 <pre>
47 # Read POD from STDIN and write to STDOUT.
48 $parser-&gt;parse_from_filehandle;</pre>
49 <pre>
50 # Read POD from file.pod and write to file.1.
51 $parser-&gt;parse_from_file ('file.pod', 'file.1');</pre>
52 <p>
53 </p>
54 <hr />
55 <h1><a name="description">DESCRIPTION</a></h1>
56 <p>Pod::Man is a module to convert documentation in the POD format (the
57 preferred language for documenting Perl) into *roff input using the man
58 macro set. The resulting *roff code is suitable for display on a terminal
59 using <em>nroff(1)</em>, normally via <em>man(1)</em>, or printing using <em>troff(1)</em>.
60 It is conventionally invoked using the driver script <strong>pod2man</strong>, but it can
61 also be used directly.</p>
62 <p>As a derived class from Pod::Parser, Pod::Man supports the same methods and
63 interfaces. See <a href="file://C|\msysgit\mingw\html/lib/Pod/Parser.html">the Pod::Parser manpage</a> for all the details; briefly, one creates a
64 new parser with <code>Pod::Man-&gt;new()</code> and then calls either
65 <code>parse_from_filehandle()</code> or parse_from_file().</p>
66 <p><code>new()</code> can take options, in the form of key/value pairs that control the
67 behavior of the parser. See below for details.</p>
68 <p>If no options are given, Pod::Man uses the name of the input file with any
69 trailing <code>.pod</code>, <code>.pm</code>, or <code>.pl</code> stripped as the man page title, to
70 section 1 unless the file ended in <code>.pm</code> in which case it defaults to
71 section 3, to a centered title of ``User Contributed Perl Documentation'', to
72 a centered footer of the Perl version it is run with, and to a left-hand
73 footer of the modification date of its input (or the current date if given
74 STDIN for input).</p>
75 <p>Pod::Man assumes that your *roff formatters have a fixed-width font named
76 CW. If yours is called something else (like CR), use the <a href="#item_fixed"><code>fixed</code></a> option to
77 specify it. This generally only matters for troff output for printing.
78 Similarly, you can set the fonts used for bold, italic, and bold italic
79 fixed-width output.</p>
80 <p>Besides the obvious pod conversions, Pod::Man also takes care of formatting
81 func(), func(3), and simple variable references like $foo or @bar so you
82 don't have to use code escapes for them; complex expressions like
83 <code>$fred{'stuff'}</code> will still need to be escaped, though. It also translates
84 dashes that aren't used as hyphens into en dashes, makes long dashes--like
85 this--into proper em dashes, fixes ``paired quotes,'' makes C++ look right,
86 puts a little space between double underbars, makes ALLCAPS a teeny bit
87 smaller in <strong>troff</strong>, and escapes stuff that *roff treats as special so that
88 you don't have to.</p>
89 <p>The recognized options to <code>new()</code> are as follows. All options take a single
90 argument.</p>
91 <dl>
92 <dt><strong><a name="item_center">center</a></strong>
94 <dd>
95 <p>Sets the centered page header to use instead of ``User Contributed Perl
96 Documentation''.</p>
97 </dd>
98 </li>
99 <dt><strong><a name="item_date">date</a></strong>
101 <dd>
102 <p>Sets the left-hand footer. By default, the modification date of the input
103 file will be used, or the current date if <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_stat"><code>stat()</code></a> can't find that file (the
104 case if the input is from STDIN), and the date will be formatted as
105 YYYY-MM-DD.</p>
106 </dd>
107 </li>
108 <dt><strong><a name="item_fixed">fixed</a></strong>
110 <dd>
111 <p>The fixed-width font to use for vertabim text and code. Defaults to CW.
112 Some systems may want CR instead. Only matters for <strong>troff</strong> output.</p>
113 </dd>
114 </li>
115 <dt><strong><a name="item_fixedbold">fixedbold</a></strong>
117 <dd>
118 <p>Bold version of the fixed-width font. Defaults to CB. Only matters for
119 <strong>troff</strong> output.</p>
120 </dd>
121 </li>
122 <dt><strong><a name="item_fixeditalic">fixeditalic</a></strong>
124 <dd>
125 <p>Italic version of the fixed-width font (actually, something of a misnomer,
126 since most fixed-width fonts only have an oblique version, not an italic
127 version). Defaults to CI. Only matters for <strong>troff</strong> output.</p>
128 </dd>
129 </li>
130 <dt><strong><a name="item_fixedbolditalic">fixedbolditalic</a></strong>
132 <dd>
133 <p>Bold italic (probably actually oblique) version of the fixed-width font.
134 Pod::Man doesn't assume you have this, and defaults to CB. Some systems
135 (such as Solaris) have this font available as CX. Only matters for <strong>troff</strong>
136 output.</p>
137 </dd>
138 </li>
139 <dt><strong><a name="item_name">name</a></strong>
141 <dd>
142 <p>Set the name of the manual page. Without this option, the manual name is
143 set to the uppercased base name of the file being converted unless the
144 manual section is 3, in which case the path is parsed to see if it is a Perl
145 module path. If it is, a path like <code>.../lib/Pod/Man.pm</code> is converted into
146 a name like <code>Pod::Man</code>. This option, if given, overrides any automatic
147 determination of the name.</p>
148 </dd>
149 </li>
150 <dt><strong><a name="item_quotes">quotes</a></strong>
152 <dd>
153 <p>Sets the quote marks used to surround C&lt;&gt; text. If the value is a
154 single character, it is used as both the left and right quote; if it is two
155 characters, the first character is used as the left quote and the second as
156 the right quoted; and if it is four characters, the first two are used as
157 the left quote and the second two as the right quote.</p>
158 </dd>
159 <dd>
160 <p>This may also be set to the special value <code>none</code>, in which case no quote
161 marks are added around C&lt;&gt; text (but the font is still changed for troff
162 output).</p>
163 </dd>
164 </li>
165 <dt><strong><a name="item_release">release</a></strong>
167 <dd>
168 <p>Set the centered footer. By default, this is the version of Perl you run
169 Pod::Man under. Note that some system an macro sets assume that the
170 centered footer will be a modification date and will prepend something like
171 ``Last modified: ''; if this is the case, you may want to set <a href="#item_release"><code>release</code></a> to
172 the last modified date and <a href="#item_date"><code>date</code></a> to the version number.</p>
173 </dd>
174 </li>
175 <dt><strong><a name="item_section">section</a></strong>
177 <dd>
178 <p>Set the section for the <code>.TH</code> macro. The standard section numbering
179 convention is to use 1 for user commands, 2 for system calls, 3 for
180 functions, 4 for devices, 5 for file formats, 6 for games, 7 for
181 miscellaneous information, and 8 for administrator commands. There is a lot
182 of variation here, however; some systems (like Solaris) use 4 for file
183 formats, 5 for miscellaneous information, and 7 for devices. Still others
184 use 1m instead of 8, or some mix of both. About the only section numbers
185 that are reliably consistent are 1, 2, and 3.</p>
186 </dd>
187 <dd>
188 <p>By default, section 1 will be used unless the file ends in .pm in which case
189 section 3 will be selected.</p>
190 </dd>
191 </li>
192 </dl>
193 <p>The standard Pod::Parser method <code>parse_from_filehandle()</code> takes up to two
194 arguments, the first being the file handle to read POD from and the second
195 being the file handle to write the formatted output to. The first defaults
196 to STDIN if not given, and the second defaults to STDOUT. The method
197 <code>parse_from_file()</code> is almost identical, except that its two arguments are the
198 input and output disk files instead. See <a href="file://C|\msysgit\mingw\html/lib/Pod/Parser.html">the Pod::Parser manpage</a> for the specific
199 details.</p>
201 </p>
202 <hr />
203 <h1><a name="diagnostics">DIAGNOSTICS</a></h1>
204 <dl>
205 <dt><strong><a name="item_roff_font_should_be_1_or_2_chars_2c_not__22_25s_22">roff font should be 1 or 2 chars, not ``%s''</a></strong>
207 <dd>
208 <p>(F) You specified a *roff font (using <a href="#item_fixed"><code>fixed</code></a>, <a href="#item_fixedbold"><code>fixedbold</code></a>, etc.) that
209 wasn't either one or two characters. Pod::Man doesn't support *roff fonts
210 longer than two characters, although some *roff extensions do (the canonical
211 versions of <strong>nroff</strong> and <strong>troff</strong> don't either).</p>
212 </dd>
213 </li>
214 <dt><strong><a name="item_invalid_link__25s">Invalid link %s</a></strong>
216 <dd>
217 <p>(W) The POD source contained a <code>L&lt;&gt;</code> formatting code that
218 Pod::Man was unable to parse. You should never see this error message; it
219 probably indicates a bug in Pod::Man.</p>
220 </dd>
221 </li>
222 <dt><strong><a name="item_invalid_quote_specification__22_25s_22">Invalid quote specification ``%s''</a></strong>
224 <dd>
225 <p>(F) The quote specification given (the quotes option to the constructor) was
226 invalid. A quote specification must be one, two, or four characters long.</p>
227 </dd>
228 </li>
229 <dt><strong><a name="item__s__d_">%s:%d: Unknown command paragraph ``%s''.</a></strong>
231 <dd>
232 <p>(W) The POD source contained a non-standard command paragraph (something of
233 the form <code>=command args</code>) that Pod::Man didn't know about. It was ignored.</p>
234 </dd>
235 </li>
236 <dt><strong>%s:%d: Unknown escape E&lt;%s&gt;</strong>
238 <dd>
239 <p>(W) The POD source contained an <code>E&lt;&gt;</code> escape that Pod::Man didn't
240 know about. <code>E&lt;%s&gt;</code> was printed verbatim in the output.</p>
241 </dd>
242 </li>
243 <dt><strong>%s:%d: Unknown formatting code %s</strong>
245 <dd>
246 <p>(W) The POD source contained a non-standard formatting code (something of
247 the form <code>X&lt;&gt;</code>) that Pod::Man didn't know about. It was ignored.</p>
248 </dd>
249 </li>
250 <dt><strong>%s:%d: Unmatched =back</strong>
252 <dd>
253 <p>(W) Pod::Man encountered a <code>=back</code> command that didn't correspond to an
254 <code>=over</code> command.</p>
255 </dd>
256 </li>
257 </dl>
259 </p>
260 <hr />
261 <h1><a name="bugs">BUGS</a></h1>
262 <p>Eight-bit input data isn't handled at all well at present. The correct
263 approach would be to map E&lt;&gt; escapes to the appropriate UTF-8
264 characters and then do a translation pass on the output according to the
265 user-specified output character set. Unfortunately, we can't send eight-bit
266 data directly to the output unless the user says this is okay, since some
267 vendor *roff implementations can't handle eight-bit data. If the *roff
268 implementation can, however, that's far superior to the current hacked
269 characters that only work under troff.</p>
270 <p>There is currently no way to turn off the guesswork that tries to format
271 unmarked text appropriately, and sometimes it isn't wanted (particularly
272 when using POD to document something other than Perl).</p>
273 <p>The NAME section should be recognized specially and index entries emitted
274 for everything in that section. This would have to be deferred until the
275 next section, since extraneous things in NAME tends to confuse various man
276 page processors.</p>
277 <p>Pod::Man doesn't handle font names longer than two characters. Neither do
278 most <strong>troff</strong> implementations, but GNU troff does as an extension. It would
279 be nice to support as an option for those who want to use it.</p>
280 <p>The preamble added to each output file is rather verbose, and most of it is
281 only necessary in the presence of E&lt;&gt; escapes for non-ASCII
282 characters. It would ideally be nice if all of those definitions were only
283 output if needed, perhaps on the fly as the characters are used.</p>
284 <p>Pod::Man is excessively slow.</p>
286 </p>
287 <hr />
288 <h1><a name="caveats">CAVEATS</a></h1>
289 <p>The handling of hyphens and em dashes is somewhat fragile, and one may get
290 the wrong one under some circumstances. This should only matter for
291 <strong>troff</strong> output.</p>
292 <p>When and whether to use small caps is somewhat tricky, and Pod::Man doesn't
293 necessarily get it right.</p>
295 </p>
296 <hr />
297 <h1><a name="see_also">SEE ALSO</a></h1>
298 <p><a href="file://C|\msysgit\mingw\html/lib/Pod/Parser.html">the Pod::Parser manpage</a>, <em>perlpod(1)</em>, <em>pod2man(1)</em>, <em>nroff(1)</em>, <em>troff(1)</em>,
299 <em>man(1)</em>, <em>man(7)</em></p>
300 <p>Ossanna, Joseph F., and Brian W. Kernighan. ``Troff User's Manual,''
301 Computing Science Technical Report No. 54, AT&amp;T Bell Laboratories. This is
302 the best documentation of standard <strong>nroff</strong> and <strong>troff</strong>. At the time of
303 this writing, it's available at
304 <a href="http://www.cs.bell-labs.com/cm/cs/cstr.html">http://www.cs.bell-labs.com/cm/cs/cstr.html</a>.</p>
305 <p>The man page documenting the man macro set may be <em>man(5)</em> instead of
306 <em>man(7)</em> on your system. Also, please see <em>pod2man(1)</em> for extensive
307 documentation on writing manual pages if you've not done it before and
308 aren't familiar with the conventions.</p>
309 <p>The current version of this module is always available from its web site at
310 <a href="http://www.eyrie.org/~eagle/software/podlators/">http://www.eyrie.org/~eagle/software/podlators/</a>. It is also part of the
311 Perl core distribution as of 5.6.0.</p>
313 </p>
314 <hr />
315 <h1><a name="author">AUTHOR</a></h1>
316 <p>Russ Allbery &lt;<a href="mailto:rra@stanford.edu">rra@stanford.edu</a>&gt;, based <em>very</em> heavily on the original
317 <strong>pod2man</strong> by Tom Christiansen &lt;<a href="mailto:tchrist@mox.perl.com">tchrist@mox.perl.com</a>&gt;.</p>
319 </p>
320 <hr />
321 <h1><a name="copyright_and_license">COPYRIGHT AND LICENSE</a></h1>
322 <p>Copyright 1999, 2000, 2001, 2002, 2003 by Russ Allbery &lt;<a href="mailto:rra@stanford.edu">rra@stanford.edu</a>&gt;.</p>
323 <p>This program is free software; you may redistribute it and/or modify it
324 under the same terms as Perl itself.</p>
325 <table border="0" width="100%" cellspacing="0" cellpadding="3">
326 <tr><td class="block" style="background-color: #cccccc" valign="middle">
327 <big><strong><span class="block">&nbsp;Pod::Man - Convert POD data to formatted *roff input</span></strong></big>
328 </td></tr>
329 </table>
331 </body>
333 </html>