Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1 | \documentclass{howto} |
| 2 | \usepackage{ltxmarkup} |
| 3 | |
| 4 | \title{Documenting Python} |
| 5 | |
| 6 | \input{boilerplate} |
| 7 | |
Fred Drake | c7c9a64 | 1999-04-28 18:24:02 +0000 | [diff] [blame] | 8 | % Now override the stuff that includes author information; |
| 9 | % Guido did *not* write this one! |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 10 | |
| 11 | \author{Fred L. Drake, Jr.} |
| 12 | \authoraddress{ |
Fred Drake | 8fdb638 | 2000-10-28 04:08:38 +0000 | [diff] [blame] | 13 | PythonLabs \\ |
| 14 | E-mail: \email{fdrake@acm.org} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 15 | } |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 16 | |
| 17 | |
| 18 | \begin{document} |
| 19 | |
| 20 | \maketitle |
| 21 | |
| 22 | \begin{abstract} |
| 23 | \noindent |
Fred Drake | 0299749 | 2000-09-21 05:26:43 +0000 | [diff] [blame] | 24 | The Python language has a substantial body of |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 25 | documentation, much of it contributed by various authors. The markup |
| 26 | used for the Python documentation is based on \LaTeX{} and requires a |
| 27 | significant set of macros written specifically for documenting Python. |
Fred Drake | 5eb992b | 1999-06-11 14:25:45 +0000 | [diff] [blame] | 28 | This document describes the macros introduced to support Python |
| 29 | documentation and how they should be used to support a wide range of |
| 30 | output formats. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 31 | |
| 32 | This document describes the document classes and special markup used |
| 33 | in the Python documentation. Authors may use this guide, in |
| 34 | conjunction with the template files provided with the |
| 35 | distribution, to create or maintain whole documents or sections. |
| 36 | \end{abstract} |
| 37 | |
| 38 | \tableofcontents |
| 39 | |
| 40 | |
| 41 | \section{Introduction} |
| 42 | |
| 43 | Python's documentation has long been considered to be good for a |
| 44 | free programming language. There are a number of reasons for this, |
| 45 | the most important being the early commitment of Python's creator, |
| 46 | Guido van Rossum, to providing documentation on the language and its |
| 47 | libraries, and the continuing involvement of the user community in |
| 48 | providing assistance for creating and maintaining documentation. |
| 49 | |
| 50 | The involvement of the community takes many forms, from authoring to |
Fred Drake | 7a737df | 1999-04-23 14:41:44 +0000 | [diff] [blame] | 51 | bug reports to just plain complaining when the documentation could |
| 52 | be more complete or easier to use. All of these forms of input from |
| 53 | the community have proved useful during the time I've been involved |
| 54 | in maintaining the documentation. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 55 | |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 56 | This document is aimed at authors and potential authors of |
Fred Drake | 7a737df | 1999-04-23 14:41:44 +0000 | [diff] [blame] | 57 | documentation for Python. More specifically, it is for people |
| 58 | contributing to the standard documentation and developing additional |
| 59 | documents using the same tools as the standard documents. This |
| 60 | guide will be less useful for authors using the Python documentation |
| 61 | tools for topics other than Python, and less useful still for |
| 62 | authors not using the tools at all. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 63 | |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 64 | The material in this guide is intended to assist authors using the |
| 65 | Python documentation tools. It includes information on the source |
| 66 | distribution of the standard documentation, a discussion of the |
Fred Drake | 7a737df | 1999-04-23 14:41:44 +0000 | [diff] [blame] | 67 | document types, reference material on the markup defined in the |
| 68 | document classes, a list of the external tools needed for processing |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 69 | documents, and reference material on the tools provided with the |
| 70 | documentation resources. At the end, there is also a section |
Fred Drake | 7a737df | 1999-04-23 14:41:44 +0000 | [diff] [blame] | 71 | discussing future directions for the Python documentation and where |
| 72 | to turn for more information. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 73 | |
| 74 | \section{Directory Structure} |
| 75 | |
| 76 | The source distribution for the standard Python documentation |
| 77 | contains a large number of directories. While third-party documents |
| 78 | do not need to be placed into this structure or need to be placed |
| 79 | within a similar structure, it can be helpful to know where to look |
| 80 | for examples and tools when developing new documents using the |
| 81 | Python documentation tools. This section describes this directory |
| 82 | structure. |
| 83 | |
| 84 | The documentation sources are usually placed within the Python |
Fred Drake | 7a737df | 1999-04-23 14:41:44 +0000 | [diff] [blame] | 85 | source distribution as the top-level directory \file{Doc/}, but |
| 86 | are not dependent on the Python source distribution in any way. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 87 | |
| 88 | The \file{Doc/} directory contains a few files and several |
| 89 | subdirectories. The files are mostly self-explanatory, including a |
| 90 | \file{README} and a \file{Makefile}. The directories fall into |
| 91 | three categories: |
| 92 | |
| 93 | \begin{definitions} |
| 94 | \term{Document Sources} |
| 95 | The \LaTeX{} sources for each document are placed in a |
Fred Drake | 0299749 | 2000-09-21 05:26:43 +0000 | [diff] [blame] | 96 | separate directory. These directories are given short |
| 97 | names which vaguely indicate the document in each: |
Fred Drake | 2f4bebd | 1999-04-28 16:43:11 +0000 | [diff] [blame] | 98 | |
| 99 | \begin{tableii}{p{.75in}|p{3in}}{filenq}{Directory}{Document Title} |
Fred Drake | 31edf4d | 2000-09-07 20:06:07 +0000 | [diff] [blame] | 100 | \lineii{api/} |
| 101 | {\citetitle[../api/api.html]{The Python/C API}} |
| 102 | \lineii{dist/} |
| 103 | {\citetitle[../dist/dist.html]{Distributing Python Modules}} |
| 104 | \lineii{doc/} |
| 105 | {\citetitle[../doc/doc.html]{Documenting Python}} |
| 106 | \lineii{ext/} |
| 107 | {\citetitle[../ext/ext.html]{Extending and Embedding the Python Interpreter}} |
| 108 | \lineii{inst/} |
| 109 | {\citetitle[../inst/inst.html]{Installing Python Modules}} |
| 110 | \lineii{lib/} |
| 111 | {\citetitle[../lib/lib.html]{Python Library Reference}} |
| 112 | \lineii{mac/} |
| 113 | {\citetitle[../mac/mac.html]{Macintosh Module Reference}} |
| 114 | \lineii{ref/} |
| 115 | {\citetitle[../ref/ref.html]{Python Reference Manual}} |
| 116 | \lineii{tut/} |
| 117 | {\citetitle[../tut/tut.html]{Python Tutorial}} |
Fred Drake | 2f4bebd | 1999-04-28 16:43:11 +0000 | [diff] [blame] | 118 | \end{tableii} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 119 | |
| 120 | \term{Format-Specific Output} |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 121 | Most output formats have a directory which contains a |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 122 | \file{Makefile} which controls the generation of that format |
| 123 | and provides storage for the formatted documents. The only |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 124 | variations within this category are the Portable Document |
| 125 | Format (PDF) and PostScript versions are placed in the |
Fred Drake | 7a737df | 1999-04-23 14:41:44 +0000 | [diff] [blame] | 126 | directories \file{paper-a4/} and \file{paper-letter/} (this |
| 127 | causes all the temporary files created by \LaTeX{} to be kept |
| 128 | in the same place for each paper size, where they can be more |
| 129 | easily ignored). |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 130 | |
Fred Drake | 2f4bebd | 1999-04-28 16:43:11 +0000 | [diff] [blame] | 131 | \begin{tableii}{p{.75in}|p{3in}}{filenq}{Directory}{Output Formats} |
| 132 | \lineii{html/}{HTML output} |
| 133 | \lineii{info/}{GNU info output} |
| 134 | \lineii{paper-a4/}{PDF and PostScript, A4 paper} |
| 135 | \lineii{paper-letter/}{PDF and PostScript, US-Letter paper} |
| 136 | \end{tableii} |
| 137 | |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 138 | \term{Supplemental Files} |
| 139 | Some additional directories are used to store supplemental |
| 140 | files used for the various processes. Directories are |
| 141 | included for the shared \LaTeX{} document classes, the |
| 142 | \LaTeX2HTML support, template files for various document |
| 143 | components, and the scripts used to perform various steps in |
| 144 | the formatting processes. |
Fred Drake | 2f4bebd | 1999-04-28 16:43:11 +0000 | [diff] [blame] | 145 | |
| 146 | \begin{tableii}{p{.75in}|p{3in}}{filenq}{Directory}{Contents} |
| 147 | \lineii{perl/}{Support for \LaTeX2HTML processing} |
| 148 | \lineii{templates/}{Example files for source documents} |
| 149 | \lineii{texinputs/}{Style implementation for \LaTeX} |
| 150 | \lineii{tools/}{Custom processing scripts} |
| 151 | \end{tableii} |
| 152 | |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 153 | \end{definitions} |
| 154 | |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 155 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 156 | \section{\LaTeX{} Primer \label{latex-primer}} |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 157 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 158 | This section is a brief introduction to \LaTeX{} concepts and |
| 159 | syntax, to provide authors enough information to author documents |
| 160 | productively without having to become ``\TeX{}nicians.'' |
| 161 | |
Fred Drake | 5eb992b | 1999-06-11 14:25:45 +0000 | [diff] [blame] | 162 | Perhaps the most important concept to keep in mind while marking up |
Fred Drake | 0299749 | 2000-09-21 05:26:43 +0000 | [diff] [blame] | 163 | Python documentation is that while \TeX{} is unstructured, \LaTeX{} was |
Fred Drake | 5eb992b | 1999-06-11 14:25:45 +0000 | [diff] [blame] | 164 | designed as a layer on top of \TeX{} which specifically supports |
| 165 | structured markup. The Python-specific markup is intended to extend |
| 166 | the structure provided by standard \LaTeX{} document classes to |
| 167 | support additional information specific to Python. |
| 168 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 169 | \LaTeX{} documents contain two parts: the preamble and the body. |
| 170 | The preamble is used to specify certain metadata about the document |
| 171 | itself, such as the title, the list of authors, the date, and the |
| 172 | \emph{class} the document belongs to. Additional information used |
| 173 | to control index generation and the use of bibliographic databases |
Fred Drake | 7a737df | 1999-04-23 14:41:44 +0000 | [diff] [blame] | 174 | can also be placed in the preamble. For most authors, the preamble |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 175 | can be most easily created by copying it from an existing document |
| 176 | and modifying a few key pieces of information. |
| 177 | |
| 178 | The \dfn{class} of a document is used to place a document within a |
| 179 | broad category of documents and set some fundamental formatting |
| 180 | properties. For Python documentation, two classes are used: the |
| 181 | \code{manual} class and the \code{howto} class. These classes also |
| 182 | define the additional markup used to document Python concepts and |
| 183 | structures. Specific information about these classes is provided in |
Fred Drake | 7a737df | 1999-04-23 14:41:44 +0000 | [diff] [blame] | 184 | section \ref{classes}, ``Document Classes,'' below. The first thing |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 185 | in the preamble is the declaration of the document's class. |
| 186 | |
| 187 | After the class declaration, a number of \emph{macros} are used to |
| 188 | provide further information about the document and setup any |
Fred Drake | 7a737df | 1999-04-23 14:41:44 +0000 | [diff] [blame] | 189 | additional markup that is needed. No output is generated from the |
| 190 | preamble; it is an error to include free text in the preamble |
| 191 | because it would cause output. |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 192 | |
| 193 | The document body follows the preamble. This contains all the |
Fred Drake | 63568aa | 2000-10-19 05:36:10 +0000 | [diff] [blame] | 194 | printed components of the document marked up structurally. Generic |
| 195 | \LaTeX{} structures include hierarchical sections |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 196 | |
Fred Drake | 63568aa | 2000-10-19 05:36:10 +0000 | [diff] [blame] | 197 | \subsection{Syntax} |
| 198 | |
| 199 | There are only a things that an author of Python documentation |
| 200 | needs to know about \LaTeX{} syntax. |
| 201 | |
| 202 | A \dfn{comment} is started by the ``percent'' character |
| 203 | (\character{\%}) and continues through the end of the line and all |
| 204 | leading whitespace on the following line. This is a little |
| 205 | different from any programming language I know of, so an example |
| 206 | is in order: |
| 207 | |
| 208 | \begin{verbatim} |
| 209 | This is text.% comment |
| 210 | This is more text. % another comment |
| 211 | Still more text. |
| 212 | \end{verbatim} |
| 213 | |
| 214 | The first non-comment character following the first comment is the |
| 215 | letter \character{T} on the second line; the leading whitespace on |
| 216 | that line is consumed as part of the first comment. This means |
| 217 | that there is no space between the first and second sentences, so |
| 218 | the period and letter \character{T} will be directly adjacent in |
| 219 | the typeset document. |
| 220 | |
| 221 | Note also that though the first non-comment character after the |
| 222 | second comment is the letter \character{S}, there is whitespace |
| 223 | preceding the comment, so the two sentences are separated as |
| 224 | expected. |
| 225 | |
| 226 | A \dfn{group} is an enclosure for a collection of text and |
| 227 | commands which encloses the formatting context and constrains the |
| 228 | scope of any changes to that context made by commands within the |
| 229 | group. Groups can be nested hierarchically. The formatting |
| 230 | context includes the font and the definition of additional macros |
| 231 | (or overrides of macros defined in outer groups). Syntactically, |
| 232 | groups are enclosed in braces: |
| 233 | |
| 234 | \begin{verbatim} |
| 235 | {text in a group} |
| 236 | \end{verbatim} |
| 237 | |
| 238 | An alternate syntax for a group using brackets (\code{\{...\}}) is |
| 239 | used by macros and environment constructors which take optional |
| 240 | parameters; brackets do not normally hold syntactic significance. |
| 241 | A degenerate group, containing only one atomic bit of content, |
| 242 | does not need to have an explicit group, unless it is required to |
| 243 | avoid ambiguity. Since Python tends toward the explicit, groups |
| 244 | are also made explicit in the documentation markup. |
| 245 | |
| 246 | Groups are used only sparingly in the Python documentation, except |
| 247 | for their use in marking parameters to macros and environments. |
| 248 | |
| 249 | A \dfn{macro} is usually simple construct which is identified by |
| 250 | name and can take some number of parameters. In normal \LaTeX{} |
| 251 | usage, one of these can be optional. The markup is introduced |
| 252 | using the backslash character (\character{\e}), and the name is |
| 253 | given by alphabetic characters (no digits, hyphens, or |
| 254 | underscores). Required parameters should be marked as a group, |
| 255 | and optional parameters should be marked using the alternate |
| 256 | syntax for a group. |
| 257 | |
| 258 | For example, a macro named ``foo'' which takes a single parameter |
| 259 | would appear like this: |
| 260 | |
| 261 | \begin{verbatim} |
| 262 | \name{parameter} |
| 263 | \end{verbatim} |
| 264 | |
| 265 | A macro which takes an optional parameter would be typed like this |
| 266 | when the optional paramter is given: |
| 267 | |
| 268 | \begin{verbatim} |
| 269 | \name[optional] |
| 270 | \end{verbatim} |
| 271 | |
| 272 | If both optional and required parameters are to be required, it |
| 273 | looks like this: |
| 274 | |
| 275 | \begin{verbatim} |
| 276 | \name[optional]{required} |
| 277 | \end{verbatim} |
| 278 | |
| 279 | A macro name may be followed by a space or newline; a space |
| 280 | between the macro name and any parameters will be consumed, but |
| 281 | this usage is not practiced in the Python documentation. Such a |
| 282 | space is still consumed if there are no parameters to the marco, |
| 283 | in which case inserting an empty group (\code{\{\}}) or explicit |
| 284 | word space (\samp{\e\ }) immediately after the macro name helps to |
| 285 | avoid running the expansion of the macro into the following text. |
| 286 | Macros which take no parameters but which should not be followed |
| 287 | by a word space do not need special treatment if the following |
| 288 | character in the document source if not a name character (such as |
| 289 | puctuation). |
| 290 | |
| 291 | Each line of this example shows an appropriate way to write text |
| 292 | which includes a macro which takes no parameters: |
| 293 | |
| 294 | \begin{verbatim} |
| 295 | This \UNIX{} is followed by a space. |
| 296 | This \UNIX\ is also followed by a space. |
| 297 | \UNIX, followed by a comma, needs no additional markup. |
| 298 | \end{verbatim} |
| 299 | |
Fred Drake | d097d48 | 2000-10-20 20:51:31 +0000 | [diff] [blame] | 300 | An \dfn{environment} is a larger construct than a macro, and can |
| 301 | be used for things with more content that would conveniently fit |
| 302 | in a macro parameter. They are primarily used when formatting |
| 303 | parameters need to be changed before and after a large chunk of |
| 304 | content, but the content itself needs to be highly flexible. Code |
| 305 | samples are presented using an environment, and descriptions of |
| 306 | functions, methods, and classes are also marked using envionments. |
| 307 | |
| 308 | Since the content of an environment is free-form and can consist |
| 309 | of several paragraphs, they are actually marked using a pair of |
| 310 | macros: \macro{begin} and \macro{end}. These macros both take the |
| 311 | name of the environment as a parameter. An example is the |
| 312 | environment used to mark the abstract of a document: |
| 313 | |
| 314 | \begin{verbatim} |
| 315 | \begin{abstract} |
| 316 | This is the text of the abstract. It concisely explains what |
| 317 | information is found in the document. |
| 318 | |
| 319 | It can consist of multiple paragraphs. |
| 320 | \end{abstract} |
| 321 | \end{verbatim} |
| 322 | |
| 323 | An environment can also have required and optional parameters of |
| 324 | its own. These follow the parameter of the \macro{begin} macro. |
| 325 | This example shows an environment which takes a single required |
| 326 | parameter: |
| 327 | |
| 328 | \begin{verbatim} |
| 329 | \begin{datadesc}{datadesc}{controlnames} |
| 330 | A 33-element string array that contains the \ASCII{} mnemonics for |
| 331 | the thirty-two \ASCII{} control characters from 0 (NUL) to 0x1f |
| 332 | (US), in order, plus the mnemonic \samp{SP} for the space character. |
| 333 | \end{datadesc} |
| 334 | \end{verbatim} |
Fred Drake | 63568aa | 2000-10-19 05:36:10 +0000 | [diff] [blame] | 335 | |
| 336 | There are a number of less-used marks in \LaTeX{} are used to |
| 337 | enter non-\ASCII{} characters, especially those used in European |
Fred Drake | d097d48 | 2000-10-20 20:51:31 +0000 | [diff] [blame] | 338 | names. Given that these are often used adjacent to other |
| 339 | characters, the markup required to produce the proper character |
| 340 | may need to be followed by a space or an empty group, or the the |
| 341 | markup can be enclosed in a group. Some which are found in Python |
| 342 | documentation are: |
Fred Drake | 63568aa | 2000-10-19 05:36:10 +0000 | [diff] [blame] | 343 | |
Fred Drake | d097d48 | 2000-10-20 20:51:31 +0000 | [diff] [blame] | 344 | \begin{tableii}{c|l}{textrm}{Character}{Markup} |
| 345 | \lineii{\c c}{\code{\e c c}} |
| 346 | \lineii{\"o}{\code{\e"o}} |
| 347 | \lineii{\o}{\code{\e o}} |
| 348 | \end{tableii} |
Fred Drake | 63568aa | 2000-10-19 05:36:10 +0000 | [diff] [blame] | 349 | |
| 350 | |
| 351 | \subsection{Hierarchical Structure} |
| 352 | |
Fred Drake | d097d48 | 2000-10-20 20:51:31 +0000 | [diff] [blame] | 353 | \LaTeX{} expects documents to be arranged in a conventional, |
| 354 | hierarchical way, with chapters, sections, sub-sections, |
| 355 | appendixes, and the like. These are marked using macros rather |
| 356 | than environments, probably because the end of a section can be |
| 357 | safely inferred when a section of equal or higher level starts. |
| 358 | |
| 359 | There are six ``levels'' of sectioning in the document classes |
| 360 | used for Python documentation, and the lowest two levels are not |
| 361 | used. The levels are: |
| 362 | |
| 363 | \begin{tableiii}{c|l|c}{textrm}{Level}{Macro Name}{Notes} |
| 364 | \lineiii{1}{\macro{chapter}}{(1)} |
| 365 | \lineiii{2}{\macro{section}}{} |
| 366 | \lineiii{3}{\macro{subsection}}{} |
Fred Drake | b7a52c9 | 2000-11-27 20:10:18 +0000 | [diff] [blame] | 367 | \lineiii{4}{\macro{subsubsection}}{} |
Fred Drake | d097d48 | 2000-10-20 20:51:31 +0000 | [diff] [blame] | 368 | \lineiii{5}{\macro{paragraph}}{(2)} |
| 369 | \lineiii{6}{\macro{subparagraph}}{} |
| 370 | \end{tableiii} |
| 371 | |
| 372 | \noindent |
| 373 | Notes: |
| 374 | |
| 375 | \begin{description} |
| 376 | \item[(1)] |
| 377 | Only used for the \code{manual} documents, as described in |
| 378 | section \ref{classes}, ``Document Classes.'' |
| 379 | \item[(2)] |
| 380 | Not the same as a paragraph of text; nobody seems to use this. |
| 381 | \end{description} |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 382 | |
| 383 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 384 | \section{Document Classes \label{classes}} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 385 | |
| 386 | Two \LaTeX{} document classes are defined specifically for use with |
| 387 | the Python documentation. The \code{manual} class is for large |
| 388 | documents which are sectioned into chapters, and the \code{howto} |
| 389 | class is for smaller documents. |
| 390 | |
| 391 | The \code{manual} documents are larger and are used for most of the |
| 392 | standard documents. This document class is based on the standard |
| 393 | \LaTeX{} \code{report} class and is formatted very much like a long |
Fred Drake | 698d520 | 1999-11-10 15:54:57 +0000 | [diff] [blame] | 394 | technical report. The \citetitle[../ref/ref.html]{Python Reference |
| 395 | Manual} is a good example of a \code{manual} document, and the |
| 396 | \citetitle[../lib/lib.html]{Python Library Reference} is a large |
| 397 | example. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 398 | |
| 399 | The \code{howto} documents are shorter, and don't have the large |
| 400 | structure of the \code{manual} documents. This class is based on |
| 401 | the standard \LaTeX{} \code{article} class and is formatted somewhat |
| 402 | like the Linux Documentation Project's ``HOWTO'' series as done |
| 403 | originally using the LinuxDoc software. The original intent for the |
| 404 | document class was that it serve a similar role as the LDP's HOWTO |
| 405 | series, but the applicability of the class turns out to be somewhat |
Fred Drake | 0299749 | 2000-09-21 05:26:43 +0000 | [diff] [blame] | 406 | broader. This class is used for ``how-to'' documents (this |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 407 | document is an example) and for shorter reference manuals for small, |
| 408 | fairly cohesive module libraries. Examples of the later use include |
Fred Drake | 698d520 | 1999-11-10 15:54:57 +0000 | [diff] [blame] | 409 | the standard \citetitle[../mac/mac.html]{Macintosh Library Modules} |
| 410 | and |
Fred Drake | 6a547c7 | 2000-09-15 22:11:24 +0000 | [diff] [blame] | 411 | \citetitle[http://starship.python.net/crew/fdrake/manuals/krb5py/krb5py.html]{Using |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 412 | Kerberos from Python}, which contains reference material for an |
| 413 | extension package. These documents are roughly equivalent to a |
| 414 | single chapter from a larger work. |
| 415 | |
| 416 | |
Fred Drake | 7a737df | 1999-04-23 14:41:44 +0000 | [diff] [blame] | 417 | \section{Special Markup Constructs} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 418 | |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 419 | The Python document classes define a lot of new environments and |
| 420 | macros. This section contains the reference material for these |
| 421 | facilities. |
| 422 | |
Fred Drake | af2b714 | 2000-09-14 20:11:05 +0000 | [diff] [blame] | 423 | \subsection{Markup for the Preamble \label{preamble-info}} |
| 424 | |
| 425 | \begin{macrodesc}{release}{\p{ver}} |
| 426 | Set the version number for the software described in the |
| 427 | document. |
| 428 | \end{macrodesc} |
| 429 | |
| 430 | \begin{macrodesc}{setshortversion}{\p{sver}} |
| 431 | Specify the ``short'' version number of the documented software |
| 432 | to be \var{sver}. |
| 433 | \end{macrodesc} |
| 434 | |
Fred Drake | e15956b | 2000-04-03 04:51:13 +0000 | [diff] [blame] | 435 | \subsection{Meta-information Markup \label{meta-info}} |
| 436 | |
| 437 | \begin{macrodesc}{sectionauthor}{\p{author}\p{email}} |
| 438 | Identifies the author of the current section. \var{author} |
| 439 | should be the author's name such that it can be used for |
| 440 | presentation (though it isn't), and \var{email} should be the |
| 441 | author's email address. The domain name portion of |
| 442 | the address should be lower case. |
| 443 | |
| 444 | No presentation is generated from this markup, but it is used to |
| 445 | help keep track of contributions. |
| 446 | \end{macrodesc} |
| 447 | |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 448 | \subsection{Information Units \label{info-units}} |
| 449 | |
Fred Drake | 2f4bebd | 1999-04-28 16:43:11 +0000 | [diff] [blame] | 450 | XXX Explain terminology, or come up with something more ``lay.'' |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 451 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 452 | There are a number of environments used to describe specific |
| 453 | features provided by modules. Each environment requires |
| 454 | parameters needed to provide basic information about what is being |
| 455 | described, and the environment content should be the description. |
| 456 | Most of these environments make entries in the general index (if |
| 457 | one is being produced for the document); if no index entry is |
| 458 | desired, non-indexing variants are available for many of these |
| 459 | environments. The environments have names of the form |
| 460 | \code{\var{feature}desc}, and the non-indexing variants are named |
| 461 | \code{\var{feature}descni}. The available variants are explicitly |
| 462 | included in the list below. |
| 463 | |
| 464 | For each of these environments, the first parameter, \var{name}, |
| 465 | provides the name by which the feature is accessed. |
| 466 | |
| 467 | Environments which describe features of objects within a module, |
| 468 | such as object methods or data attributes, allow an optional |
| 469 | \var{type name} parameter. When the feature is an attribute of |
| 470 | class instances, \var{type name} only needs to be given if the |
| 471 | class was not the most recently described class in the module; the |
| 472 | \var{name} value from the most recent \env{classdesc} is implied. |
| 473 | For features of built-in or extension types, the \var{type name} |
Fred Drake | 7a737df | 1999-04-23 14:41:44 +0000 | [diff] [blame] | 474 | value should always be provided. Another special case includes |
| 475 | methods and members of general ``protocols,'' such as the |
| 476 | formatter and writer protocols described for the |
| 477 | \module{formatter} module: these may be documented without any |
| 478 | specific implementation classes, and will always require the |
| 479 | \var{type name} parameter to be provided. |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 480 | |
Fred Drake | 7be440d | 2000-09-16 21:23:25 +0000 | [diff] [blame] | 481 | \begin{envdesc}{cfuncdesc}{\p{type}\p{name}\p{args}} |
| 482 | Environment used to described a C function. The \var{type} |
| 483 | should be specified as a \keyword{typedef} name, \code{struct |
| 484 | \var{tag}}, or the name of a primitive type. If it is a pointer |
Fred Drake | 0299749 | 2000-09-21 05:26:43 +0000 | [diff] [blame] | 485 | type, the trailing asterisk should not be preceded by a space. |
Fred Drake | 7be440d | 2000-09-16 21:23:25 +0000 | [diff] [blame] | 486 | \var{name} should be the name of the function (or function-like |
| 487 | pre-processor macro), and \var{args} should give the types and |
| 488 | names of the parameters. The names need to be given so they may |
| 489 | be used in the description. |
| 490 | \end{envdesc} |
| 491 | |
| 492 | \begin{envdesc}{ctypedesc}{\op{tag}\p{name}} |
| 493 | Environment used to described a C type. The \var{name} |
| 494 | parameter should be the \keyword{typedef} name. If the type is |
| 495 | defined as a \keyword{struct} without a \keyword{typedef}, |
| 496 | \var{name} should have the form \code{struct \var{tag}}. |
| 497 | \var{name} will be added to the index unless \var{tag} is |
| 498 | provided, in which case \var{tag} will be used instead. |
| 499 | \var{tag} should not be used for a \keyword{typedef} name. |
| 500 | \end{envdesc} |
| 501 | |
| 502 | \begin{envdesc}{cvardesc}{\p{type}\p{name}} |
| 503 | Description of a global C variable. \var{type} should be the |
| 504 | \keyword{typedef} name, \code{struct \var{tag}}, or the name of |
| 505 | a primitive type. If variable has a pointer type, the trailing |
Fred Drake | 0299749 | 2000-09-21 05:26:43 +0000 | [diff] [blame] | 506 | asterisk should \emph{not} be preceded by a space. |
Fred Drake | 7be440d | 2000-09-16 21:23:25 +0000 | [diff] [blame] | 507 | \end{envdesc} |
| 508 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 509 | \begin{envdesc}{datadesc}{\p{name}} |
| 510 | This environment is used to document global data in a module, |
| 511 | including both variables and values used as ``defined |
| 512 | constants.'' Class and object attributes are not documented |
| 513 | using this environment. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 514 | \end{envdesc} |
Fred Drake | 7a737df | 1999-04-23 14:41:44 +0000 | [diff] [blame] | 515 | \begin{envdesc}{datadescni}{\p{name}} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 516 | Like \env{datadesc}, but without creating any index entries. |
| 517 | \end{envdesc} |
| 518 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 519 | \begin{envdesc}{excdesc}{\p{name}} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 520 | Describe an exception. This may be either a string exception or |
| 521 | a class exception. |
| 522 | \end{envdesc} |
| 523 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 524 | \begin{envdesc}{funcdesc}{\p{name}\p{parameters}} |
| 525 | Describe a module-level function. \var{parameters} should |
| 526 | not include the parentheses used in the call syntax. Object |
| 527 | methods are not documented using this environment. Bound object |
| 528 | methods placed in the module namespace as part of the public |
| 529 | interface of the module are documented using this, as they are |
| 530 | equivalent to normal functions for most purposes. |
| 531 | |
| 532 | The description should include information about the parameters |
| 533 | required and how they are used (especially whether mutable |
| 534 | objects passed as parameters are modified), side effects, and |
| 535 | possible exceptions. A small example may be provided. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 536 | \end{envdesc} |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 537 | \begin{envdesc}{funcdescni}{\p{name}\p{parameters}} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 538 | Like \env{funcdesc}, but without creating any index entries. |
| 539 | \end{envdesc} |
| 540 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 541 | \begin{envdesc}{classdesc}{\p{name}\p{constructor parameters}} |
| 542 | Describe a class and its constructor. \var{constructor |
| 543 | parameters} should not include the \var{self} parameter or |
| 544 | the parentheses used in the call syntax. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 545 | \end{envdesc} |
| 546 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 547 | \begin{envdesc}{memberdesc}{\op{type name}\p{name}} |
| 548 | Describe an object data attribute. The description should |
| 549 | include information about the type of the data to be expected |
| 550 | and whether it may be changed directly. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 551 | \end{envdesc} |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 552 | \begin{envdesc}{memberdescni}{\op{type name}\p{name}} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 553 | Like \env{memberdesc}, but without creating any index entries. |
| 554 | \end{envdesc} |
| 555 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 556 | \begin{envdesc}{methoddesc}{\op{type name}\p{name}\p{parameters}} |
| 557 | Describe an object method. \var{parameters} should not include |
| 558 | the \var{self} parameter or the parentheses used in the call |
| 559 | syntax. The description should include similar information to |
| 560 | that described for \env{funcdesc}. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 561 | \end{envdesc} |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 562 | \begin{envdesc}{methoddescni}{\op{type name}\p{name}\p{parameters}} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 563 | Like \env{methoddesc}, but without creating any index entries. |
| 564 | \end{envdesc} |
| 565 | |
| 566 | |
Fred Drake | 5eb992b | 1999-06-11 14:25:45 +0000 | [diff] [blame] | 567 | \subsection{Showing Code Examples} |
| 568 | |
| 569 | Examples of Python source code or interactive sessions are |
| 570 | represented as \env{verbatim} environments. This environment |
| 571 | is a standard part of \LaTeX{}. It is important to only use |
| 572 | spaces for indentation in code examples since \TeX{} drops tabs |
| 573 | instead of converting them to spaces. |
| 574 | |
| 575 | Representing an interactive session requires including the prompts |
| 576 | and output along with the Python code. No special markup is |
Fred Drake | 63568aa | 2000-10-19 05:36:10 +0000 | [diff] [blame] | 577 | required for interactive sessions. After the last line of input |
| 578 | or output presented, there should not be an ``unused'' primary |
| 579 | prompt; this is an example of what \emph{not} to do: |
| 580 | |
| 581 | \begin{verbatim} |
| 582 | >>> 1 + 1 |
| 583 | 2 |
| 584 | >>> |
| 585 | \end{verbatim} |
Fred Drake | 5eb992b | 1999-06-11 14:25:45 +0000 | [diff] [blame] | 586 | |
| 587 | Within the \env{verbatim} environment, characters special to |
| 588 | \LaTeX{} do not need to be specially marked in any way. The entire |
| 589 | example will be presented in a monospaced font; no attempt at |
| 590 | ``pretty-printing'' is made, as the environment must work for |
Fred Drake | 63568aa | 2000-10-19 05:36:10 +0000 | [diff] [blame] | 591 | non-Python code and non-code displays. There should be no blank |
| 592 | lines at the top or bottom of any \env{verbatim} display. |
Fred Drake | 5eb992b | 1999-06-11 14:25:45 +0000 | [diff] [blame] | 593 | |
| 594 | The Python Documentation Special Interest Group has discussed a |
| 595 | number of approaches to creating pretty-printed code displays and |
| 596 | interactive sessions; see the Doc-SIG area on the Python Web site |
| 597 | for more information on this topic. |
| 598 | |
| 599 | |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 600 | \subsection{Inline Markup} |
| 601 | |
Fred Drake | 87f768e | 1999-05-17 15:22:45 +0000 | [diff] [blame] | 602 | The macros described in this section are used to mark just about |
| 603 | anything interesting in the document text. They may be used in |
| 604 | headings (though anything involving hyperlinks should be avoided |
| 605 | there) as well as in the body text. |
Fred Drake | 2f4bebd | 1999-04-28 16:43:11 +0000 | [diff] [blame] | 606 | |
| 607 | \begin{macrodesc}{bfcode}{\p{text}} |
| 608 | Like \macro{code}, but also makes the font bold-face. |
| 609 | \end{macrodesc} |
| 610 | |
| 611 | \begin{macrodesc}{cdata}{\p{name}} |
| 612 | The name of a C-language variable. |
| 613 | \end{macrodesc} |
| 614 | |
| 615 | \begin{macrodesc}{cfunction}{\p{name}} |
| 616 | The name of a C-language function. \var{name} should include the |
| 617 | function name and the trailing parentheses. |
| 618 | \end{macrodesc} |
| 619 | |
| 620 | \begin{macrodesc}{character}{\p{char}} |
| 621 | A character when discussing the character rather than a one-byte |
| 622 | string value. The character will be typeset as with \macro{samp}. |
| 623 | \end{macrodesc} |
| 624 | |
Fred Drake | 29a710f | 1999-11-10 22:51:18 +0000 | [diff] [blame] | 625 | \begin{macrodesc}{citetitle}{\op{url}\p{title}} |
| 626 | A title for a referenced publication. If \var{url} is specified, |
| 627 | the title will be made into a hyperlink when formatted as HTML. |
| 628 | \end{macrodesc} |
| 629 | |
Fred Drake | 2f4bebd | 1999-04-28 16:43:11 +0000 | [diff] [blame] | 630 | \begin{macrodesc}{class}{\p{name}} |
| 631 | A class name; a dotted name may be used. |
| 632 | \end{macrodesc} |
| 633 | |
| 634 | \begin{macrodesc}{code}{\p{text}} |
| 635 | A short code fragment or literal constant value. Typically, it |
| 636 | should not include any spaces since no quotation marks are |
| 637 | added. |
| 638 | \end{macrodesc} |
| 639 | |
| 640 | \begin{macrodesc}{constant}{\p{name}} |
| 641 | The name of a ``defined'' constant. This may be a C-language |
| 642 | \code{\#define} or a Python variable that is not intended to be |
| 643 | changed. |
| 644 | \end{macrodesc} |
| 645 | |
| 646 | \begin{macrodesc}{ctype}{\p{name}} |
| 647 | The name of a C \keyword{typedef} or structure. For structures |
| 648 | defined without a \keyword{typedef}, use \code{\e ctype\{struct |
| 649 | struct_tag\}} to make it clear that the \keyword{struct} is |
| 650 | required. |
| 651 | \end{macrodesc} |
| 652 | |
| 653 | \begin{macrodesc}{deprecated}{\p{version}\p{what to do}} |
| 654 | Declare whatever is being described as being deprecated starting |
| 655 | with release \var{version}. The text given as \var{what to do} |
| 656 | should recommend something to use instead. |
| 657 | \end{macrodesc} |
| 658 | |
| 659 | \begin{macrodesc}{dfn}{\p{term}} |
| 660 | Mark the defining instance of \var{term} in the text. (No index |
| 661 | entries are generated.) |
| 662 | \end{macrodesc} |
| 663 | |
Fred Drake | d1fb779 | 1999-05-17 16:33:54 +0000 | [diff] [blame] | 664 | \begin{macrodesc}{e}{} |
| 665 | Produces a backslash. This is convenient in \macro{code} and |
Fred Drake | 31edf4d | 2000-09-07 20:06:07 +0000 | [diff] [blame] | 666 | similar macros, and is only defined there. To create a |
Fred Drake | 2b85341 | 2000-04-11 19:08:30 +0000 | [diff] [blame] | 667 | backslash in ordinary text (such as the contents of the |
| 668 | \macro{file} macro), use the standard \macro{textbackslash} macro. |
Fred Drake | d1fb779 | 1999-05-17 16:33:54 +0000 | [diff] [blame] | 669 | \end{macrodesc} |
| 670 | |
Fred Drake | 2f4bebd | 1999-04-28 16:43:11 +0000 | [diff] [blame] | 671 | \begin{macrodesc}{email}{\p{address}} |
| 672 | An email address. Note that this is \emph{not} hyperlinked in |
Fred Drake | e15956b | 2000-04-03 04:51:13 +0000 | [diff] [blame] | 673 | any of the possible output formats. The domain name portion of |
| 674 | the address should be lower case. |
Fred Drake | 2f4bebd | 1999-04-28 16:43:11 +0000 | [diff] [blame] | 675 | \end{macrodesc} |
| 676 | |
| 677 | \begin{macrodesc}{emph}{\p{text}} |
| 678 | Emphasized text; this will be presented in an italic font. |
| 679 | \end{macrodesc} |
| 680 | |
| 681 | \begin{macrodesc}{envvar}{\p{name}} |
| 682 | An environment variable. Index entries are generated. |
| 683 | \end{macrodesc} |
| 684 | |
| 685 | \begin{macrodesc}{exception}{\p{name}} |
| 686 | The name of an exception. A dotted name may be used. |
| 687 | \end{macrodesc} |
| 688 | |
| 689 | \begin{macrodesc}{file}{\p{file or dir}} |
| 690 | The name of a file or directory. In the PDF and PostScript |
| 691 | outputs, single quotes and a font change are used to indicate |
| 692 | the file name, but no quotes are used in the HTML output. |
Fred Drake | 31edf4d | 2000-09-07 20:06:07 +0000 | [diff] [blame] | 693 | \strong{Warning:} The \macro{file} macro cannot be used in the |
| 694 | content of a section title due to processing limitations. |
Fred Drake | 2f4bebd | 1999-04-28 16:43:11 +0000 | [diff] [blame] | 695 | \end{macrodesc} |
| 696 | |
| 697 | \begin{macrodesc}{filenq}{\p{file or dir}} |
| 698 | Like \macro{file}, but single quotes are never used. This can |
| 699 | be used in conjunction with tables if a column will only contain |
| 700 | file or directory names. |
Fred Drake | 31edf4d | 2000-09-07 20:06:07 +0000 | [diff] [blame] | 701 | \strong{Warning:} The \macro{filenq} macro cannot be used in the |
| 702 | content of a section title due to processing limitations. |
Fred Drake | 2f4bebd | 1999-04-28 16:43:11 +0000 | [diff] [blame] | 703 | \end{macrodesc} |
| 704 | |
| 705 | \begin{macrodesc}{function}{\p{name}} |
| 706 | The name of a Python function; dotted names may be used. |
| 707 | \end{macrodesc} |
| 708 | |
| 709 | \begin{macrodesc}{kbd}{\p{key sequence}} |
| 710 | Mark a sequence of keystrokes. What form \var{key sequence} |
| 711 | takes may depend on platform- or application-specific |
| 712 | conventions. For example, an \program{xemacs} key sequence |
| 713 | may be marked like \code{\e kbd\{C-x C-f\}}. |
| 714 | \end{macrodesc} |
| 715 | |
| 716 | \begin{macrodesc}{keyword}{\p{name}} |
| 717 | The name of a keyword in a programming language. |
| 718 | \end{macrodesc} |
| 719 | |
| 720 | \begin{macrodesc}{makevar}{\p{name}} |
| 721 | The name of a \program{make} variable. |
| 722 | \end{macrodesc} |
| 723 | |
| 724 | \begin{macrodesc}{manpage}{\p{name}\p{section}} |
| 725 | A reference to a \UNIX{} manual page. |
| 726 | \end{macrodesc} |
| 727 | |
| 728 | \begin{macrodesc}{member}{\p{name}} |
| 729 | The name of a data attribute of an object. |
| 730 | \end{macrodesc} |
| 731 | |
| 732 | \begin{macrodesc}{method}{\p{name}} |
| 733 | The name of a method of an object. \var{name} should include the |
| 734 | method name and the trailing parentheses. A dotted name may be |
| 735 | used. |
| 736 | \end{macrodesc} |
| 737 | |
| 738 | \begin{macrodesc}{mimetype}{\p{name}} |
| 739 | The name of a MIME type. |
| 740 | \end{macrodesc} |
| 741 | |
| 742 | \begin{macrodesc}{module}{\p{name}} |
Fred Drake | 2b85341 | 2000-04-11 19:08:30 +0000 | [diff] [blame] | 743 | The name of a module; a dotted name may be used. This should |
| 744 | also be used for package names. |
Fred Drake | 2f4bebd | 1999-04-28 16:43:11 +0000 | [diff] [blame] | 745 | \end{macrodesc} |
| 746 | |
| 747 | \begin{macrodesc}{newsgroup}{\p{name}} |
| 748 | The name of a USENET newsgroup. |
| 749 | \end{macrodesc} |
| 750 | |
Fred Drake | 2f4bebd | 1999-04-28 16:43:11 +0000 | [diff] [blame] | 751 | \begin{macrodesc}{program}{\p{name}} |
| 752 | The name of an executable program. This may differ from the |
| 753 | file name for the executable for some platforms. In particular, |
| 754 | the \file{.exe} (or other) extension should be omitted for DOS |
| 755 | and Windows programs. |
| 756 | \end{macrodesc} |
| 757 | |
Fred Drake | 29a710f | 1999-11-10 22:51:18 +0000 | [diff] [blame] | 758 | \begin{macrodesc}{programopt}{\p{option}} |
Fred Drake | ce44498 | 2000-04-11 18:52:52 +0000 | [diff] [blame] | 759 | A command-line option to an executable program. Use this only |
| 760 | for ``shot'' options, and include the leading hyphen. |
| 761 | \end{macrodesc} |
| 762 | |
| 763 | \begin{macrodesc}{longprogramopt}{\p{option}} |
| 764 | A long command-line option to an executable program. This |
| 765 | should only be used for long option names which will be prefixed |
| 766 | by two hyphens; the hyphens should not be provided as part of |
| 767 | \var{option}. |
Fred Drake | 29a710f | 1999-11-10 22:51:18 +0000 | [diff] [blame] | 768 | \end{macrodesc} |
| 769 | |
Fred Drake | 08c5d0c | 2000-09-11 05:22:30 +0000 | [diff] [blame] | 770 | \begin{macrodesc}{pep}{\p{number}} |
| 771 | A reference to a Python Enhancement Proposal. This generates |
| 772 | appropriate index entries. The text \samp{PEP \var{number}} is |
| 773 | generated; in the HTML output, this text is a hyperlink to an |
| 774 | online copy of the specified PEP. |
| 775 | \end{macrodesc} |
| 776 | |
Fred Drake | 2f4bebd | 1999-04-28 16:43:11 +0000 | [diff] [blame] | 777 | \begin{macrodesc}{refmodule}{\op{key}\p{name}} |
| 778 | Like \macro{module}, but create a hyperlink to the documentation |
| 779 | for the named module. Note that the corresponding |
| 780 | \macro{declaremodule} must be in the same document. If the |
| 781 | \macro{declaremodule} defines a module key different from the |
| 782 | module name, it must also be provided as \var{key} to the |
| 783 | \macro{refmodule} macro. |
| 784 | \end{macrodesc} |
| 785 | |
| 786 | \begin{macrodesc}{regexp}{\p{string}} |
| 787 | Mark a regular expression. |
| 788 | \end{macrodesc} |
| 789 | |
| 790 | \begin{macrodesc}{rfc}{\p{number}} |
| 791 | A reference to an Internet Request for Comments. This generates |
| 792 | appropriate index entries. The text \samp{RFC \var{number}} is |
| 793 | generated; in the HTML output, this text is a hyperlink to an |
| 794 | online copy of the specified RFC. |
| 795 | \end{macrodesc} |
| 796 | |
| 797 | \begin{macrodesc}{samp}{\p{text}} |
| 798 | A short code sample, but possibly longer than would be given |
| 799 | using \macro{code}. Since quotation marks are added, spaces are |
| 800 | acceptable. |
| 801 | \end{macrodesc} |
| 802 | |
Fred Drake | af2b714 | 2000-09-14 20:11:05 +0000 | [diff] [blame] | 803 | \begin{macrodesc}{shortversion}{} |
| 804 | The ``short'' version number of the documented software, as |
| 805 | specified using the \macro{setshortversion} macro in the |
| 806 | preamble. For Python, the short version number for a release is |
| 807 | the first three characters of the \code{sys.version} value. For |
| 808 | example, versions 2.0b1 and 2.0.1 both have a short version of |
| 809 | 2.0. This may not apply for all packages; if |
| 810 | \macro{setshortversion} is not used, this produces an empty |
| 811 | expansion. See also the \macro{version} macro. |
| 812 | \end{macrodesc} |
| 813 | |
Fred Drake | 2f4bebd | 1999-04-28 16:43:11 +0000 | [diff] [blame] | 814 | \begin{macrodesc}{strong}{\p{text}} |
| 815 | Strongly emphasized text; this will be presented using a bold |
| 816 | font. |
| 817 | \end{macrodesc} |
| 818 | |
Fred Drake | d1fb779 | 1999-05-17 16:33:54 +0000 | [diff] [blame] | 819 | \begin{macrodesc}{url}{\p{url}} |
| 820 | A URL (or URN). The URL will be presented as text. In the HTML |
| 821 | and PDF formatted versions, the URL will also be a hyperlink. |
| 822 | This can be used when referring to external resources. Note |
| 823 | that many characters are special to \LaTeX{} and this macro |
| 824 | does not always do the right thing. In particular, the tilde |
| 825 | character (\character{\~}) is mis-handled; encoding it as a |
| 826 | hex-sequence does work, use \samp{\%7e} in place of the tilde |
| 827 | character. |
| 828 | \end{macrodesc} |
| 829 | |
Fred Drake | 2f4bebd | 1999-04-28 16:43:11 +0000 | [diff] [blame] | 830 | \begin{macrodesc}{var}{\p{name}} |
| 831 | The name of a variable or formal parameter in running text. |
| 832 | \end{macrodesc} |
| 833 | |
| 834 | \begin{macrodesc}{version}{} |
Fred Drake | af2b714 | 2000-09-14 20:11:05 +0000 | [diff] [blame] | 835 | The version number of the described software, as specified using |
| 836 | \macro{release} in the preamble. See also the |
| 837 | \macro{shortversion} macro. |
Fred Drake | 2f4bebd | 1999-04-28 16:43:11 +0000 | [diff] [blame] | 838 | \end{macrodesc} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 839 | |
Fred Drake | c26cc91 | 2000-05-02 17:43:44 +0000 | [diff] [blame] | 840 | \begin{macrodesc}{versionadded}{\p{version}} |
| 841 | The version of Python which added the described feature to the |
| 842 | library or C API. This is typically added to the end of the |
| 843 | first paragraph of the description before any availability |
| 844 | notes. The location should be selected so the explanation makes |
| 845 | sense and may vary as needed. |
| 846 | \end{macrodesc} |
| 847 | |
| 848 | \begin{macrodesc}{versionchanged}{\op{explanation}\p{version}} |
| 849 | The version of Python in which the named feature was changed in |
| 850 | some way (new parameters, changed side effects, etc.). |
| 851 | \var{explanation} should be a \emph{brief} explanation of the |
Fred Drake | 63568aa | 2000-10-19 05:36:10 +0000 | [diff] [blame] | 852 | change consisting of a capitalized sentence fragment; a |
Fred Drake | c26cc91 | 2000-05-02 17:43:44 +0000 | [diff] [blame] | 853 | period will be appended by the formatting process. |
| 854 | This is typically added to the end of the first paragraph of the |
| 855 | description before any availability notes and after |
| 856 | \macro{versionadded}. The location should be selected so the |
| 857 | explanation makes sense and may vary as needed. |
| 858 | \end{macrodesc} |
| 859 | |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 860 | |
| 861 | \subsection{Module-specific Markup} |
| 862 | |
| 863 | The markup described in this section is used to provide information |
| 864 | about a module being documented. A typical use of this markup |
| 865 | appears at the top of the section used to document a module. A |
| 866 | typical example might look like this: |
| 867 | |
| 868 | \begin{verbatim} |
| 869 | \section{\module{spam} --- |
| 870 | Access to the SPAM facility} |
| 871 | |
| 872 | \declaremodule{extension}{spam} |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 873 | \platform{Unix} |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 874 | \modulesynopsis{Access to the SPAM facility of \UNIX{}.} |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 875 | \moduleauthor{Jane Doe}{jane.doe@frobnitz.org} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 876 | \end{verbatim} |
| 877 | |
Fred Drake | 7932ed0 | 2000-08-11 17:37:33 +0000 | [diff] [blame] | 878 | Python packages\index{packages} --- collections of modules that can |
| 879 | be described as a unit --- are documented using the same markup as |
| 880 | modules. The name for a module in a package should be typed in |
| 881 | ``fully qualified'' form (i.e., it should include the package name). |
| 882 | For example, a module ``foo'' in package ``bar'' should be marked as |
| 883 | \samp{\e module\{bar.foo\}}, and the beginning of the reference |
| 884 | section would appear as: |
| 885 | |
| 886 | \begin{verbatim} |
| 887 | \section{\module{bar.foo} --- |
| 888 | Module from the \module{bar} package} |
| 889 | |
| 890 | \declaremodule{extension}{bar.foo} |
| 891 | \modulesynopsis{Nifty module from the \module{bar} package.} |
| 892 | \moduleauthor{Jane Doe}{jane.doe@frobnitz.org} |
| 893 | \end{verbatim} |
| 894 | |
| 895 | Note that the name of a package is also marked using |
| 896 | \macro{module}. |
| 897 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 898 | \begin{macrodesc}{declaremodule}{\op{key}\p{type}\p{name}} |
Fred Drake | 87f768e | 1999-05-17 15:22:45 +0000 | [diff] [blame] | 899 | Requires two parameters: module type (\samp{standard}, |
| 900 | \samp{builtin}, \samp{extension}, or \samp{}), and the module |
| 901 | name. An optional parameter should be given as the basis for the |
| 902 | module's ``key'' used for linking to or referencing the section. |
| 903 | The ``key'' should only be given if the module's name contains any |
| 904 | underscores, and should be the name with the underscores stripped. |
| 905 | Note that the \var{type} parameter must be one of the values |
| 906 | listed above or an error will be printed. For modules which are |
| 907 | contained in packages, the fully-qualified name should be given as |
| 908 | \var{name} parameter. This should be the first thing after the |
| 909 | \macro{section} used to introduce the module. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 910 | \end{macrodesc} |
| 911 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 912 | \begin{macrodesc}{platform}{\p{specifier}} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 913 | Specifies the portability of the module. \var{specifier} is a |
| 914 | comma-separated list of keys that specify what platforms the |
| 915 | module is available on. The keys are short identifiers; |
| 916 | examples that are in use include \samp{IRIX}, \samp{Mac}, |
| 917 | \samp{Windows}, and \samp{Unix}. It is important to use a key |
Fred Drake | 7a737df | 1999-04-23 14:41:44 +0000 | [diff] [blame] | 918 | which has already been used when applicable. This is used to |
| 919 | provide annotations in the Module Index and the HTML and GNU info |
| 920 | output. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 921 | \end{macrodesc} |
| 922 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 923 | \begin{macrodesc}{modulesynopsis}{\p{text}} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 924 | The \var{text} is a short, ``one line'' description of the |
| 925 | module that can be used as part of the chapter introduction. |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 926 | This is must be placed after \macro{declaremodule}. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 927 | The synopsis is used in building the contents of the table |
| 928 | inserted as the \macro{localmoduletable}. No text is |
| 929 | produced at the point of the markup. |
| 930 | \end{macrodesc} |
| 931 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 932 | \begin{macrodesc}{moduleauthor}{\p{name}\p{email}} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 933 | This macro is used to encode information about who authored a |
| 934 | module. This is currently not used to generate output, but can be |
| 935 | used to help determine the origin of the module. |
| 936 | \end{macrodesc} |
| 937 | |
| 938 | |
| 939 | \subsection{Library-level Markup} |
| 940 | |
| 941 | This markup is used when describing a selection of modules. For |
Fred Drake | 698d520 | 1999-11-10 15:54:57 +0000 | [diff] [blame] | 942 | example, the \citetitle[../mac/mac.html]{Macintosh Library |
| 943 | Modules} document uses this to help provide an overview of the |
| 944 | modules in the collection, and many chapters in the |
| 945 | \citetitle[../lib/lib.html]{Python Library Reference} use it for |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 946 | the same purpose. |
| 947 | |
| 948 | \begin{macrodesc}{localmoduletable}{} |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 949 | If a \file{.syn} file exists for the current |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 950 | chapter (or for the entire document in \code{howto} documents), a |
| 951 | \env{synopsistable} is created with the contents loaded from the |
| 952 | \file{.syn} file. |
| 953 | \end{macrodesc} |
| 954 | |
| 955 | |
| 956 | \subsection{Table Markup} |
| 957 | |
| 958 | There are three general-purpose table environments defined which |
| 959 | should be used whenever possible. These environments are defined |
| 960 | to provide tables of specific widths and some convenience for |
| 961 | formatting. These environments are not meant to be general |
| 962 | replacements for the standard \LaTeX{} table environments, but can |
| 963 | be used for an advantage when the documents are processed using |
| 964 | the tools for Python documentation processing. In particular, the |
| 965 | generated HTML looks good! There is also an advantage for the |
Fred Drake | 7a737df | 1999-04-23 14:41:44 +0000 | [diff] [blame] | 966 | eventual conversion of the documentation to SGML (see section |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 967 | \ref{futures}, ``Future Directions''). |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 968 | |
| 969 | Each environment is named \env{table\var{cols}}, where \var{cols} |
| 970 | is the number of columns in the table specified in lower-case |
| 971 | Roman numerals. Within each of these environments, an additional |
| 972 | macro, \macro{line\var{cols}}, is defined, where \var{cols} |
| 973 | matches the \var{cols} value of the corresponding table |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 974 | environment. These are supported for \var{cols} values of |
| 975 | \code{ii}, \code{iii}, and \code{iv}. These environments are all |
Fred Drake | da72b93 | 2000-09-21 15:58:02 +0000 | [diff] [blame] | 976 | built on top of the \env{tabular} environment. Variants based on |
| 977 | the \env{longtable} environment are also provided. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 978 | |
Fred Drake | 2b85341 | 2000-04-11 19:08:30 +0000 | [diff] [blame] | 979 | Note that all tables in the standard Python documentation use |
| 980 | vertical lines between columns, and this must be specified in the |
| 981 | markup for each table. A general border around the outside of the |
| 982 | table is not used, but would be the responsibility of the |
Fred Drake | da72b93 | 2000-09-21 15:58:02 +0000 | [diff] [blame] | 983 | processor; the document markup should not include an exterior |
| 984 | border. |
| 985 | |
| 986 | The \env{longtable}-based variants of the table environments are |
| 987 | formatted with extra space before and after, so should only be |
| 988 | used on tables which are long enough that splitting over multiple |
| 989 | pages is reasonable; tables with fewer than twenty rows should |
| 990 | never by marked using the long flavors of the table environments. |
| 991 | The header row is repeated across the top of each part of the |
| 992 | table. |
Fred Drake | 2b85341 | 2000-04-11 19:08:30 +0000 | [diff] [blame] | 993 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 994 | \begin{envdesc}{tableii}{\p{colspec}\p{col1font}\p{heading1}\p{heading2}} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 995 | Create a two-column table using the \LaTeX{} column specifier |
| 996 | \var{colspec}. The column specifier should indicate vertical |
| 997 | bars between columns as appropriate for the specific table, but |
| 998 | should not specify vertical bars on the outside of the table |
| 999 | (that is considered a stylesheet issue). The \var{col1font} |
| 1000 | parameter is used as a stylistic treatment of the first column |
| 1001 | of the table: the first column is presented as |
| 1002 | \code{\e\var{col1font}\{column1\}}. To avoid treating the first |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1003 | column specially, \var{col1font} may be \samp{textrm}. The |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1004 | column headings are taken from the values \var{heading1} and |
| 1005 | \var{heading2}. |
| 1006 | \end{envdesc} |
| 1007 | |
Fred Drake | da72b93 | 2000-09-21 15:58:02 +0000 | [diff] [blame] | 1008 | \begin{envdesc}{longtableii}{\unspecified} |
| 1009 | Like \env{tableii}, but produces a table which may be broken |
| 1010 | across page boundaries. The parameters are the same as for |
| 1011 | \env{tableii}. |
| 1012 | \end{envdesc} |
| 1013 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1014 | \begin{macrodesc}{lineii}{\p{column1}\p{column2}} |
Fred Drake | da72b93 | 2000-09-21 15:58:02 +0000 | [diff] [blame] | 1015 | Create a single table row within a \env{tableii} or |
| 1016 | \env{longtableii} environment. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1017 | The text for the first column will be generated by applying the |
| 1018 | macro named by the \var{col1font} value when the \env{tableii} |
| 1019 | was opened. |
| 1020 | \end{macrodesc} |
| 1021 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1022 | \begin{envdesc}{tableiii}{\p{colspec}\p{col1font}\p{heading1}\p{heading2}\p{heading3}} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1023 | Like the \env{tableii} environment, but with a third column. |
| 1024 | The heading for the third column is given by \var{heading3}. |
| 1025 | \end{envdesc} |
| 1026 | |
Fred Drake | da72b93 | 2000-09-21 15:58:02 +0000 | [diff] [blame] | 1027 | \begin{envdesc}{longtableiii}{\unspecified} |
| 1028 | Like \env{tableiii}, but produces a table which may be broken |
| 1029 | across page boundaries. The parameters are the same as for |
| 1030 | \env{tableiii}. |
| 1031 | \end{envdesc} |
| 1032 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1033 | \begin{macrodesc}{lineiii}{\p{column1}\p{column2}\p{column3}} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1034 | Like the \macro{lineii} macro, but with a third column. The |
| 1035 | text for the third column is given by \var{column3}. |
| 1036 | \end{macrodesc} |
| 1037 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1038 | \begin{envdesc}{tableiv}{\p{colspec}\p{col1font}\p{heading1}\p{heading2}\p{heading3}\p{heading4}} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1039 | Like the \env{tableiii} environment, but with a fourth column. |
| 1040 | The heading for the fourth column is given by \var{heading4}. |
| 1041 | \end{envdesc} |
| 1042 | |
Fred Drake | da72b93 | 2000-09-21 15:58:02 +0000 | [diff] [blame] | 1043 | \begin{envdesc}{longtableiv}{\unspecified} |
| 1044 | Like \env{tableiv}, but produces a table which may be broken |
| 1045 | across page boundaries. The parameters are the same as for |
| 1046 | \env{tableiv}. |
| 1047 | \end{envdesc} |
| 1048 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1049 | \begin{macrodesc}{lineiv}{\p{column1}\p{column2}\p{column3}\p{column4}} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1050 | Like the \macro{lineiii} macro, but with a fourth column. The |
| 1051 | text for the fourth column is given by \var{column4}. |
| 1052 | \end{macrodesc} |
| 1053 | |
| 1054 | |
| 1055 | An additional table-like environment is \env{synopsistable}. The |
| 1056 | table generated by this environment contains two columns, and each |
| 1057 | row is defined by an alternate definition of |
Fred Drake | e15956b | 2000-04-03 04:51:13 +0000 | [diff] [blame] | 1058 | \macro{modulesynopsis}. This environment is not normally used by |
| 1059 | authors, but is created by the \macro{localmoduletable} macro. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1060 | |
| 1061 | |
| 1062 | \subsection{Reference List Markup \label{references}} |
| 1063 | |
| 1064 | Many sections include a list of references to module documentation |
| 1065 | or external documents. These lists are created using the |
| 1066 | \env{seealso} environment. This environment defines some |
| 1067 | additional macros to support creating reference entries in a |
| 1068 | reasonable manner. |
| 1069 | |
Fred Drake | 5802e48 | 2000-07-06 05:24:41 +0000 | [diff] [blame] | 1070 | The \env{seealso} environment is typically placed in a section |
| 1071 | just before any sub-sections. This is done to ensure that |
| 1072 | reference links related to the section are not hidden in a |
| 1073 | subsection in the hypertext renditions of the documentation. |
| 1074 | |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1075 | \begin{envdesc}{seealso}{} |
| 1076 | This environment creates a ``See also:'' heading and defines the |
| 1077 | markup used to describe individual references. |
| 1078 | \end{envdesc} |
| 1079 | |
Fred Drake | 4844998 | 2000-09-12 17:52:33 +0000 | [diff] [blame] | 1080 | For each of the following macros, \var{why} should be one or more |
| 1081 | complete sentences, starting with a capital letter (unless it |
| 1082 | starts with an identifier, which should not be modified), and |
| 1083 | ending with the apropriate punctuation. |
Fred Drake | 5802e48 | 2000-07-06 05:24:41 +0000 | [diff] [blame] | 1084 | |
Fred Drake | b7cf378 | 2000-09-12 19:58:10 +0000 | [diff] [blame] | 1085 | These macros are only defined within the content of the |
| 1086 | \env{seealso} environment. |
| 1087 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1088 | \begin{macrodesc}{seemodule}{\op{key}\p{name}\p{why}} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1089 | Refer to another module. \var{why} should be a brief |
| 1090 | explanation of why the reference may be interesting. The module |
| 1091 | name is given in \var{name}, with the link key given in |
| 1092 | \var{key} if necessary. In the HTML and PDF conversions, the |
| 1093 | module name will be a hyperlink to the referred-to module. |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1094 | \strong{Note:} The module must be documented in the same |
| 1095 | document (the corresponding \macro{declaremodule} is required). |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1096 | \end{macrodesc} |
| 1097 | |
Fred Drake | 08c5d0c | 2000-09-11 05:22:30 +0000 | [diff] [blame] | 1098 | \begin{macrodesc}{seepep}{\p{number}\p{title}\p{why}} |
| 1099 | Refer to an Python Enhancement Proposal (PEP). \var{number} |
| 1100 | should be the official number assigned by the PEP Editor, |
| 1101 | \var{title} should be the human-readable title of the PEP as |
Fred Drake | 5802e48 | 2000-07-06 05:24:41 +0000 | [diff] [blame] | 1102 | found in the official copy of the document, and \var{why} should |
Fred Drake | 08c5d0c | 2000-09-11 05:22:30 +0000 | [diff] [blame] | 1103 | explain what's interesting about the PEP. This should be used |
| 1104 | to refer the reader to PEPs which specify interfaces or language |
| 1105 | features relevant to the material in the annotated section of the |
| 1106 | documentation. |
| 1107 | \end{macrodesc} |
| 1108 | |
| 1109 | \begin{macrodesc}{seerfc}{\p{number}\p{title}\p{why}} |
| 1110 | Refer to an IETF Request for Comments (RFC). Otherwise very |
| 1111 | similar to \macro{seepep}. This should be used |
| 1112 | to refer the reader to PEPs which specify protocols or data |
Fred Drake | 5802e48 | 2000-07-06 05:24:41 +0000 | [diff] [blame] | 1113 | formats relevant to the material in the annotated section of the |
| 1114 | documentation. |
| 1115 | \end{macrodesc} |
| 1116 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1117 | \begin{macrodesc}{seetext}{\p{text}} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1118 | Add arbitrary text \var{text} to the ``See also:'' list. This |
| 1119 | can be used to refer to off-line materials or on-line materials |
Fred Drake | 5802e48 | 2000-07-06 05:24:41 +0000 | [diff] [blame] | 1120 | using the \macro{url} macro. This should consist of one or more |
| 1121 | complete sentences. |
| 1122 | \end{macrodesc} |
| 1123 | |
Fred Drake | 4844998 | 2000-09-12 17:52:33 +0000 | [diff] [blame] | 1124 | \begin{macrodesc}{seetitle}{\op{url}\p{title}\p{why}} |
| 1125 | Add a reference to an external document named \var{title}. If |
| 1126 | \var{url} is given, the title is made a hyperlink in the HTML |
| 1127 | version of the documentation, and displayed below the title in |
| 1128 | the typeset versions of the documentation. |
| 1129 | \end{macrodesc} |
| 1130 | |
Fred Drake | 5802e48 | 2000-07-06 05:24:41 +0000 | [diff] [blame] | 1131 | \begin{macrodesc}{seeurl}{\p{url}\p{why}} |
| 1132 | References to specific on-line resources should be given using |
| 1133 | the \macro{seeurl} macro. No title is associated with the |
| 1134 | reference, but the \var{why} text may include a title marked |
| 1135 | using the \macro{citetitle} macro. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1136 | \end{macrodesc} |
| 1137 | |
| 1138 | |
| 1139 | \subsection{Index-generating Markup \label{indexing}} |
| 1140 | |
| 1141 | Effective index generation for technical documents can be very |
Fred Drake | e15956b | 2000-04-03 04:51:13 +0000 | [diff] [blame] | 1142 | difficult, especially for someone familiar with the topic but not |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1143 | the creation of indexes. Much of the difficulty arises in the |
| 1144 | area of terminology: including the terms an expert would use for a |
| 1145 | concept is not sufficient. Coming up with the terms that a novice |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 1146 | would look up is fairly difficult for an author who, typically, is |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1147 | an expert in the area she is writing on. |
| 1148 | |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 1149 | The truly difficult aspects of index generation are not areas with |
| 1150 | which the documentation tools can help. However, ease |
Fred Drake | e15956b | 2000-04-03 04:51:13 +0000 | [diff] [blame] | 1151 | of producing the index once content decisions are made is within |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1152 | the scope of the tools. Markup is provided which the processing |
| 1153 | software is able to use to generate a variety of kinds of index |
| 1154 | entry with minimal effort. Additionally, many of the environments |
Fred Drake | 7a737df | 1999-04-23 14:41:44 +0000 | [diff] [blame] | 1155 | described in section \ref{info-units}, ``Information Units,'' will |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1156 | generate appropriate entries into the general and module indexes. |
| 1157 | |
| 1158 | The following macro can be used to control the generation of index |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1159 | data, and should be used in the document preamble: |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1160 | |
| 1161 | \begin{macrodesc}{makemodindex}{} |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1162 | This should be used in the document preamble if a ``Module |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1163 | Index'' is desired for a document containing reference material |
| 1164 | on many modules. This causes a data file |
Fred Drake | d1fb779 | 1999-05-17 16:33:54 +0000 | [diff] [blame] | 1165 | \code{lib\var{jobname}.idx} to be created from the |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1166 | \macro{declaremodule} macros. This file can be processed by the |
| 1167 | \program{makeindex} program to generate a file which can be |
| 1168 | \macro{input} into the document at the desired location of the |
| 1169 | module index. |
| 1170 | \end{macrodesc} |
| 1171 | |
| 1172 | There are a number of macros that are useful for adding index |
| 1173 | entries for particular concepts, many of which are specific to |
| 1174 | programming languages or even Python. |
| 1175 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1176 | \begin{macrodesc}{bifuncindex}{\p{name}} |
Fred Drake | ec8b905 | 1999-04-23 20:01:17 +0000 | [diff] [blame] | 1177 | Add an index entry referring to a built-in function named |
| 1178 | \var{name}; parentheses should not be included after |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 1179 | \var{name}. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1180 | \end{macrodesc} |
| 1181 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1182 | \begin{macrodesc}{exindex}{\p{exception}} |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 1183 | Add a reference to an exception named \var{exception}. The |
| 1184 | exception may be either string- or class-based. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1185 | \end{macrodesc} |
| 1186 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1187 | \begin{macrodesc}{kwindex}{\p{keyword}} |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 1188 | Add a reference to a language keyword (not a keyword parameter |
| 1189 | in a function or method call). |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1190 | \end{macrodesc} |
| 1191 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1192 | \begin{macrodesc}{obindex}{\p{object type}} |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 1193 | Add an index entry for a built-in object type. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1194 | \end{macrodesc} |
| 1195 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1196 | \begin{macrodesc}{opindex}{\p{operator}} |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 1197 | Add a reference to an operator, such as \samp{+}. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1198 | \end{macrodesc} |
| 1199 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1200 | \begin{macrodesc}{refmodindex}{\op{key}\p{module}} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1201 | Add an index entry for module \var{module}; if \var{module} |
| 1202 | contains an underscore, the optional parameter \var{key} should |
| 1203 | be provided as the same string with underscores removed. An |
| 1204 | index entry ``\var{module} (module)'' will be generated. This |
| 1205 | is intended for use with non-standard modules implemented in |
| 1206 | Python. |
| 1207 | \end{macrodesc} |
| 1208 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1209 | \begin{macrodesc}{refexmodindex}{\op{key}\p{module}} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1210 | As for \macro{refmodindex}, but the index entry will be |
| 1211 | ``\var{module} (extension module).'' This is intended for use |
| 1212 | with non-standard modules not implemented in Python. |
| 1213 | \end{macrodesc} |
| 1214 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1215 | \begin{macrodesc}{refbimodindex}{\op{key}\p{module}} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1216 | As for \macro{refmodindex}, but the index entry will be |
| 1217 | ``\var{module} (built-in module).'' This is intended for use |
| 1218 | with standard modules not implemented in Python. |
| 1219 | \end{macrodesc} |
| 1220 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1221 | \begin{macrodesc}{refstmodindex}{\op{key}\p{module}} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1222 | As for \macro{refmodindex}, but the index entry will be |
| 1223 | ``\var{module} (standard module).'' This is intended for use |
| 1224 | with standard modules implemented in Python. |
| 1225 | \end{macrodesc} |
| 1226 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1227 | \begin{macrodesc}{stindex}{\p{statement}} |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 1228 | Add an index entry for a statement type, such as \keyword{print} |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1229 | or \keyword{try}/\keyword{finally}. |
| 1230 | |
| 1231 | XXX Need better examples of difference from \macro{kwindex}. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1232 | \end{macrodesc} |
| 1233 | |
| 1234 | |
| 1235 | Additional macros are provided which are useful for conveniently |
| 1236 | creating general index entries which should appear at many places |
| 1237 | in the index by rotating a list of words. These are simple macros |
| 1238 | that simply use \macro{index} to build some number of index |
| 1239 | entries. Index entries build using these macros contain both |
| 1240 | primary and secondary text. |
| 1241 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1242 | \begin{macrodesc}{indexii}{\p{word1}\p{word2}} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1243 | Build two index entries. This is exactly equivalent to using |
| 1244 | \code{\e index\{\var{word1}!\var{word2}\}} and |
| 1245 | \code{\e index\{\var{word2}!\var{word1}\}}. |
| 1246 | \end{macrodesc} |
| 1247 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1248 | \begin{macrodesc}{indexiii}{\p{word1}\p{word2}\p{word3}} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1249 | Build three index entries. This is exactly equivalent to using |
| 1250 | \code{\e index\{\var{word1}!\var{word2} \var{word3}\}}, |
| 1251 | \code{\e index\{\var{word2}!\var{word3}, \var{word1}\}}, and |
| 1252 | \code{\e index\{\var{word3}!\var{word1} \var{word2}\}}. |
| 1253 | \end{macrodesc} |
| 1254 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1255 | \begin{macrodesc}{indexiv}{\p{word1}\p{word2}\p{word3}\p{word4}} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1256 | Build four index entries. This is exactly equivalent to using |
| 1257 | \code{\e index\{\var{word1}!\var{word2} \var{word3} \var{word4}\}}, |
| 1258 | \code{\e index\{\var{word2}!\var{word3} \var{word4}, \var{word1}\}}, |
| 1259 | \code{\e index\{\var{word3}!\var{word4}, \var{word1} \var{word2}\}}, |
| 1260 | and |
| 1261 | \code{\e index\{\var{word4}!\var{word1} \var{word2} \var{word3}\}}. |
| 1262 | \end{macrodesc} |
| 1263 | |
| 1264 | |
| 1265 | \section{Special Names} |
| 1266 | |
| 1267 | Many special names are used in the Python documentation, including |
| 1268 | the names of operating systems, programming languages, standards |
| 1269 | bodies, and the like. Many of these were assigned \LaTeX{} macros |
| 1270 | at some point in the distant past, and these macros lived on long |
| 1271 | past their usefulness. In the current markup, these entities are |
| 1272 | not assigned any special markup, but the preferred spellings are |
| 1273 | given here to aid authors in maintaining the consistency of |
| 1274 | presentation in the Python documentation. |
| 1275 | |
| 1276 | \begin{description} |
| 1277 | \item[POSIX] |
| 1278 | The name assigned to a particular group of standards. This is |
| 1279 | always uppercase. |
| 1280 | |
| 1281 | \item[Python] |
| 1282 | The name of our favorite programming language is always |
| 1283 | capitalized. |
Fred Drake | 4293468 | 2000-04-03 15:00:28 +0000 | [diff] [blame] | 1284 | |
| 1285 | \item[Unicode] |
| 1286 | The name of a character set and matching encoding. This is |
| 1287 | always written capitalized. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1288 | \end{description} |
| 1289 | |
| 1290 | |
| 1291 | \section{Processing Tools} |
| 1292 | |
| 1293 | \subsection{External Tools} |
| 1294 | |
| 1295 | Many tools are needed to be able to process the Python |
| 1296 | documentation if all supported formats are required. This |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1297 | section lists the tools used and when each is required. Consult |
| 1298 | the \file{Doc/README} file to see if there are specific version |
| 1299 | requirements for any of these. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1300 | |
| 1301 | \begin{description} |
| 1302 | \item[\program{dvips}] |
| 1303 | This program is a typical part of \TeX{} installations. It is |
| 1304 | used to generate PostScript from the ``device independent'' |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 1305 | \file{.dvi} files. It is needed for the conversion to |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1306 | PostScript. |
| 1307 | |
| 1308 | \item[\program{emacs}] |
| 1309 | Emacs is the kitchen sink of programmers' editors, and a damn |
| 1310 | fine kitchen sink it is. It also comes with some of the |
| 1311 | processing needed to support the proper menu structures for |
| 1312 | Texinfo documents when an info conversion is desired. This is |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 1313 | needed for the info conversion. Using \program{xemacs} |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1314 | instead of FSF \program{emacs} may lead to instability in the |
| 1315 | conversion, but that's because nobody seems to maintain the |
| 1316 | Emacs Texinfo code in a portable manner. |
| 1317 | |
| 1318 | \item[\program{latex}] |
| 1319 | This is a world-class typesetter by Donald Knuth. It is used |
| 1320 | for the conversion to PostScript, and is needed for the HTML |
| 1321 | conversion as well (\LaTeX2HTML requires one of the |
| 1322 | intermediate files it creates). |
| 1323 | |
| 1324 | \item[\program{latex2html}] |
| 1325 | Probably the longest Perl script anyone ever attempted to |
| 1326 | maintain. This converts \LaTeX{} documents to HTML documents, |
| 1327 | and does a pretty reasonable job. It is required for the |
| 1328 | conversions to HTML and GNU info. |
| 1329 | |
| 1330 | \item[\program{lynx}] |
| 1331 | This is a text-mode Web browser which includes an |
| 1332 | HTML-to-plain text conversion. This is used to convert |
| 1333 | \code{howto} documents to text. |
| 1334 | |
| 1335 | \item[\program{make}] |
| 1336 | Just about any version should work for the standard documents, |
| 1337 | but GNU \program{make} is required for the experimental |
| 1338 | processes in \file{Doc/tools/sgmlconv/}, at least while |
| 1339 | they're experimental. |
| 1340 | |
| 1341 | \item[\program{makeindex}] |
| 1342 | This is a standard program for converting \LaTeX{} index data |
| 1343 | to a formatted index; it should be included with all \LaTeX{} |
| 1344 | installations. It is needed for the PDF and PostScript |
| 1345 | conversions. |
| 1346 | |
| 1347 | \item[\program{makeinfo}] |
| 1348 | GNU \program{makeinfo} is used to convert Texinfo documents to |
| 1349 | GNU info files. Since Texinfo is used as an intermediate |
| 1350 | format in the info conversion, this program is needed in that |
| 1351 | conversion. |
| 1352 | |
| 1353 | \item[\program{pdflatex}] |
| 1354 | pdf\TeX{} is a relatively new variant of \TeX, and is used to |
| 1355 | generate the PDF version of the manuals. It is typically |
| 1356 | installed as part of most of the large \TeX{} distributions. |
Fred Drake | 7a737df | 1999-04-23 14:41:44 +0000 | [diff] [blame] | 1357 | \program{pdflatex} is pdf\TeX{} using the \LaTeX{} format. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1358 | |
| 1359 | \item[\program{perl}] |
| 1360 | Perl is required for \LaTeX2HTML{} and one of the scripts used |
| 1361 | to post-process \LaTeX2HTML output, as well as the |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 1362 | HTML-to-Texinfo conversion. This is required for |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1363 | the HTML and GNU info conversions. |
| 1364 | |
| 1365 | \item[\program{python}] |
| 1366 | Python is used for many of the scripts in the |
| 1367 | \file{Doc/tools/} directory; it is required for all |
| 1368 | conversions. This shouldn't be a problem if you're interested |
| 1369 | in writing documentation for Python! |
| 1370 | \end{description} |
| 1371 | |
| 1372 | |
| 1373 | \subsection{Internal Tools} |
| 1374 | |
| 1375 | This section describes the various scripts that are used to |
| 1376 | implement various stages of document processing or to orchestrate |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 1377 | entire build sequences. Most of these tools are only useful |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1378 | in the context of building the standard documentation, but some |
| 1379 | are more general. |
| 1380 | |
| 1381 | \begin{description} |
| 1382 | \item[\program{mkhowto}] |
Fred Drake | 87f768e | 1999-05-17 15:22:45 +0000 | [diff] [blame] | 1383 | This is the primary script used to format third-party |
| 1384 | documents. It contains all the logic needed to ``get it |
| 1385 | right.'' The proper way to use this script is to make a |
| 1386 | symbolic link to it or run it in place; the actual script file |
| 1387 | must be stored as part of the documentation source tree, |
| 1388 | though it may be used to format documents outside the |
Fred Drake | ce44498 | 2000-04-11 18:52:52 +0000 | [diff] [blame] | 1389 | tree. Use \program{mkhowto} \longprogramopt{help} |
Fred Drake | d290c10 | 1999-11-09 18:03:00 +0000 | [diff] [blame] | 1390 | for a list of |
Fred Drake | d2a727f | 1999-05-27 21:45:54 +0000 | [diff] [blame] | 1391 | command line options. |
Fred Drake | 87f768e | 1999-05-17 15:22:45 +0000 | [diff] [blame] | 1392 | |
Fred Drake | d1fb779 | 1999-05-17 16:33:54 +0000 | [diff] [blame] | 1393 | \program{mkhowto} can be used for both \code{howto} and |
| 1394 | \code{manual} class documents. (For the later, be sure to get |
| 1395 | the latest version from the Python CVS repository rather than |
| 1396 | the version distributed in the \file{latex-1.5.2.tgz} source |
| 1397 | archive.) |
| 1398 | |
Fred Drake | 87f768e | 1999-05-17 15:22:45 +0000 | [diff] [blame] | 1399 | XXX Need more here. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1400 | \end{description} |
| 1401 | |
| 1402 | |
| 1403 | \section{Future Directions \label{futures}} |
| 1404 | |
| 1405 | The history of the Python documentation is full of changes, most of |
| 1406 | which have been fairly small and evolutionary. There has been a |
| 1407 | great deal of discussion about making large changes in the markup |
| 1408 | languages and tools used to process the documentation. This section |
| 1409 | deals with the nature of the changes and what appears to be the most |
| 1410 | likely path of future development. |
| 1411 | |
| 1412 | \subsection{Structured Documentation \label{structured}} |
| 1413 | |
| 1414 | Most of the small changes to the \LaTeX{} markup have been made |
| 1415 | with an eye to divorcing the markup from the presentation, making |
| 1416 | both a bit more maintainable. Over the course of 1998, a large |
| 1417 | number of changes were made with exactly this in mind; previously, |
| 1418 | changes had been made but in a less systematic manner and with |
| 1419 | more concern for not needing to update the existing content. The |
| 1420 | result has been a highly structured and semantically loaded markup |
| 1421 | language implemented in \LaTeX. With almost no basic \TeX{} or |
| 1422 | \LaTeX{} markup in use, however, the markup syntax is about the |
| 1423 | only evidence of \LaTeX{} in the actual document sources. |
| 1424 | |
| 1425 | One side effect of this is that while we've been able to use |
| 1426 | standard ``engines'' for manipulating the documents, such as |
| 1427 | \LaTeX{} and \LaTeX2HTML, most of the actual transformations have |
Fred Drake | 7a737df | 1999-04-23 14:41:44 +0000 | [diff] [blame] | 1428 | been created specifically for Python. The \LaTeX{} document |
| 1429 | classes and \LaTeX2HTML support are both complete implementations |
| 1430 | of the specific markup designed for these documents. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1431 | |
| 1432 | Combining highly customized markup with the somewhat esoteric |
| 1433 | systems used to process the documents leads us to ask some |
| 1434 | questions: Can we do this more easily? and, Can we do this |
| 1435 | better? After a great deal of discussion with the community, we |
| 1436 | have determined that actively pursuing modern structured |
Fred Drake | 2c4e009 | 1999-03-29 14:55:55 +0000 | [diff] [blame] | 1437 | documentation systems is worth some investment of time. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1438 | |
| 1439 | There appear to be two real contenders in this arena: the Standard |
| 1440 | General Markup Language (SGML), and the Extensible Markup Language |
| 1441 | (XML). Both of these standards have advantages and disadvantages, |
| 1442 | and many advantages are shared. |
| 1443 | |
| 1444 | SGML offers advantages which may appeal most to authors, |
| 1445 | especially those using ordinary text editors. There are also |
| 1446 | additional abilities to define content models. A number of |
| 1447 | high-quality tools with demonstrated maturity is available, but |
| 1448 | most are not free; for those which are, portability issues remain |
| 1449 | a problem. |
| 1450 | |
| 1451 | The advantages of XML include the availability of a large number |
| 1452 | of evolving tools. Unfortunately, many of the associated |
| 1453 | standards are still evolving, and the tools will have to follow |
| 1454 | along. This means that developing a robust tool set that uses |
| 1455 | more than the basic XML 1.0 recommendation is not possible in the |
| 1456 | short term. The promised availability of a wide variety of |
| 1457 | high-quality tools which support some of the most important |
| 1458 | related standards is not immediate. Many tools are likely to be |
| 1459 | free. |
| 1460 | |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1461 | XXX Eventual migration to SGML/XML. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1462 | |
| 1463 | \subsection{Discussion Forums \label{discussion}} |
| 1464 | |
| 1465 | Discussion of the future of the Python documentation and related |
Fred Drake | 7a737df | 1999-04-23 14:41:44 +0000 | [diff] [blame] | 1466 | topics takes place in the Documentation Special Interest Group, or |
| 1467 | ``Doc-SIG.'' Information on the group, including mailing list |
| 1468 | archives and subscription information, is available at |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1469 | \url{http://www.python.org/sigs/doc-sig/}. The SIG is open to all |
| 1470 | interested parties. |
| 1471 | |
| 1472 | Comments and bug reports on the standard documents should be sent |
| 1473 | to \email{python-docs@python.org}. This may include comments |
Fred Drake | adade92 | 1999-04-22 13:05:27 +0000 | [diff] [blame] | 1474 | about formatting, content, grammatical and spelling errors, or |
Fred Drake | d1fb779 | 1999-05-17 16:33:54 +0000 | [diff] [blame] | 1475 | this document. You can also send comments on this document |
| 1476 | directly to the author at \email{fdrake@acm.org}. |
Fred Drake | acffaee | 1999-03-16 16:09:13 +0000 | [diff] [blame] | 1477 | |
| 1478 | \end{document} |