📄 pod2man.1
字号:
\& pod2man program > program.1\& pod2man SomeModule.pm /usr/perl/man/man3/SomeModule.3\& pod2man \-\-section=7 note.pod > note.7.Ve.PPIf you would like to print out a lot of man page continuously, you probablywant to set the C and D registers to set contiguous page numbering andeven/odd paging, at least on some versions of \fIman\fR\|(7)..PP.Vb 1\& troff \-man \-rC1 \-rD1 perl.1 perldata.1 perlsyn.1 ....Ve.PPTo get index entries on stderr, turn on the F register, as in:.PP.Vb 1\& troff \-man \-rF1 perl.1.Ve.PPThe indexing merely outputs messages via \f(CW\*(C`.tm\*(C'\fR for each major page,section, subsection, item, and any \f(CW\*(C`X<>\*(C'\fR directives. SeePod::Man for more details..SH "BUGS".IX Header "BUGS"Lots of this documentation is duplicated from Pod::Man..SH "NOTES".IX Header "NOTES"For those not sure of the proper layout of a man page, here are some noteson writing a proper man page..PPThe name of the program being documented is conventionally written in bold(using B<>) wherever it occurs, as are all program options.Arguments should be written in italics (I<>). Functions aretraditionally written in italics; if you write a function as \fIfunction()\fR,Pod::Man will take care of this for you. Literal code or commands shouldbe in C<>. References to other man pages should be in the form\&\f(CW\*(C`manpage(section)\*(C'\fR, and Pod::Man will automatically format thoseappropriately. As an exception, it's traditional not to use this form whenreferring to module documentation; use \f(CW\*(C`L<Module::Name>\*(C'\fR instead..PPReferences to other programs or functions are normally in the form of manpage references so that cross-referencing tools can provide the user withlinks and the like. It's possible to overdo this, though, so be careful notto clutter your documentation with too much markup..PPThe major headers should be set out using a \f(CW\*(C`=head1\*(C'\fR directive, and arehistorically written in the rather startling \s-1ALL\s0 \s-1UPPER\s0 \s-1CASE\s0 format, althoughthis is not mandatory. Minor headers may be included using \f(CW\*(C`=head2\*(C'\fR, andare typically in mixed case..PPThe standard sections of a manual page are:.IP "\s-1NAME\s0" 4.IX Item "NAME"Mandatory section; should be a comma-separated list of programs or functionsdocumented by this podpage, such as:.Sp.Vb 1\& foo, bar \- programs to do something.Ve.SpManual page indexers are often extremely picky about the format of thissection, so don't put anything in it except this line. A single dash, andonly a single dash, should separate the list of programs or functions fromthe description. Functions should not be qualified with \f(CW\*(C`()\*(C'\fR or the like.The description should ideally fit on a single line, even if a man programreplaces the dash with a few tabs..IP "\s-1SYNOPSIS\s0" 4.IX Item "SYNOPSIS"A short usage summary for programs and functions. This section is mandatoryfor section 3 pages..IP "\s-1DESCRIPTION\s0" 4.IX Item "DESCRIPTION"Extended description and discussion of the program or functions, or the bodyof the documentation for man pages that document something else. Ifparticularly long, it's a good idea to break this up into subsections\&\f(CW\*(C`=head2\*(C'\fR directives like:.Sp.Vb 1\& =head2 Normal Usage\&\& =head2 Advanced Features\&\& =head2 Writing Configuration Files.Ve.Spor whatever is appropriate for your documentation..IP "\s-1OPTIONS\s0" 4.IX Item "OPTIONS"Detailed description of each of the command-line options taken by theprogram. This should be separate from the description for the use of thingslike Pod::Usage. This is normally presented as a list, witheach option as a separate \f(CW\*(C`=item\*(C'\fR. The specific option string should beenclosed in B<>. Any values that the option takes should beenclosed in I<>. For example, the section for the option\&\fB\-\-section\fR=\fImanext\fR would be introduced with:.Sp.Vb 1\& =item B<\-\-section>=I<manext>.Ve.SpSynonymous options (like both the short and long forms) are separated by acomma and a space on the same \f(CW\*(C`=item\*(C'\fR line, or optionally listed as theirown item with a reference to the canonical name. For example, since\&\fB\-\-section\fR can also be written as \fB\-s\fR, the above would be:.Sp.Vb 1\& =item B<\-s> I<manext>, B<\-\-section>=I<manext>.Ve.Sp(Writing the short option first is arguably easier to read, since the longoption is long enough to draw the eye to it anyway and the short option canotherwise get lost in visual noise.).IP "\s-1RETURN\s0 \s-1VALUE\s0" 4.IX Item "RETURN VALUE"What the program or function returns, if successful. This section can beomitted for programs whose precise exit codes aren't important, providedthey return 0 on success as is standard. It should always be present forfunctions..IP "\s-1ERRORS\s0" 4.IX Item "ERRORS"Exceptions, error return codes, exit statuses, and errno settings.Typically used for function documentation; program documentation uses\&\s-1DIAGNOSTICS\s0 instead. The general rule of thumb is that errors printed to\&\s-1STDOUT\s0 or \s-1STDERR\s0 and intended for the end user are documented in \s-1DIAGNOSTICS\s0while errors passed internal to the calling program and intended for otherprogrammers are documented in \s-1ERRORS\s0. When documenting a function that setserrno, a full list of the possible errno values should be given here..IP "\s-1DIAGNOSTICS\s0" 4.IX Item "DIAGNOSTICS"All possible messages the program can print out\*(--and what they mean. Youmay wish to follow the same documentation style as the Perl documentation;see \fIperldiag\fR\|(1) for more details (and look at the \s-1POD\s0 source as well)..SpIf applicable, please include details on what the user should do to correctthe error; documenting an error as indicating \*(L"the input buffer is toosmall\*(R" without telling the user how to increase the size of the input buffer(or at least telling them that it isn't possible) aren't very useful..IP "\s-1EXAMPLES\s0" 4.IX Item "EXAMPLES"Give some example uses of the program or function. Don't skimp; users oftenfind this the most useful part of the documentation. The examples aregenerally given as verbatim paragraphs..SpDon't just present an example without explaining what it does. Adding ashort paragraph saying what the example will do can increase the value ofthe example immensely..IP "\s-1ENVIRONMENT\s0" 4.IX Item "ENVIRONMENT"Environment variables that the program cares about, normally presented as alist using \f(CW\*(C`=over\*(C'\fR, \f(CW\*(C`=item\*(C'\fR, and \f(CW\*(C`=back\*(C'\fR. For example:.Sp.Vb 1\& =over 6\&\& =item HOME\&\& Used to determine the user\*(Aqs home directory. F<.foorc> in this\& directory is read for configuration details, if it exists.\&\& =back.Ve.SpSince environment variables are normally in all uppercase, no additionalspecial formatting is generally needed; they're glaring enough as it is..IP "\s-1FILES\s0" 4.IX Item "FILES"All files used by the program or function, normally presented as a list, andwhat it uses them for. File names should be enclosed in F<>. It'sparticularly important to document files that will be potentially modified..IP "\s-1CAVEATS\s0" 4.IX Item "CAVEATS"Things to take special care with, sometimes called \s-1WARNINGS\s0..IP "\s-1BUGS\s0" 4.IX Item "BUGS"Things that are broken or just don't work quite right..IP "\s-1RESTRICTIONS\s0" 4.IX Item "RESTRICTIONS"Bugs you don't plan to fix. :\-).IP "\s-1NOTES\s0" 4.IX Item "NOTES"Miscellaneous commentary..IP "\s-1AUTHOR\s0" 4.IX Item "AUTHOR"Who wrote it (use \s-1AUTHORS\s0 for multiple people). Including your currente\-mail address (or some e\-mail address to which bug reports should be sent)so that users have a way of contacting you is a good idea. Remember thatprogram documentation tends to roam the wild for far longer than you expectand pick an e\-mail address that's likely to last if possible..IP "\s-1HISTORY\s0" 4.IX Item "HISTORY"Programs derived from other sources sometimes have this, or you might keepa modification log here. If the log gets overly long or detailed,consider maintaining it in a separate file, though..IP "\s-1COPYRIGHT\s0 \s-1AND\s0 \s-1LICENSE\s0" 4.IX Item "COPYRIGHT AND LICENSE"For copyright.Sp.Vb 1\& Copyright YEAR(s) by YOUR NAME(s).Ve.Sp(No, (C) is not needed. No, \*(L"all rights reserved\*(R" is not needed.).SpFor licensing the easiest way is to use the same licensing as Perl itself:.Sp.Vb 2\& This library is free software; you may redistribute it and/or modify\& it under the same terms as Perl itself..Ve.SpThis makes it easy for people to use your module with Perl. Note thatthis licensing is neither an endorsement or a requirement, you are ofcourse free to choose any licensing..IP "\s-1SEE\s0 \s-1ALSO\s0" 4.IX Item "SEE ALSO"Other man pages to check out, like \fIman\fR\|(1), \fIman\fR\|(7), \fImakewhatis\fR\|(8), or\&\fIcatman\fR\|(8). Normally a simple list of man pages separated by commas, or aparagraph giving the name of a reference work. Man page references, if theyuse the standard \f(CW\*(C`name(section)\*(C'\fR form, don't have to be enclosed inL<> (although it's recommended), but other things in this sectionprobably should be when appropriate..SpIf the package has a mailing list, include a \s-1URL\s0 or subscriptioninstructions here..SpIf the package has a web site, include a \s-1URL\s0 here..PPIn addition, some systems use \s-1CONFORMING\s0 \s-1TO\s0 to note conformance to relevantstandards and MT-LEVEL to note safeness for use in threaded programs orsignal handlers. These headings are primarily useful when documenting partsof a C library. Documentation of object-oriented libraries or modules mayuse \s-1CONSTRUCTORS\s0 and \s-1METHODS\s0 sections for detailed documentation of theparts of the library and save the \s-1DESCRIPTION\s0 section for an overview; otherlarge modules may use \s-1FUNCTIONS\s0 for similar reasons. Some people use\&\s-1OVERVIEW\s0 to summarize the description if it's quite long..PPSection ordering varies, although \s-1NAME\s0 should \fIalways\fR be the first section(you'll break some man page systems otherwise), and \s-1NAME\s0, \s-1SYNOPSIS\s0,\&\s-1DESCRIPTION\s0, and \s-1OPTIONS\s0 generally always occur first and in that order ifpresent. In general, \s-1SEE\s0 \s-1ALSO\s0, \s-1AUTHOR\s0, and similar material should be leftfor last. Some systems also move \s-1WARNINGS\s0 and \s-1NOTES\s0 to last. The ordergiven above should be reasonable for most purposes..PPFinally, as a general note, try not to use an excessive amount of markup.As documented here and in Pod::Man, you can safely leave Perl variables,function names, man page references, and the like unadorned by markup andthe \s-1POD\s0 translators will figure it out for you. This makes it much easierto later edit the documentation. Note that many existing translators(including this one currently) will do the wrong thing with e\-mail addresseswhen wrapped in L<>, so don't do that..PPFor additional information that may be more accurate for your specificsystem, see either \fIman\fR\|(5) or \fIman\fR\|(7) depending on your system manualsection numbering conventions..SH "SEE ALSO".IX Header "SEE ALSO"Pod::Man, Pod::Simple, \fIman\fR\|(1), \fInroff\fR\|(1), \fIpodchecker\fR\|(1),\&\fItroff\fR\|(1), \fIman\fR\|(7).PPThe man page documenting the an macro set may be \fIman\fR\|(5) instead of\&\fIman\fR\|(7) on your system..PPThe current version of this script is always available from its web site at<http://www.eyrie.org/~eagle/software/podlators/>. It is also part of thePerl core distribution as of 5.6.0..SH "AUTHOR".IX Header "AUTHOR"Russ Allbery <rra@stanford.edu>, based \fIvery\fR heavily on the original\&\fBpod2man\fR by Larry Wall and Tom Christiansen. Large portions of thisdocumentation, particularly the sections on the anatomy of a proper manpage, are taken from the \fBpod2man\fR documentation by Tom..SH "COPYRIGHT AND LICENSE".IX Header "COPYRIGHT AND LICENSE"Copyright 1999, 2000, 2001, 2004, 2006 by Russ Allbery <rra@stanford.edu>..PPThis program is free software; you may redistribute it and/or modify itunder the same terms as Perl itself.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -