Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pod2man documentation on writing a man page #521

Closed
p5pRT opened this issue Sep 20, 1999 · 2 comments
Closed

pod2man documentation on writing a man page #521

p5pRT opened this issue Sep 20, 1999 · 2 comments

Comments

@p5pRT
Copy link

p5pRT commented Sep 20, 1999

Migrated from rt.perl.org#1368 (status was 'resolved')

Searchable as RT1368$

@p5pRT
Copy link
Author

p5pRT commented Sep 20, 1999

From The RT System itself

Since the goal is for this to be an eventual replacement for the current
pod2man, which is one of the better introductions to writing man pages
that I've seen, I'm interested in any comments and feedback on the
following​:

NOTES
  For those not sure of the proper layout of a man page, here are some
  notes on writing a proper man page.

  The 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 are
  traditionally written in italics; if you write a function as function(),
  Pod​::Roff will take care of this for you. Literal code or commands
  should be in C<>. References to other man pages should be in the form
  `manpage(section)', and Pod​::Roff will automatically format those
  appropriately. As an exception, it's traditional not to use this form
  when referring to module documentation; use `L<Module​::Name>' instead.

  References to other programs or functions are normally in the form of
  man page references so that cross-referencing tools can provide the user
  with links and the like. It's possible to overdo this, though, so be
  careful not to clutter your documentation with too much markup.

  The major headers should be set out using a `=head1' directive, and are
  historically written in the rather startling ALL UPPER CASE format,
  although this is not mandatory. Minor headers may be included using
  `=head2', and are typically in mixed case.

  The standard sections of a manual page are​:

  NAME
  Mandatory section; should be a comma-separated list of programs or
  functions documented by this podpage, such as​:

  foo, bar - programs to do something

  Manual page indexers are often extremely picky about the format of
  this section, so don't put anything in it except this line. A
  single dash, and only a single dash, should separate the list of
  programs or functions from the description. Functions should not be
  qualified with `()' or the like. The description should ideally fit
  on a single line, even if a man program replaces the dash with a few
  tabs.

  SYNOPSIS
  A short usage summary for programs and functions. This section is
  mandatory for section 3 pages.

  DESCRIPTION
  Extended description and discussion of the program or functions, or
  the body of the documentation for man pages that document something
  else. If particularly long, it's a good idea to break this up into
  subsections `=head2' directives like​:

  =head2 A Sample Subection

  =head2 Yet Another Sample Subection

  OPTIONS
  Detailed description of each of the command-line options taken by
  the program. This should be separate from the description for the
  use of things like Pod​::Usage. This is normally presented as a
  list, with each option as a separate `=item'. Options should be
  enclosed in B<>. Any values that the option takes should be
  enclosed in I<>. For example, the option --section=*manext* would
  be written​:

  B<--section>=I<manext>

  Synonymous options (like both the short and long forms) are
  separated by a comma and a space on the same `=item' line, or
  optionally listed as their own item with a reference to the
  canonical name.

  RETURN VALUE
  What the program or function returns, if successful. This section
  can be omitted for programs if they return 0 on success and
  something non-zero on failure, as is standard, and the precise exit
  codes aren't important.

  ERRORS
  Exceptions, return codes, exit stati, and errno settings. Typically
  used for function documentation; program documentation uses
  DIAGNOSTICS instead.

  DIAGNOSTICS
  All possible messages the program can print out--and what they mean.
  You may wish to follow the same documentation style as the Perl
  documentation; see perldiag(1) for more details (and look at the POD
  source as well).

  EXAMPLES
  Give some example uses of the program or function. Don't skimp;
  users often find this the most useful part of the documentation.
  The examples are generally given as verbatim paragraphs.

  ENVIRONMENT
  Environment variables that the program cares about, normally
  presented as a list using `=over', `=item', and `=back'. Since
  environment variables are normally in all uppercase, no additional
  special formatting is generally needed; they're glaring enough as it
  is.

  FILES
  All files used by the program or function, normally presented as a
  list, and what it uses them for. File names should be enclosed in
  F<>.

  CAVEATS
  Things to take special care with, sometimes called WARNINGS.

  BUGS
  Things that are broken or just don't work quite right.

  RESTRICTIONS
  Bugs you don't plan to fix. :-)

  NOTES
  Miscellaneous commentary.

  SEE ALSO
  Other man pages to check out, like man(1), man(7), makewhatis(8), or
  catman(8). Normally a simple list of man pages separated by commas,
  or a paragraph giving the name of a reference work. Man page
  references, if they use the standard `name(section)' form, don't
  have to be enclosed in L<>, but other things in this section
  probably should be when appropriate. You may need to use the
  `L<...|...>' syntax to keep pod2man and pod2text from being too
  verbose; see perlpod(1).

  AUTHOR
  Who wrote it (use AUTHORS for multiple people).

  HISTORY
  Programs derived from other sources sometimes have this, or you
  might keep a modification log here.

  In addition, some systems use CONFORMING TO to note conformance to
  relevant standards and MT-LEVEL to note safeness for use in threaded
  programs or signal handlers. These headings are primarily useful when
  documenting parts of a C library. Documentation of object-oriented
  libraries or modules may use CONSTRUCTORS and METHODS sections for
  detailed documentation of the parts of the library and save the
  DESCRIPTION section for an overview; other large modules may use
  FUNCTIONS for similar reasons. Some people use OVERVIEW to summarize
  the description if it's quite long. Sometimes there's an additional
  COPYRIGHT section at the bottom, for licensing terms.

  Section ordering varies, although NAME should *always* be the first
  section (you'll break some man page systems otherwise), and NAME,
  SYNOPSIS, DESCRIPTION, and OPTIONS generally always occur first and in
  that order if present. In general, SEE ALSO, AUTHOR, and similar
  material should be left for last. Some systems also move WARNINGS and
  NOTES to last. The order given above should be reasonable for most
  purposes.

  For additional information that may be more accurate for your specific
  system, see either man(5) or man(7) depending on your system manual
  section numbering conventions.

--
Russ Allbery (rra@​stanford.edu) <URL​:http​://www.eyrie.org/~eagle/>

@p5pRT
Copy link
Author

p5pRT commented Apr 22, 2003

@iabyn - Status changed from 'stalled' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant