b51c9f8fc5615429ebeb96c23f87eafda7b16538
[p5sagit/p5-mst-13.2.git] / pod / perlpod.pod
1 =head1 NAME
2
3 pod - plain old documentation
4
5 =head1 DESCRIPTION
6
7 A pod-to-whatever translator reads a pod file paragraph by paragraph,
8 and translates it to the appropriate output format.  There are
9 three kinds of paragraphs:
10
11 =over 4
12
13 =item *
14
15 A verbatim paragraph, distinguished by being indented (that is,
16 it starts with space or tab).  It should be reproduced exactly,
17 with tabs assumed to be on 8-column boundaries.  There are no
18 special formatting escapes, so you can't italicize or anything
19 like that.  A \ means \, and nothing else.
20
21 =item *
22
23 A command.  All command paragraphs start with "=", followed by an
24 identifier, followed by arbitrary text that the command can
25 use however it pleases.  Currently recognized commands are
26
27     =head1 heading
28     =head2 heading
29     =item text
30     =over N
31     =back
32     =cut
33
34 =item *
35
36 An ordinary block of text.  It will be filled, and maybe even
37 justified.  Certain interior sequences are recognized both
38 here and in commands:
39
40     I<text>     italicize text, used for emphasis or variables
41     B<text>     embolden text, used for switches and programs
42     S<text>     text contains non-breaking spaces
43     C<code>     literal code 
44     L<name>     A link (cross reference) to name
45                     L<name>             manpage
46                     L<name/ident>       item in manpage
47                     L<name/"sec">       section in other manpage
48                     L<"sec">            section in this manpage
49                                         (the quotes are optional)
50     F<file>     Used for filenames
51     Z<>         A zero-width character
52
53 That's it.  The intent is simplicity, not power.  I wanted paragraphs
54 to look like paragraphs (block format), so that they stand out
55 visually, and so that I could run them through fmt easily to reformat
56 them (that's F7 in my version of B<vi>).  I wanted the translator (and not
57 me) to worry about whether " or ' is a left quote or a right quote
58 within filled text, and I wanted it to leave the quotes alone dammit in
59 verbatim mode, so I could slurp in a working program, shift it over 4
60 spaces, and have it print out, er, verbatim.  And presumably in a
61 constant width font.
62
63 In particular, you can leave things like this verbatim in your text:
64
65     Perl
66     FILEHANDLE
67     $variable
68     function()
69     manpage(3r)
70
71 Doubtless a few other commands or sequences will need to be added along
72 the way, but I've gotten along surprisingly well with just these.
73
74 Note that I'm not at all claiming this to be sufficient for producing a
75 book.  I'm just trying to make an idiot-proof common source for nroff,
76 TeX, and other markup languages, as used for online documentation.
77 Both B<pod2html> and B<pod2man> translators exist.
78
79 =head1 Embedding Pods in Perl Modules
80
81 You can embed pod documentation in your Perl scripts.  Start your
82 documentation with a =head1 command at the beg, and end it with 
83 an =cut command.  Perl will ignore the pod text.  See any of the
84 supplied library modules for examples.
85
86 =head1 Author
87
88 Larry Wall
89