home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / MacPerl 5.0.3 / MacPerl Source ƒ / MacPerl5 / pod / perlpod.doc < prev    next >
Encoding:
Text File  |  1995-01-15  |  2.9 KB  |  87 lines  |  [TEXT/MPS ]

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