Plain Old Documentation Article Index for
Plain Old
Website Links For
Plain
 

Information About

Plain Old Documentation




Platform-independent documentation tool for the Computer Language
Perl .


INTENT


POD is designed to be a simple, clean language with just enough Syntax to be useful. It purposefully does not include built-in mechanisms for Fonts , Images , Colors or Tables ; instead it attempts to be just large enough to be useful. Some of its goals are:
  • Easy to parse

  • Easy to convert to other languages, such as HTML or TeX

  • Easy to include sample code in

  • Easy to read without a POD formatter (i.e. in its source-code form)

  • Easy to write in--otherwise programmers won't write the documentation!


Although the author of perlpod notes that "The
Pod format is not necessarily sufficient for writing a book", books have in fact been written in an
extended version of POD; this special version included formatting codes for tables and footnotes,
and is used by O'Reilly & Associates to produce several Perl books, most notably
'' Programming Perl '' by Larry Wall, Tom Christiansen, and Jon Orwant.


USE


POD is the language used for most documentation in the Perl world. This includes Perl itself,
nearly all publicly-released Modules , many Script s, most
design documents, many articles on Perl.com and other Perl-related web sites,
and the Parrot Virtual Machine .

POD is rarely read in the raw, although it is designed to readable without the assistance of a
formatting tool. Instead, it is read with the Perldoc tool, or converted into Unix
Man Page s or Web-standard HTML pages.

Pure POD files usually have the extension .pod, but POD is mostly used directly in Perl
code, which typically uses the .pl and .pm extensions. (The Perl
Interpreter 's Parser is designed to ignore POD in Perl code.)


SAMPLE POD DOCUMENT


This document is syntactically correct POD, which attempts to follow the major conventions on
section naming as well.

=head1 NAME

podsample - A sample POD document

=head1 SYNOPSIS

->isa(Piece::Of::Code);
print <<"END";
This indented block will not be scanned for formatting
codes or directives, and spacing will be preserved.
END

=head1 DESCRIPTION

Here's some normal text. It includes text that is
B, I, U, and
C<>-formatted.

=head2 An Example List

=over 4

  • This is a bulleted list.


  • Here's another item.


=back 4

=begin html

<img src="fig1.png" align="right" alt="Figure 1." />
<p>
Here's some embedded HTML. In this block I can
include images, apply <span style="color: green">
styles</span>, or do anything else I can do with
HTML. POD parsers that aren't outputting HTML will
completely ignore it.
</p>

=end html

=head1 SEE ALSO

L, L, L.

=head1 COPYRIGHT

Copyright 2005 J. Random Hacker .

Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation
License, Version 1.2 or any later version published by the
Free Software Foundation; with no Invariant Sections, with
no Front-Cover Texts, and with no Back-Cover Texts.

=cut


POD FORMATTING DETAILS


POD files are written in an ASCII -compatible Encoding , such as Latin-1 or Unicode .
A POD parser always assumes that the file it is parsing doesn't start with POD; it ignores all lines
until it sees a POD directive. POD directives must come at the beginning of a line, and all begin
with an equal sign. The POD parser will then assume that all following lines are POD, until it
encounters a line consisting of the "=cut" directive. Any content following that is ignored until
the parser encounters another POD directive. Thus, POD can be intermixed with executable source
code if the language's parser knows how to recognize and ignore POD.

POD content is divided into paragraphs by empty lines. Paragraphs that begin with
Whitespace characters--tabs or spaces--are considered to be "verbatim paragraphs", and are left
completely unformatted; these are used for sample code, ASCII Art , etc. Paragraphs that begin
with an equal sign are "command paragraphs"; the sequence of alphanumeric characters immediately
following the equal sign is treated as a POD directive, and the rest of the paragraph is formatted
according to that directive. Some directives also affect the following paragraphs. If a paragraph
starts with something besides an equal sign or whitespace, it's considered an "ordinary paragraph".

Both ordinary paragraphs and the contents of command paragraphs are parsed for formatting codes.
Formatting in POD is very plain; it's mainly limited to bold, italic, underlined, monospaced, and a
few other formats. There is also a code for linking between POD documents or to another section
within the same document. Formatting codes consist of either:

  • A single uppercase letter, followed by a greater-than sign (<), the content to be formatted, and a less-than sign (>), e.g. B, ''or''

  • A single uppercase letter, two or more greater-than signs (<<), a space, the content to be formatted, another space, and the same number of less-than signs as were used before, e.g. B<< bolded text >>. This form is often used for code snippets containing a greater-than sign, which would otherwise end the formatting code.


Commands in POD include four levels of headings, bulleted and numbered lists, and commands to mark
sections as being in another language. The latter feature allows for special formatting to be
given to parsers that support it.


SEE ALSO



REFERENCES

  • Wall, Larry; Christiansen, Tom; & Orwant, Jon (2000). '' Programming Perl '' (3rd ed.). Sebastopol: O'Reilly & Associates. ISBN 0-12-345678-9.



EXTERNAL LINKS