| 1 |
|
|---|
| 2 | =for comment
|
|---|
| 3 | This document is in Pod format. To read this, use a Pod formatter,
|
|---|
| 4 | like "perldoc perlpod".
|
|---|
| 5 |
|
|---|
| 6 | =head1 NAME
|
|---|
| 7 | X<POD> X<plain old documentation>
|
|---|
| 8 |
|
|---|
| 9 | perlpod - the Plain Old Documentation format
|
|---|
| 10 |
|
|---|
| 11 | =head1 DESCRIPTION
|
|---|
| 12 |
|
|---|
| 13 | Pod is a simple-to-use markup language used for writing documentation
|
|---|
| 14 | for Perl, Perl programs, and Perl modules.
|
|---|
| 15 |
|
|---|
| 16 | Translators are available for converting Pod to various formats
|
|---|
| 17 | like plain text, HTML, man pages, and more.
|
|---|
| 18 |
|
|---|
| 19 | Pod markup consists of three basic kinds of paragraphs:
|
|---|
| 20 | L<ordinary|/"Ordinary Paragraph">,
|
|---|
| 21 | L<verbatim|/"Verbatim Paragraph">, and
|
|---|
| 22 | L<command|/"Command Paragraph">.
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 | =head2 Ordinary Paragraph
|
|---|
| 26 | X<POD, ordinary paragraph>
|
|---|
| 27 |
|
|---|
| 28 | Most paragraphs in your documentation will be ordinary blocks
|
|---|
| 29 | of text, like this one. You can simply type in your text without
|
|---|
| 30 | any markup whatsoever, and with just a blank line before and
|
|---|
| 31 | after. When it gets formatted, it will undergo minimal formatting,
|
|---|
| 32 | like being rewrapped, probably put into a proportionally spaced
|
|---|
| 33 | font, and maybe even justified.
|
|---|
| 34 |
|
|---|
| 35 | You can use formatting codes in ordinary paragraphs, for B<bold>,
|
|---|
| 36 | I<italic>, C<code-style>, L<hyperlinks|perlfaq>, and more. Such
|
|---|
| 37 | codes are explained in the "L<Formatting Codes|/"Formatting Codes">"
|
|---|
| 38 | section, below.
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 | =head2 Verbatim Paragraph
|
|---|
| 42 | X<POD, verbatim paragraph> X<verbatim>
|
|---|
| 43 |
|
|---|
| 44 | Verbatim paragraphs are usually used for presenting a codeblock or
|
|---|
| 45 | other text which does not require any special parsing or formatting,
|
|---|
| 46 | and which shouldn't be wrapped.
|
|---|
| 47 |
|
|---|
| 48 | A verbatim paragraph is distinguished by having its first character
|
|---|
| 49 | be a space or a tab. (And commonly, all its lines begin with spaces
|
|---|
| 50 | and/or tabs.) It should be reproduced exactly, with tabs assumed to
|
|---|
| 51 | be on 8-column boundaries. There are no special formatting codes,
|
|---|
| 52 | so you can't italicize or anything like that. A \ means \, and
|
|---|
| 53 | nothing else.
|
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 | =head2 Command Paragraph
|
|---|
| 57 | X<POD, command>
|
|---|
| 58 |
|
|---|
| 59 | A command paragraph is used for special treatment of whole chunks
|
|---|
| 60 | of text, usually as headings or parts of lists.
|
|---|
| 61 |
|
|---|
| 62 | All command paragraphs (which are typically only one line long) start
|
|---|
| 63 | with "=", followed by an identifier, followed by arbitrary text that
|
|---|
| 64 | the command can use however it pleases. Currently recognized commands
|
|---|
| 65 | are
|
|---|
| 66 |
|
|---|
| 67 | =pod
|
|---|
| 68 | =head1 Heading Text
|
|---|
| 69 | =head2 Heading Text
|
|---|
| 70 | =head3 Heading Text
|
|---|
| 71 | =head4 Heading Text
|
|---|
| 72 | =over indentlevel
|
|---|
| 73 | =item stuff
|
|---|
| 74 | =back
|
|---|
| 75 | =begin format
|
|---|
| 76 | =end format
|
|---|
| 77 | =for format text...
|
|---|
| 78 | =encoding type
|
|---|
| 79 | =cut
|
|---|
| 80 |
|
|---|
| 81 | To explain them each in detail:
|
|---|
| 82 |
|
|---|
| 83 | =over
|
|---|
| 84 |
|
|---|
| 85 | =item C<=head1 I<Heading Text>>
|
|---|
| 86 | X<=head1> X<=head2> X<=head3> X<=head4>
|
|---|
| 87 | X<head1> X<head2> X<head3> X<head4>
|
|---|
| 88 |
|
|---|
| 89 | =item C<=head2 I<Heading Text>>
|
|---|
| 90 |
|
|---|
| 91 | =item C<=head3 I<Heading Text>>
|
|---|
| 92 |
|
|---|
| 93 | =item C<=head4 I<Heading Text>>
|
|---|
| 94 |
|
|---|
| 95 | Head1 through head4 produce headings, head1 being the highest
|
|---|
| 96 | level. The text in the rest of this paragraph is the content of the
|
|---|
| 97 | heading. For example:
|
|---|
| 98 |
|
|---|
| 99 | =head2 Object Attributes
|
|---|
| 100 |
|
|---|
| 101 | The text "Object Attributes" comprises the heading there. (Note that
|
|---|
| 102 | head3 and head4 are recent additions, not supported in older Pod
|
|---|
| 103 | translators.) The text in these heading commands can use
|
|---|
| 104 | formatting codes, as seen here:
|
|---|
| 105 |
|
|---|
| 106 | =head2 Possible Values for C<$/>
|
|---|
| 107 |
|
|---|
| 108 | Such commands are explained in the
|
|---|
| 109 | "L<Formatting Codes|/"Formatting Codes">" section, below.
|
|---|
| 110 |
|
|---|
| 111 | =item C<=over I<indentlevel>>
|
|---|
| 112 | X<=over> X<=item> X<=back> X<over> X<item> X<back>
|
|---|
| 113 |
|
|---|
| 114 | =item C<=item I<stuff...>>
|
|---|
| 115 |
|
|---|
| 116 | =item C<=back>
|
|---|
| 117 |
|
|---|
| 118 | Item, over, and back require a little more explanation: "=over" starts
|
|---|
| 119 | a region specifically for the generation of a list using "=item"
|
|---|
| 120 | commands, or for indenting (groups of) normal paragraphs. At the end
|
|---|
| 121 | of your list, use "=back" to end it. The I<indentlevel> option to
|
|---|
| 122 | "=over" indicates how far over to indent, generally in ems (where
|
|---|
| 123 | one em is the width of an "M" in the document's base font) or roughly
|
|---|
| 124 | comparable units; if there is no I<indentlevel> option, it defaults
|
|---|
| 125 | to four. (And some formatters may just ignore whatever I<indentlevel>
|
|---|
| 126 | you provide.) In the I<stuff> in C<=item I<stuff...>>, you may
|
|---|
| 127 | use formatting codes, as seen here:
|
|---|
| 128 |
|
|---|
| 129 | =item Using C<$|> to Control Buffering
|
|---|
| 130 |
|
|---|
| 131 | Such commands are explained in the
|
|---|
|
|---|