blob: a635eb18afc4e212cab97ca5fc27e411d4cc731c [file] [log] [blame]
Fred Drakeacffaee1999-03-16 16:09:13 +00001\documentclass{howto}
2\usepackage{ltxmarkup}
3
4\title{Documenting Python}
5
6\input{boilerplate}
7
Fred Drakec7c9a641999-04-28 18:24:02 +00008% Now override the stuff that includes author information;
9% Guido did *not* write this one!
Fred Drakeacffaee1999-03-16 16:09:13 +000010
11\author{Fred L. Drake, Jr.}
12\authoraddress{
Fred Drake8fdb6382000-10-28 04:08:38 +000013 PythonLabs \\
Fred Drake9120df32001-07-14 02:34:12 +000014 Email: \email{fdrake@acm.org}
Fred Drakeacffaee1999-03-16 16:09:13 +000015}
Fred Drakeacffaee1999-03-16 16:09:13 +000016
17
18\begin{document}
19
20\maketitle
21
22\begin{abstract}
23\noindent
Fred Drake02997492000-09-21 05:26:43 +000024The Python language has a substantial body of
Fred Drakeacffaee1999-03-16 16:09:13 +000025documentation, much of it contributed by various authors. The markup
26used for the Python documentation is based on \LaTeX{} and requires a
27significant set of macros written specifically for documenting Python.
Fred Drake5eb992b1999-06-11 14:25:45 +000028This document describes the macros introduced to support Python
29documentation and how they should be used to support a wide range of
30output formats.
Fred Drakeacffaee1999-03-16 16:09:13 +000031
32This document describes the document classes and special markup used
33in the Python documentation. Authors may use this guide, in
34conjunction with the template files provided with the
35distribution, to create or maintain whole documents or sections.
36\end{abstract}
37
38\tableofcontents
39
40
Fred Drakef1b3de82001-07-24 14:38:34 +000041\section{Introduction \label{intro}}
Fred Drakeacffaee1999-03-16 16:09:13 +000042
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 Drake7a737df1999-04-23 14:41:44 +000051 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 Drakeacffaee1999-03-16 16:09:13 +000055
Fred Drake2c4e0091999-03-29 14:55:55 +000056 This document is aimed at authors and potential authors of
Fred Drake7a737df1999-04-23 14:41:44 +000057 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 Drakeacffaee1999-03-16 16:09:13 +000063
Fred Drake2c4e0091999-03-29 14:55:55 +000064 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 Drake7a737df1999-04-23 14:41:44 +000067 document types, reference material on the markup defined in the
68 document classes, a list of the external tools needed for processing
Fred Drake2c4e0091999-03-29 14:55:55 +000069 documents, and reference material on the tools provided with the
70 documentation resources. At the end, there is also a section
Fred Drake7a737df1999-04-23 14:41:44 +000071 discussing future directions for the Python documentation and where
72 to turn for more information.
Fred Drakeacffaee1999-03-16 16:09:13 +000073
Fred Drakef1b3de82001-07-24 14:38:34 +000074\section{Directory Structure \label{directories}}
Fred Drakeacffaee1999-03-16 16:09:13 +000075
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 Drake7a737df1999-04-23 14:41:44 +000085 source distribution as the top-level directory \file{Doc/}, but
86 are not dependent on the Python source distribution in any way.
Fred Drakeacffaee1999-03-16 16:09:13 +000087
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 Drake02997492000-09-21 05:26:43 +000096 separate directory. These directories are given short
97 names which vaguely indicate the document in each:
Fred Drake2f4bebd1999-04-28 16:43:11 +000098
99 \begin{tableii}{p{.75in}|p{3in}}{filenq}{Directory}{Document Title}
Fred Drake31edf4d2000-09-07 20:06:07 +0000100 \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 Drake2f4bebd1999-04-28 16:43:11 +0000118 \end{tableii}
Fred Drakeacffaee1999-03-16 16:09:13 +0000119
120 \term{Format-Specific Output}
Fred Drake2c4e0091999-03-29 14:55:55 +0000121 Most output formats have a directory which contains a
Fred Drakeacffaee1999-03-16 16:09:13 +0000122 \file{Makefile} which controls the generation of that format
123 and provides storage for the formatted documents. The only
Fred Drake2c4e0091999-03-29 14:55:55 +0000124 variations within this category are the Portable Document
125 Format (PDF) and PostScript versions are placed in the
Fred Drake7a737df1999-04-23 14:41:44 +0000126 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 Drakeacffaee1999-03-16 16:09:13 +0000130
Fred Drake2f4bebd1999-04-28 16:43:11 +0000131 \begin{tableii}{p{.75in}|p{3in}}{filenq}{Directory}{Output Formats}
132 \lineii{html/}{HTML output}
133 \lineii{info/}{GNU info output}
Fred Draked6bdb072002-01-17 12:35:20 +0000134 \lineii{isilo/}{\ulink{iSilo}{http://www.isilo.com/}
135 documents (for Palm OS devices)}
Fred Drake2f4bebd1999-04-28 16:43:11 +0000136 \lineii{paper-a4/}{PDF and PostScript, A4 paper}
137 \lineii{paper-letter/}{PDF and PostScript, US-Letter paper}
138 \end{tableii}
139
Fred Drakeacffaee1999-03-16 16:09:13 +0000140 \term{Supplemental Files}
141 Some additional directories are used to store supplemental
142 files used for the various processes. Directories are
143 included for the shared \LaTeX{} document classes, the
144 \LaTeX2HTML support, template files for various document
145 components, and the scripts used to perform various steps in
146 the formatting processes.
Fred Drake2f4bebd1999-04-28 16:43:11 +0000147
148 \begin{tableii}{p{.75in}|p{3in}}{filenq}{Directory}{Contents}
149 \lineii{perl/}{Support for \LaTeX2HTML processing}
150 \lineii{templates/}{Example files for source documents}
151 \lineii{texinputs/}{Style implementation for \LaTeX}
152 \lineii{tools/}{Custom processing scripts}
153 \end{tableii}
154
Fred Drakeacffaee1999-03-16 16:09:13 +0000155 \end{definitions}
156
Fred Drake2c4e0091999-03-29 14:55:55 +0000157
Fred Drakef1b3de82001-07-24 14:38:34 +0000158\section{Style Guide \label{style-guide}}
Fred Drake432cef02001-07-06 22:34:33 +0000159
160 The Python documentation should follow the \citetitle
161 [http://developer.apple.com/techpubs/macos8/pdf/apple_styleguide00.pdf]
162 {Apple Publications Style Guide} wherever possible. This particular
163 style guide was selected mostly because it seems reasonable and is
164 easy to get online. (Printed copies are available; see the Apple's
165 \citetitle[http://developer.apple.com/techpubs/faq.html]{Developer
166 Documentation FAQ} for more information.)
167
168 Topics which are not covered in the Apple's style guide will be
169 discussed in this document if necessary.
170
171 Many special names are used in the Python documentation, including
172 the names of operating systems, programming languages, standards
173 bodies, and the like. Many of these were assigned \LaTeX{} macros
174 at some point in the distant past, and these macros lived on long
Fred Drake9120df32001-07-14 02:34:12 +0000175 past their usefulness. In the current markup, most of these entities
176 are not assigned any special markup, but the preferred spellings are
Fred Drake432cef02001-07-06 22:34:33 +0000177 given here to aid authors in maintaining the consistency of
178 presentation in the Python documentation.
179
Fred Drake9120df32001-07-14 02:34:12 +0000180 Other terms and words deserve special mention as well; these conventions
181 should be used to ensure consistency throughout the documentation:
182
Fred Drake432cef02001-07-06 22:34:33 +0000183 \begin{description}
Fred Drake9120df32001-07-14 02:34:12 +0000184 \item[CPU]
185 For ``central processing unit.'' Many style guides say this
186 should be spelled out on the first use (and if you must use it,
187 do so!). For the Python documentation, this abbreviation should
188 be avoided since there's no reasonable way to predict which occurance
189 will be the first seen by the reader. It is better to use the
190 word ``processor'' instead.
191
192 \item[\POSIX]
Fred Drake432cef02001-07-06 22:34:33 +0000193 The name assigned to a particular group of standards. This is
Fred Drake9120df32001-07-14 02:34:12 +0000194 always uppercase. Use the macro \macro{POSIX} to represent this
195 name.
Fred Drake432cef02001-07-06 22:34:33 +0000196
197 \item[Python]
198 The name of our favorite programming language is always
199 capitalized.
200
201 \item[Unicode]
202 The name of a character set and matching encoding. This is
Fred Drake9120df32001-07-14 02:34:12 +0000203 always written capitalized.
204
205 \item[\UNIX]
206 The name of the operating system developed at AT\&T Bell Labs
207 in the early 1970s. Use the macro \macro{UNIX} to use this name.
Fred Drake432cef02001-07-06 22:34:33 +0000208 \end{description}
209
210
Fred Drakeadade921999-04-22 13:05:27 +0000211\section{\LaTeX{} Primer \label{latex-primer}}
Fred Drake2c4e0091999-03-29 14:55:55 +0000212
Fred Drakeadade921999-04-22 13:05:27 +0000213 This section is a brief introduction to \LaTeX{} concepts and
214 syntax, to provide authors enough information to author documents
215 productively without having to become ``\TeX{}nicians.''
216
Fred Drake5eb992b1999-06-11 14:25:45 +0000217 Perhaps the most important concept to keep in mind while marking up
Fred Drake02997492000-09-21 05:26:43 +0000218 Python documentation is that while \TeX{} is unstructured, \LaTeX{} was
Fred Drake5eb992b1999-06-11 14:25:45 +0000219 designed as a layer on top of \TeX{} which specifically supports
220 structured markup. The Python-specific markup is intended to extend
221 the structure provided by standard \LaTeX{} document classes to
222 support additional information specific to Python.
223
Fred Drakeadade921999-04-22 13:05:27 +0000224 \LaTeX{} documents contain two parts: the preamble and the body.
225 The preamble is used to specify certain metadata about the document
226 itself, such as the title, the list of authors, the date, and the
227 \emph{class} the document belongs to. Additional information used
228 to control index generation and the use of bibliographic databases
Fred Drake7a737df1999-04-23 14:41:44 +0000229 can also be placed in the preamble. For most authors, the preamble
Fred Drakeadade921999-04-22 13:05:27 +0000230 can be most easily created by copying it from an existing document
231 and modifying a few key pieces of information.
232
233 The \dfn{class} of a document is used to place a document within a
234 broad category of documents and set some fundamental formatting
235 properties. For Python documentation, two classes are used: the
236 \code{manual} class and the \code{howto} class. These classes also
237 define the additional markup used to document Python concepts and
238 structures. Specific information about these classes is provided in
Fred Drake7a737df1999-04-23 14:41:44 +0000239 section \ref{classes}, ``Document Classes,'' below. The first thing
Fred Drakeadade921999-04-22 13:05:27 +0000240 in the preamble is the declaration of the document's class.
241
242 After the class declaration, a number of \emph{macros} are used to
243 provide further information about the document and setup any
Fred Drake7a737df1999-04-23 14:41:44 +0000244 additional markup that is needed. No output is generated from the
245 preamble; it is an error to include free text in the preamble
246 because it would cause output.
Fred Drakeadade921999-04-22 13:05:27 +0000247
248 The document body follows the preamble. This contains all the
Fred Drake63568aa2000-10-19 05:36:10 +0000249 printed components of the document marked up structurally. Generic
Fred Drake4c6f17a2001-04-18 05:12:47 +0000250 \LaTeX{} structures include hierarchical sections, numbered and
251 bulleted lists, and special structures for the document abstract and
252 indexes.
Fred Drakeadade921999-04-22 13:05:27 +0000253
Fred Drakef1b3de82001-07-24 14:38:34 +0000254 \subsection{Syntax \label{latex-syntax}}
Fred Drake63568aa2000-10-19 05:36:10 +0000255
Fred Drake4c6f17a2001-04-18 05:12:47 +0000256 There are some things that an author of Python documentation needs
257 to know about \LaTeX{} syntax.
Fred Drake63568aa2000-10-19 05:36:10 +0000258
259 A \dfn{comment} is started by the ``percent'' character
260 (\character{\%}) and continues through the end of the line and all
261 leading whitespace on the following line. This is a little
262 different from any programming language I know of, so an example
263 is in order:
264
265\begin{verbatim}
266This is text.% comment
267 This is more text. % another comment
268Still more text.
269\end{verbatim}
270
271 The first non-comment character following the first comment is the
272 letter \character{T} on the second line; the leading whitespace on
273 that line is consumed as part of the first comment. This means
274 that there is no space between the first and second sentences, so
275 the period and letter \character{T} will be directly adjacent in
276 the typeset document.
277
278 Note also that though the first non-comment character after the
279 second comment is the letter \character{S}, there is whitespace
280 preceding the comment, so the two sentences are separated as
281 expected.
282
283 A \dfn{group} is an enclosure for a collection of text and
284 commands which encloses the formatting context and constrains the
285 scope of any changes to that context made by commands within the
286 group. Groups can be nested hierarchically. The formatting
287 context includes the font and the definition of additional macros
288 (or overrides of macros defined in outer groups). Syntactically,
289 groups are enclosed in braces:
290
291\begin{verbatim}
292{text in a group}
293\end{verbatim}
294
Fred Drake4c6f17a2001-04-18 05:12:47 +0000295 An alternate syntax for a group using brackets, \code{[...]}, is
Fred Drake63568aa2000-10-19 05:36:10 +0000296 used by macros and environment constructors which take optional
297 parameters; brackets do not normally hold syntactic significance.
298 A degenerate group, containing only one atomic bit of content,
299 does not need to have an explicit group, unless it is required to
300 avoid ambiguity. Since Python tends toward the explicit, groups
301 are also made explicit in the documentation markup.
302
303 Groups are used only sparingly in the Python documentation, except
304 for their use in marking parameters to macros and environments.
305
Fred Drake4c6f17a2001-04-18 05:12:47 +0000306 A \dfn{macro} is usually a simple construct which is identified by
Fred Drake63568aa2000-10-19 05:36:10 +0000307 name and can take some number of parameters. In normal \LaTeX{}
308 usage, one of these can be optional. The markup is introduced
309 using the backslash character (\character{\e}), and the name is
310 given by alphabetic characters (no digits, hyphens, or
311 underscores). Required parameters should be marked as a group,
312 and optional parameters should be marked using the alternate
313 syntax for a group.
314
315 For example, a macro named ``foo'' which takes a single parameter
316 would appear like this:
317
318\begin{verbatim}
319\name{parameter}
320\end{verbatim}
321
322 A macro which takes an optional parameter would be typed like this
323 when the optional paramter is given:
324
325\begin{verbatim}
326\name[optional]
327\end{verbatim}
328
329 If both optional and required parameters are to be required, it
330 looks like this:
331
332\begin{verbatim}
333\name[optional]{required}
334\end{verbatim}
335
336 A macro name may be followed by a space or newline; a space
337 between the macro name and any parameters will be consumed, but
338 this usage is not practiced in the Python documentation. Such a
Fred Drake4c6f17a2001-04-18 05:12:47 +0000339 space is still consumed if there are no parameters to the macro,
Fred Drake63568aa2000-10-19 05:36:10 +0000340 in which case inserting an empty group (\code{\{\}}) or explicit
341 word space (\samp{\e\ }) immediately after the macro name helps to
342 avoid running the expansion of the macro into the following text.
343 Macros which take no parameters but which should not be followed
344 by a word space do not need special treatment if the following
345 character in the document source if not a name character (such as
Fred Drake4c6f17a2001-04-18 05:12:47 +0000346 punctuation).
Fred Drake63568aa2000-10-19 05:36:10 +0000347
348 Each line of this example shows an appropriate way to write text
349 which includes a macro which takes no parameters:
350
351\begin{verbatim}
352This \UNIX{} is followed by a space.
353This \UNIX\ is also followed by a space.
354\UNIX, followed by a comma, needs no additional markup.
355\end{verbatim}
356
Fred Draked097d482000-10-20 20:51:31 +0000357 An \dfn{environment} is a larger construct than a macro, and can
Fred Drake4c6f17a2001-04-18 05:12:47 +0000358 be used for things with more content than would conveniently fit
Fred Draked097d482000-10-20 20:51:31 +0000359 in a macro parameter. They are primarily used when formatting
360 parameters need to be changed before and after a large chunk of
361 content, but the content itself needs to be highly flexible. Code
362 samples are presented using an environment, and descriptions of
Fred Drake4c6f17a2001-04-18 05:12:47 +0000363 functions, methods, and classes are also marked using environments.
Fred Draked097d482000-10-20 20:51:31 +0000364
365 Since the content of an environment is free-form and can consist
366 of several paragraphs, they are actually marked using a pair of
367 macros: \macro{begin} and \macro{end}. These macros both take the
368 name of the environment as a parameter. An example is the
369 environment used to mark the abstract of a document:
370
371\begin{verbatim}
372\begin{abstract}
373 This is the text of the abstract. It concisely explains what
374 information is found in the document.
375
376 It can consist of multiple paragraphs.
377\end{abstract}
378\end{verbatim}
379
380 An environment can also have required and optional parameters of
381 its own. These follow the parameter of the \macro{begin} macro.
382 This example shows an environment which takes a single required
383 parameter:
384
385\begin{verbatim}
Fred Drake2bbc6972001-03-28 16:51:20 +0000386\begin{datadesc}{controlnames}
Fred Draked097d482000-10-20 20:51:31 +0000387 A 33-element string array that contains the \ASCII{} mnemonics for
388 the thirty-two \ASCII{} control characters from 0 (NUL) to 0x1f
389 (US), in order, plus the mnemonic \samp{SP} for the space character.
390\end{datadesc}
391\end{verbatim}
Fred Drake63568aa2000-10-19 05:36:10 +0000392
Fred Drake4c6f17a2001-04-18 05:12:47 +0000393 There are a number of less-used marks in \LaTeX{} which are used
Fred Drakee789ea12002-03-13 02:48:24 +0000394 to enter characters which are not found in \ASCII{} or which a
395 considered special, or \emph{active} in \TeX{} or \LaTeX. Given
396 that these are often used adjacent to other characters, the markup
397 required to produce the proper character may need to be followed
398 by a space or an empty group, or the markup can be enclosed in a
399 group. Some which are found in Python documentation are:
Fred Drake63568aa2000-10-19 05:36:10 +0000400
Fred Draked097d482000-10-20 20:51:31 +0000401\begin{tableii}{c|l}{textrm}{Character}{Markup}
Fred Drakee789ea12002-03-13 02:48:24 +0000402 \lineii{\textasciicircum}{\code{\e textasciicircum}}
403 \lineii{\textasciitilde}{\code{\e textasciitilde}}
404 \lineii{\textgreater}{\code{\e textgreater}}
405 \lineii{\textless}{\code{\e textless}}
Fred Draked097d482000-10-20 20:51:31 +0000406 \lineii{\c c}{\code{\e c c}}
407 \lineii{\"o}{\code{\e"o}}
408 \lineii{\o}{\code{\e o}}
409\end{tableii}
Fred Drake63568aa2000-10-19 05:36:10 +0000410
411
Fred Drakef1b3de82001-07-24 14:38:34 +0000412 \subsection{Hierarchical Structure \label{latex-syntax}}
Fred Drake63568aa2000-10-19 05:36:10 +0000413
Fred Draked097d482000-10-20 20:51:31 +0000414 \LaTeX{} expects documents to be arranged in a conventional,
415 hierarchical way, with chapters, sections, sub-sections,
416 appendixes, and the like. These are marked using macros rather
417 than environments, probably because the end of a section can be
418 safely inferred when a section of equal or higher level starts.
419
420 There are six ``levels'' of sectioning in the document classes
Fred Drake4c6f17a2001-04-18 05:12:47 +0000421 used for Python documentation, and the deepest two
422 levels\footnote{The deepest levels have the highest numbers in the
423 table.} are not used. The levels are:
Fred Draked097d482000-10-20 20:51:31 +0000424
425 \begin{tableiii}{c|l|c}{textrm}{Level}{Macro Name}{Notes}
426 \lineiii{1}{\macro{chapter}}{(1)}
427 \lineiii{2}{\macro{section}}{}
428 \lineiii{3}{\macro{subsection}}{}
Fred Drakeb7a52c92000-11-27 20:10:18 +0000429 \lineiii{4}{\macro{subsubsection}}{}
Fred Draked097d482000-10-20 20:51:31 +0000430 \lineiii{5}{\macro{paragraph}}{(2)}
431 \lineiii{6}{\macro{subparagraph}}{}
432 \end{tableiii}
433
434 \noindent
435 Notes:
436
437 \begin{description}
438 \item[(1)]
439 Only used for the \code{manual} documents, as described in
440 section \ref{classes}, ``Document Classes.''
441 \item[(2)]
442 Not the same as a paragraph of text; nobody seems to use this.
443 \end{description}
Fred Drake2c4e0091999-03-29 14:55:55 +0000444
445
Fred Drakeadade921999-04-22 13:05:27 +0000446\section{Document Classes \label{classes}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000447
448 Two \LaTeX{} document classes are defined specifically for use with
449 the Python documentation. The \code{manual} class is for large
450 documents which are sectioned into chapters, and the \code{howto}
451 class is for smaller documents.
452
453 The \code{manual} documents are larger and are used for most of the
454 standard documents. This document class is based on the standard
455 \LaTeX{} \code{report} class and is formatted very much like a long
Fred Drake698d5201999-11-10 15:54:57 +0000456 technical report. The \citetitle[../ref/ref.html]{Python Reference
457 Manual} is a good example of a \code{manual} document, and the
458 \citetitle[../lib/lib.html]{Python Library Reference} is a large
459 example.
Fred Drakeacffaee1999-03-16 16:09:13 +0000460
461 The \code{howto} documents are shorter, and don't have the large
462 structure of the \code{manual} documents. This class is based on
463 the standard \LaTeX{} \code{article} class and is formatted somewhat
464 like the Linux Documentation Project's ``HOWTO'' series as done
465 originally using the LinuxDoc software. The original intent for the
466 document class was that it serve a similar role as the LDP's HOWTO
467 series, but the applicability of the class turns out to be somewhat
Fred Drake02997492000-09-21 05:26:43 +0000468 broader. This class is used for ``how-to'' documents (this
Fred Drakeacffaee1999-03-16 16:09:13 +0000469 document is an example) and for shorter reference manuals for small,
470 fairly cohesive module libraries. Examples of the later use include
Fred Drake6a547c72000-09-15 22:11:24 +0000471\citetitle[http://starship.python.net/crew/fdrake/manuals/krb5py/krb5py.html]{Using
Fred Drakeacffaee1999-03-16 16:09:13 +0000472 Kerberos from Python}, which contains reference material for an
473 extension package. These documents are roughly equivalent to a
474 single chapter from a larger work.
475
476
Fred Drakef1b3de82001-07-24 14:38:34 +0000477\section{Special Markup Constructs \label{special-constructs}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000478
Fred Drake2c4e0091999-03-29 14:55:55 +0000479 The Python document classes define a lot of new environments and
480 macros. This section contains the reference material for these
481 facilities.
482
Fred Drakeaf2b7142000-09-14 20:11:05 +0000483 \subsection{Markup for the Preamble \label{preamble-info}}
484
485 \begin{macrodesc}{release}{\p{ver}}
486 Set the version number for the software described in the
487 document.
488 \end{macrodesc}
489
490 \begin{macrodesc}{setshortversion}{\p{sver}}
491 Specify the ``short'' version number of the documented software
492 to be \var{sver}.
493 \end{macrodesc}
494
Fred Drakee15956b2000-04-03 04:51:13 +0000495 \subsection{Meta-information Markup \label{meta-info}}
496
497 \begin{macrodesc}{sectionauthor}{\p{author}\p{email}}
498 Identifies the author of the current section. \var{author}
499 should be the author's name such that it can be used for
500 presentation (though it isn't), and \var{email} should be the
501 author's email address. The domain name portion of
502 the address should be lower case.
503
504 No presentation is generated from this markup, but it is used to
505 help keep track of contributions.
506 \end{macrodesc}
507
Fred Drakeacffaee1999-03-16 16:09:13 +0000508 \subsection{Information Units \label{info-units}}
509
Fred Drake2f4bebd1999-04-28 16:43:11 +0000510 XXX Explain terminology, or come up with something more ``lay.''
Fred Drakeacffaee1999-03-16 16:09:13 +0000511
Fred Drakeadade921999-04-22 13:05:27 +0000512 There are a number of environments used to describe specific
513 features provided by modules. Each environment requires
514 parameters needed to provide basic information about what is being
515 described, and the environment content should be the description.
516 Most of these environments make entries in the general index (if
517 one is being produced for the document); if no index entry is
518 desired, non-indexing variants are available for many of these
519 environments. The environments have names of the form
520 \code{\var{feature}desc}, and the non-indexing variants are named
521 \code{\var{feature}descni}. The available variants are explicitly
522 included in the list below.
523
524 For each of these environments, the first parameter, \var{name},
525 provides the name by which the feature is accessed.
526
527 Environments which describe features of objects within a module,
528 such as object methods or data attributes, allow an optional
529 \var{type name} parameter. When the feature is an attribute of
530 class instances, \var{type name} only needs to be given if the
531 class was not the most recently described class in the module; the
532 \var{name} value from the most recent \env{classdesc} is implied.
533 For features of built-in or extension types, the \var{type name}
Fred Drake7a737df1999-04-23 14:41:44 +0000534 value should always be provided. Another special case includes
535 methods and members of general ``protocols,'' such as the
536 formatter and writer protocols described for the
537 \module{formatter} module: these may be documented without any
538 specific implementation classes, and will always require the
539 \var{type name} parameter to be provided.
Fred Drakeadade921999-04-22 13:05:27 +0000540
Fred Drake7be440d2000-09-16 21:23:25 +0000541 \begin{envdesc}{cfuncdesc}{\p{type}\p{name}\p{args}}
542 Environment used to described a C function. The \var{type}
543 should be specified as a \keyword{typedef} name, \code{struct
544 \var{tag}}, or the name of a primitive type. If it is a pointer
Fred Drake02997492000-09-21 05:26:43 +0000545 type, the trailing asterisk should not be preceded by a space.
Fred Drake7be440d2000-09-16 21:23:25 +0000546 \var{name} should be the name of the function (or function-like
547 pre-processor macro), and \var{args} should give the types and
548 names of the parameters. The names need to be given so they may
549 be used in the description.
550 \end{envdesc}
551
Fred Drake79bf99c2002-04-09 20:17:42 +0000552 \begin{envdesc}{csimplemacrodesc}{\p{name}}
553 Documentation for a ``simple'' macro. Simple macros are macros
554 which are used for code expansion, but which do not take
555 arguments so cannot be described as functions. This is not to
556 be used for simple constant definitions. Examples of it's use
557 in the Python documentation include
558 \csimplemacro{PyObject_HEAD} and
559 \csimplemacro{Py_BEGIN_ALLOW_THREADS}.
560 \end{envdesc}
561
Fred Drake7be440d2000-09-16 21:23:25 +0000562 \begin{envdesc}{ctypedesc}{\op{tag}\p{name}}
563 Environment used to described a C type. The \var{name}
564 parameter should be the \keyword{typedef} name. If the type is
565 defined as a \keyword{struct} without a \keyword{typedef},
566 \var{name} should have the form \code{struct \var{tag}}.
567 \var{name} will be added to the index unless \var{tag} is
568 provided, in which case \var{tag} will be used instead.
569 \var{tag} should not be used for a \keyword{typedef} name.
570 \end{envdesc}
571
572 \begin{envdesc}{cvardesc}{\p{type}\p{name}}
573 Description of a global C variable. \var{type} should be the
574 \keyword{typedef} name, \code{struct \var{tag}}, or the name of
575 a primitive type. If variable has a pointer type, the trailing
Fred Drake02997492000-09-21 05:26:43 +0000576 asterisk should \emph{not} be preceded by a space.
Fred Drake7be440d2000-09-16 21:23:25 +0000577 \end{envdesc}
578
Fred Drakeadade921999-04-22 13:05:27 +0000579 \begin{envdesc}{datadesc}{\p{name}}
580 This environment is used to document global data in a module,
581 including both variables and values used as ``defined
582 constants.'' Class and object attributes are not documented
583 using this environment.
Fred Drakeacffaee1999-03-16 16:09:13 +0000584 \end{envdesc}
Fred Drake7a737df1999-04-23 14:41:44 +0000585 \begin{envdesc}{datadescni}{\p{name}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000586 Like \env{datadesc}, but without creating any index entries.
587 \end{envdesc}
588
Fred Drake9f2376d2001-05-11 01:01:12 +0000589 \begin{envdesc}{excclassdesc}{\p{name}\p{constructor parameters}}
590 Descibe an exception defined by a class. \var{constructor
591 parameters} should not include the \var{self} parameter or
592 the parentheses used in the call syntax. To describe an
593 exception class without describing the parameters to its
594 constructor, use the \env{excdesc} environment.
595 \end{envdesc}
596
Fred Drakeadade921999-04-22 13:05:27 +0000597 \begin{envdesc}{excdesc}{\p{name}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000598 Describe an exception. This may be either a string exception or
Fred Drake9f2376d2001-05-11 01:01:12 +0000599 a class exception. In the case of class exceptions, the
600 constructor parameters are not described; use \env{excclassdesc}
601 to describe an exception class and its constructor.
Fred Drakeacffaee1999-03-16 16:09:13 +0000602 \end{envdesc}
603
Fred Drakeadade921999-04-22 13:05:27 +0000604 \begin{envdesc}{funcdesc}{\p{name}\p{parameters}}
605 Describe a module-level function. \var{parameters} should
606 not include the parentheses used in the call syntax. Object
607 methods are not documented using this environment. Bound object
608 methods placed in the module namespace as part of the public
609 interface of the module are documented using this, as they are
610 equivalent to normal functions for most purposes.
611
612 The description should include information about the parameters
613 required and how they are used (especially whether mutable
614 objects passed as parameters are modified), side effects, and
615 possible exceptions. A small example may be provided.
Fred Drakeacffaee1999-03-16 16:09:13 +0000616 \end{envdesc}
Fred Drakeadade921999-04-22 13:05:27 +0000617 \begin{envdesc}{funcdescni}{\p{name}\p{parameters}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000618 Like \env{funcdesc}, but without creating any index entries.
619 \end{envdesc}
620
Fred Drakeadade921999-04-22 13:05:27 +0000621 \begin{envdesc}{classdesc}{\p{name}\p{constructor parameters}}
622 Describe a class and its constructor. \var{constructor
623 parameters} should not include the \var{self} parameter or
624 the parentheses used in the call syntax.
Fred Drakeacffaee1999-03-16 16:09:13 +0000625 \end{envdesc}
626
Fred Drake9f2376d2001-05-11 01:01:12 +0000627 \begin{envdesc}{classdesc*}{\p{name}}
628 Describe a class without describing the constructor. This can
629 be used to describe classes that are merely containers for
630 attributes or which should never be instantiated or subclassed
631 by user code.
632 \end{envdesc}
633
Fred Drakeadade921999-04-22 13:05:27 +0000634 \begin{envdesc}{memberdesc}{\op{type name}\p{name}}
635 Describe an object data attribute. The description should
636 include information about the type of the data to be expected
637 and whether it may be changed directly.
Fred Drakeacffaee1999-03-16 16:09:13 +0000638 \end{envdesc}
Fred Drakeadade921999-04-22 13:05:27 +0000639 \begin{envdesc}{memberdescni}{\op{type name}\p{name}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000640 Like \env{memberdesc}, but without creating any index entries.
641 \end{envdesc}
642
Fred Drakeadade921999-04-22 13:05:27 +0000643 \begin{envdesc}{methoddesc}{\op{type name}\p{name}\p{parameters}}
644 Describe an object method. \var{parameters} should not include
645 the \var{self} parameter or the parentheses used in the call
646 syntax. The description should include similar information to
647 that described for \env{funcdesc}.
Fred Drakeacffaee1999-03-16 16:09:13 +0000648 \end{envdesc}
Fred Drakeadade921999-04-22 13:05:27 +0000649 \begin{envdesc}{methoddescni}{\op{type name}\p{name}\p{parameters}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000650 Like \env{methoddesc}, but without creating any index entries.
651 \end{envdesc}
652
653
Fred Drakef1b3de82001-07-24 14:38:34 +0000654 \subsection{Showing Code Examples \label{showing-examples}}
Fred Drake5eb992b1999-06-11 14:25:45 +0000655
656 Examples of Python source code or interactive sessions are
657 represented as \env{verbatim} environments. This environment
658 is a standard part of \LaTeX{}. It is important to only use
659 spaces for indentation in code examples since \TeX{} drops tabs
660 instead of converting them to spaces.
661
662 Representing an interactive session requires including the prompts
663 and output along with the Python code. No special markup is
Fred Drake63568aa2000-10-19 05:36:10 +0000664 required for interactive sessions. After the last line of input
665 or output presented, there should not be an ``unused'' primary
666 prompt; this is an example of what \emph{not} to do:
667
668\begin{verbatim}
669>>> 1 + 1
6702
671>>>
672\end{verbatim}
Fred Drake5eb992b1999-06-11 14:25:45 +0000673
674 Within the \env{verbatim} environment, characters special to
675 \LaTeX{} do not need to be specially marked in any way. The entire
676 example will be presented in a monospaced font; no attempt at
677 ``pretty-printing'' is made, as the environment must work for
Fred Drake63568aa2000-10-19 05:36:10 +0000678 non-Python code and non-code displays. There should be no blank
679 lines at the top or bottom of any \env{verbatim} display.
Fred Drake5eb992b1999-06-11 14:25:45 +0000680
Fred Drake66eed242001-06-18 14:59:58 +0000681 Longer displays of verbatim text may be included by storing the
682 example text in an external file containing only plain text. The
683 file may be included using the standard \macro{verbatiminput}
684 macro; this macro takes a single argument naming the file
685 containing the text. For example, to include the Python source
686 file \file{example.py}, use:
687
688\begin{verbatim}
689\verbatiminput{example.py}
690\end{verbatim}
691
692 Use of \macro{verbatiminput} allows easier use of special editing
693 modes for the included file. The file should be placed in the
694 same directory as the \LaTeX{} files for the document.
695
Fred Drake5eb992b1999-06-11 14:25:45 +0000696 The Python Documentation Special Interest Group has discussed a
697 number of approaches to creating pretty-printed code displays and
698 interactive sessions; see the Doc-SIG area on the Python Web site
699 for more information on this topic.
700
701
Fred Drakef1b3de82001-07-24 14:38:34 +0000702 \subsection{Inline Markup \label{inline-markup}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000703
Fred Drake87f768e1999-05-17 15:22:45 +0000704 The macros described in this section are used to mark just about
705 anything interesting in the document text. They may be used in
706 headings (though anything involving hyperlinks should be avoided
707 there) as well as in the body text.
Fred Drake2f4bebd1999-04-28 16:43:11 +0000708
709 \begin{macrodesc}{bfcode}{\p{text}}
710 Like \macro{code}, but also makes the font bold-face.
711 \end{macrodesc}
712
713 \begin{macrodesc}{cdata}{\p{name}}
714 The name of a C-language variable.
715 \end{macrodesc}
716
717 \begin{macrodesc}{cfunction}{\p{name}}
718 The name of a C-language function. \var{name} should include the
719 function name and the trailing parentheses.
720 \end{macrodesc}
721
722 \begin{macrodesc}{character}{\p{char}}
723 A character when discussing the character rather than a one-byte
724 string value. The character will be typeset as with \macro{samp}.
725 \end{macrodesc}
726
Fred Drake29a710f1999-11-10 22:51:18 +0000727 \begin{macrodesc}{citetitle}{\op{url}\p{title}}
728 A title for a referenced publication. If \var{url} is specified,
729 the title will be made into a hyperlink when formatted as HTML.
730 \end{macrodesc}
731
Fred Drake2f4bebd1999-04-28 16:43:11 +0000732 \begin{macrodesc}{class}{\p{name}}
733 A class name; a dotted name may be used.
734 \end{macrodesc}
735
736 \begin{macrodesc}{code}{\p{text}}
737 A short code fragment or literal constant value. Typically, it
738 should not include any spaces since no quotation marks are
739 added.
740 \end{macrodesc}
741
742 \begin{macrodesc}{constant}{\p{name}}
743 The name of a ``defined'' constant. This may be a C-language
744 \code{\#define} or a Python variable that is not intended to be
745 changed.
746 \end{macrodesc}
747
Fred Drake79bf99c2002-04-09 20:17:42 +0000748 \begin{macrodesc}{csimplemacro}{\p{name}}
749 The name of a ``simple'' macro. Simple macros are macros
750 which are used for code expansion, but which do not take
751 arguments so cannot be described as functions. This is not to
752 be used for simple constant definitions. Examples of it's use
753 in the Python documentation include
754 \csimplemacro{PyObject_HEAD} and
755 \csimplemacro{Py_BEGIN_ALLOW_THREADS}.
756 \end{macrodesc}
757
Fred Drake2f4bebd1999-04-28 16:43:11 +0000758 \begin{macrodesc}{ctype}{\p{name}}
759 The name of a C \keyword{typedef} or structure. For structures
760 defined without a \keyword{typedef}, use \code{\e ctype\{struct
761 struct_tag\}} to make it clear that the \keyword{struct} is
762 required.
763 \end{macrodesc}
764
765 \begin{macrodesc}{deprecated}{\p{version}\p{what to do}}
766 Declare whatever is being described as being deprecated starting
767 with release \var{version}. The text given as \var{what to do}
768 should recommend something to use instead.
769 \end{macrodesc}
770
771 \begin{macrodesc}{dfn}{\p{term}}
772 Mark the defining instance of \var{term} in the text. (No index
773 entries are generated.)
774 \end{macrodesc}
775
Fred Draked1fb7791999-05-17 16:33:54 +0000776 \begin{macrodesc}{e}{}
777 Produces a backslash. This is convenient in \macro{code} and
Fred Drake31edf4d2000-09-07 20:06:07 +0000778 similar macros, and is only defined there. To create a
Fred Drake2b853412000-04-11 19:08:30 +0000779 backslash in ordinary text (such as the contents of the
780 \macro{file} macro), use the standard \macro{textbackslash} macro.
Fred Draked1fb7791999-05-17 16:33:54 +0000781 \end{macrodesc}
782
Fred Drake2f4bebd1999-04-28 16:43:11 +0000783 \begin{macrodesc}{email}{\p{address}}
784 An email address. Note that this is \emph{not} hyperlinked in
Fred Drakee15956b2000-04-03 04:51:13 +0000785 any of the possible output formats. The domain name portion of
786 the address should be lower case.
Fred Drake2f4bebd1999-04-28 16:43:11 +0000787 \end{macrodesc}
788
789 \begin{macrodesc}{emph}{\p{text}}
790 Emphasized text; this will be presented in an italic font.
791 \end{macrodesc}
792
793 \begin{macrodesc}{envvar}{\p{name}}
794 An environment variable. Index entries are generated.
795 \end{macrodesc}
796
797 \begin{macrodesc}{exception}{\p{name}}
798 The name of an exception. A dotted name may be used.
799 \end{macrodesc}
800
801 \begin{macrodesc}{file}{\p{file or dir}}
802 The name of a file or directory. In the PDF and PostScript
803 outputs, single quotes and a font change are used to indicate
804 the file name, but no quotes are used in the HTML output.
Fred Drake64a5aaf2001-10-20 04:18:14 +0000805 \warning{The \macro{file} macro cannot be used in the
806 content of a section title due to processing limitations.}
Fred Drake2f4bebd1999-04-28 16:43:11 +0000807 \end{macrodesc}
808
809 \begin{macrodesc}{filenq}{\p{file or dir}}
810 Like \macro{file}, but single quotes are never used. This can
811 be used in conjunction with tables if a column will only contain
812 file or directory names.
Fred Drake64a5aaf2001-10-20 04:18:14 +0000813 \warning{The \macro{filenq} macro cannot be used in the
814 content of a section title due to processing limitations.}
Fred Drake2f4bebd1999-04-28 16:43:11 +0000815 \end{macrodesc}
816
817 \begin{macrodesc}{function}{\p{name}}
818 The name of a Python function; dotted names may be used.
819 \end{macrodesc}
820
Fred Drake432cef02001-07-06 22:34:33 +0000821 \begin{macrodesc}{infinity}{}
822 The symbol for mathematical infinity: \infinity. Some Web
823 browsers are not able to render the HTML representation of this
824 symbol properly, but support is growing.
825 \end{macrodesc}
826
Fred Drake2f4bebd1999-04-28 16:43:11 +0000827 \begin{macrodesc}{kbd}{\p{key sequence}}
828 Mark a sequence of keystrokes. What form \var{key sequence}
829 takes may depend on platform- or application-specific
Fred Drake07178d22001-07-12 02:08:29 +0000830 conventions. When there are no relevant conventions, the names
831 of modifier keys should be spelled out, to improve accessibility
832 for new users and non-native speakers. For example, an
833 \program{xemacs} key sequence may be marked like
834 \code{\e kbd\{C-x C-f\}}, but without reference to a specific
835 application or platform, the same sequence should be marked as
836 \code{\e kbd\{Control-x Control-f\}}.
Fred Drake2f4bebd1999-04-28 16:43:11 +0000837 \end{macrodesc}
838
839 \begin{macrodesc}{keyword}{\p{name}}
840 The name of a keyword in a programming language.
841 \end{macrodesc}
842
Fred Drake8b3a7b52001-09-26 17:01:58 +0000843 \begin{macrodesc}{mailheader}{\p{name}}
844 The name of an \rfc{822}-style mail header. This markup does
845 not imply that the header is being used in an email message, but
846 can be used to refer to any header of the same ``style.'' This
847 is also used for headers defined by the various MIME
848 specifications. The header name should be entered in the same
849 way it would normally be found in practice, with the
850 camel-casing conventions being preferred where there is more
Fred Drake203d91a2001-09-26 18:43:20 +0000851 than one common usage. The colon which follows the name of the
852 header should not be included.
853 For example: \code{\e mailheader\{Content-Type\}}.
Fred Drake8b3a7b52001-09-26 17:01:58 +0000854 \end{macrodesc}
855
Fred Drake2f4bebd1999-04-28 16:43:11 +0000856 \begin{macrodesc}{makevar}{\p{name}}
857 The name of a \program{make} variable.
858 \end{macrodesc}
859
860 \begin{macrodesc}{manpage}{\p{name}\p{section}}
861 A reference to a \UNIX{} manual page.
862 \end{macrodesc}
863
864 \begin{macrodesc}{member}{\p{name}}
865 The name of a data attribute of an object.
866 \end{macrodesc}
867
868 \begin{macrodesc}{method}{\p{name}}
869 The name of a method of an object. \var{name} should include the
870 method name and the trailing parentheses. A dotted name may be
871 used.
872 \end{macrodesc}
873
874 \begin{macrodesc}{mimetype}{\p{name}}
Fred Drake8b3a7b52001-09-26 17:01:58 +0000875 The name of a MIME type, or a component of a MIME type (the
876 major or minor portion, taken alone).
Fred Drake2f4bebd1999-04-28 16:43:11 +0000877 \end{macrodesc}
878
879 \begin{macrodesc}{module}{\p{name}}
Fred Drake2b853412000-04-11 19:08:30 +0000880 The name of a module; a dotted name may be used. This should
881 also be used for package names.
Fred Drake2f4bebd1999-04-28 16:43:11 +0000882 \end{macrodesc}
883
884 \begin{macrodesc}{newsgroup}{\p{name}}
Fred Drake9120df32001-07-14 02:34:12 +0000885 The name of a Usenet newsgroup.
Fred Drake2f4bebd1999-04-28 16:43:11 +0000886 \end{macrodesc}
887
Fred Drake92350b32001-10-09 18:01:23 +0000888 \begin{macrodesc}{note}{\p{text}}
889 An especially important bit of information about an API that a
890 user should be aware of when using whatever bit of API the
891 note pertains to. This should be the last thing in the
892 paragraph as the end of the note is not visually marked in
Fred Drake64a5aaf2001-10-20 04:18:14 +0000893 any way. The content of \var{text} should be written in
894 complete sentences and include all appropriate punctuation.
Fred Drake92350b32001-10-09 18:01:23 +0000895 \end{macrodesc}
896
Fred Drake432cef02001-07-06 22:34:33 +0000897 \begin{macrodesc}{pep}{\p{number}}
898 A reference to a Python Enhancement Proposal. This generates
899 appropriate index entries. The text \samp{PEP \var{number}} is
900 generated; in the HTML output, this text is a hyperlink to an
901 online copy of the specified PEP.
902 \end{macrodesc}
903
904 \begin{macrodesc}{plusminus}{}
905 The symbol for indicating a value that may take a positive or
906 negative value of a specified magnitude, typically represented
907 by a plus sign placed over a minus sign. For example:
Fred Drake203d91a2001-09-26 18:43:20 +0000908 \code{\e plusminus 3\%{}}.
Fred Drake432cef02001-07-06 22:34:33 +0000909 \end{macrodesc}
910
Fred Drake2f4bebd1999-04-28 16:43:11 +0000911 \begin{macrodesc}{program}{\p{name}}
912 The name of an executable program. This may differ from the
913 file name for the executable for some platforms. In particular,
914 the \file{.exe} (or other) extension should be omitted for DOS
915 and Windows programs.
916 \end{macrodesc}
917
Fred Drake29a710f1999-11-10 22:51:18 +0000918 \begin{macrodesc}{programopt}{\p{option}}
Fred Drakece444982000-04-11 18:52:52 +0000919 A command-line option to an executable program. Use this only
920 for ``shot'' options, and include the leading hyphen.
921 \end{macrodesc}
922
923 \begin{macrodesc}{longprogramopt}{\p{option}}
924 A long command-line option to an executable program. This
925 should only be used for long option names which will be prefixed
926 by two hyphens; the hyphens should not be provided as part of
927 \var{option}.
Fred Drake29a710f1999-11-10 22:51:18 +0000928 \end{macrodesc}
929
Fred Drake2f4bebd1999-04-28 16:43:11 +0000930 \begin{macrodesc}{refmodule}{\op{key}\p{name}}
931 Like \macro{module}, but create a hyperlink to the documentation
932 for the named module. Note that the corresponding
933 \macro{declaremodule} must be in the same document. If the
934 \macro{declaremodule} defines a module key different from the
935 module name, it must also be provided as \var{key} to the
936 \macro{refmodule} macro.
937 \end{macrodesc}
938
939 \begin{macrodesc}{regexp}{\p{string}}
940 Mark a regular expression.
941 \end{macrodesc}
942
943 \begin{macrodesc}{rfc}{\p{number}}
944 A reference to an Internet Request for Comments. This generates
945 appropriate index entries. The text \samp{RFC \var{number}} is
946 generated; in the HTML output, this text is a hyperlink to an
947 online copy of the specified RFC.
948 \end{macrodesc}
949
950 \begin{macrodesc}{samp}{\p{text}}
951 A short code sample, but possibly longer than would be given
952 using \macro{code}. Since quotation marks are added, spaces are
953 acceptable.
954 \end{macrodesc}
955
Fred Drakeaf2b7142000-09-14 20:11:05 +0000956 \begin{macrodesc}{shortversion}{}
957 The ``short'' version number of the documented software, as
958 specified using the \macro{setshortversion} macro in the
959 preamble. For Python, the short version number for a release is
960 the first three characters of the \code{sys.version} value. For
961 example, versions 2.0b1 and 2.0.1 both have a short version of
962 2.0. This may not apply for all packages; if
963 \macro{setshortversion} is not used, this produces an empty
964 expansion. See also the \macro{version} macro.
965 \end{macrodesc}
966
Fred Drake2f4bebd1999-04-28 16:43:11 +0000967 \begin{macrodesc}{strong}{\p{text}}
968 Strongly emphasized text; this will be presented using a bold
969 font.
970 \end{macrodesc}
971
Fred Drake432cef02001-07-06 22:34:33 +0000972 \begin{macrodesc}{ulink}{\p{text}\p{url}}
973 A hypertext link with a target specified by a URL, but for which
974 the link text should not be the title of the resource. For
975 resources being referenced by name, use the \macro{citetitle}
976 macro. Not all formatted versions support arbitrary hypertext
977 links. Note that many characters are special to \LaTeX{} and
978 this macro does not always do the right thing. In particular,
979 the tilde character (\character{\~}) is mis-handled; encoding it
980 as a hex-sequence does work, use \samp{\%7e} in place of the
981 tilde character.
982 \end{macrodesc}
983
Fred Draked1fb7791999-05-17 16:33:54 +0000984 \begin{macrodesc}{url}{\p{url}}
985 A URL (or URN). The URL will be presented as text. In the HTML
986 and PDF formatted versions, the URL will also be a hyperlink.
Fred Drake432cef02001-07-06 22:34:33 +0000987 This can be used when referring to external resources without
988 specific titles; references to resources which have titles
989 should be marked using the \macro{citetitle} macro. See the
990 comments about special characters in the description of the
991 \macro{ulink} macro for special considerations.
Fred Draked1fb7791999-05-17 16:33:54 +0000992 \end{macrodesc}
993
Fred Drake2f4bebd1999-04-28 16:43:11 +0000994 \begin{macrodesc}{var}{\p{name}}
995 The name of a variable or formal parameter in running text.
996 \end{macrodesc}
997
998 \begin{macrodesc}{version}{}
Fred Drakeaf2b7142000-09-14 20:11:05 +0000999 The version number of the described software, as specified using
1000 \macro{release} in the preamble. See also the
1001 \macro{shortversion} macro.
Fred Drake2f4bebd1999-04-28 16:43:11 +00001002 \end{macrodesc}
Fred Drakeacffaee1999-03-16 16:09:13 +00001003
Fred Drake3151f442001-04-18 05:19:06 +00001004 \begin{macrodesc}{versionadded}{\op{explanation}\p{version}}
Fred Drakec26cc912000-05-02 17:43:44 +00001005 The version of Python which added the described feature to the
Fred Drake3151f442001-04-18 05:19:06 +00001006 library or C API. \var{explanation} should be a \emph{brief}
1007 explanation of the change consisting of a capitalized sentence
1008 fragment; a period will be appended by the formatting process.
1009 This is typically added to the end of the first paragraph of the
1010 description before any availability notes. The location should
1011 be selected so the explanation makes sense and may vary as
1012 needed.
Fred Drakec26cc912000-05-02 17:43:44 +00001013 \end{macrodesc}
1014
1015 \begin{macrodesc}{versionchanged}{\op{explanation}\p{version}}
1016 The version of Python in which the named feature was changed in
1017 some way (new parameters, changed side effects, etc.).
1018 \var{explanation} should be a \emph{brief} explanation of the
Fred Drake63568aa2000-10-19 05:36:10 +00001019 change consisting of a capitalized sentence fragment; a
Fred Drakec26cc912000-05-02 17:43:44 +00001020 period will be appended by the formatting process.
1021 This is typically added to the end of the first paragraph of the
1022 description before any availability notes and after
1023 \macro{versionadded}. The location should be selected so the
1024 explanation makes sense and may vary as needed.
1025 \end{macrodesc}
1026
Fred Drake92350b32001-10-09 18:01:23 +00001027 \begin{macrodesc}{warning}{\p{text}}
1028 An important bit of information about an API that a user should
1029 be very aware of when using whatever bit of API the warning
1030 pertains to. This should be the last thing in the paragraph as
Fred Drake64a5aaf2001-10-20 04:18:14 +00001031 the end of the warning is not visually marked in any way. The
1032 content of \var{text} should be written in complete sentences
1033 and include all appropriate punctuation. This differs from
1034 \macro{note} in that it is recommended over \macro{note} for
1035 information regarding security.
Fred Drake92350b32001-10-09 18:01:23 +00001036 \end{macrodesc}
1037
Fred Drakeacffaee1999-03-16 16:09:13 +00001038
Fred Drake6ca33772001-12-14 22:50:06 +00001039 \subsection{Miscellaneous Text Markup \label{misc-text-markup}}
1040
1041 In addition to the inline markup, some additional ``block'' markup
1042 is defined to make it easier to bring attention to various bits of
1043 text. The markup described here serves this purpose, and is
1044 intended to be used when marking one or more paragraphs or other
1045 block constructs (such as \env{verbatim} environments).
1046
1047 \begin{envdesc}{notice}{\op{type}}
1048 Label some paragraphs as being worthy of additional attention from
1049 the reader. What sort of attention is warrented can be indicated
1050 by specifying the \var{type} of the notice. The only values
1051 defined for \var{type} are \code{note} and \code{warning}; these
1052 are equivalent in intent to the inline markup of the same name.
1053 If \var{type} is omitted, \code{note} is used. Additional values
1054 may be defined in the future.
1055 \end{envdesc}
1056
1057
Fred Drakef1b3de82001-07-24 14:38:34 +00001058 \subsection{Module-specific Markup \label{module-markup}}
Fred Drakeacffaee1999-03-16 16:09:13 +00001059
1060 The markup described in this section is used to provide information
1061 about a module being documented. A typical use of this markup
1062 appears at the top of the section used to document a module. A
1063 typical example might look like this:
1064
1065\begin{verbatim}
1066\section{\module{spam} ---
1067 Access to the SPAM facility}
1068
1069\declaremodule{extension}{spam}
Fred Drake2c4e0091999-03-29 14:55:55 +00001070 \platform{Unix}
Fred Drake9120df32001-07-14 02:34:12 +00001071\modulesynopsis{Access to the SPAM facility of \UNIX.}
Fred Drake2c4e0091999-03-29 14:55:55 +00001072\moduleauthor{Jane Doe}{jane.doe@frobnitz.org}
Fred Drakeacffaee1999-03-16 16:09:13 +00001073\end{verbatim}
1074
Fred Drake7932ed02000-08-11 17:37:33 +00001075 Python packages\index{packages} --- collections of modules that can
1076 be described as a unit --- are documented using the same markup as
1077 modules. The name for a module in a package should be typed in
Fred Drake432cef02001-07-06 22:34:33 +00001078 ``fully qualified'' form (it should include the package name).
Fred Drake7932ed02000-08-11 17:37:33 +00001079 For example, a module ``foo'' in package ``bar'' should be marked as
Fred Drake203d91a2001-09-26 18:43:20 +00001080 \code{\e module\{bar.foo\}}, and the beginning of the reference
Fred Drake7932ed02000-08-11 17:37:33 +00001081 section would appear as:
1082
1083\begin{verbatim}
1084\section{\module{bar.foo} ---
1085 Module from the \module{bar} package}
1086
1087\declaremodule{extension}{bar.foo}
1088\modulesynopsis{Nifty module from the \module{bar} package.}
1089\moduleauthor{Jane Doe}{jane.doe@frobnitz.org}
1090\end{verbatim}
1091
1092 Note that the name of a package is also marked using
1093 \macro{module}.
1094
Fred Drakeadade921999-04-22 13:05:27 +00001095 \begin{macrodesc}{declaremodule}{\op{key}\p{type}\p{name}}
Fred Drake87f768e1999-05-17 15:22:45 +00001096 Requires two parameters: module type (\samp{standard},
1097 \samp{builtin}, \samp{extension}, or \samp{}), and the module
1098 name. An optional parameter should be given as the basis for the
1099 module's ``key'' used for linking to or referencing the section.
1100 The ``key'' should only be given if the module's name contains any
1101 underscores, and should be the name with the underscores stripped.
1102 Note that the \var{type} parameter must be one of the values
1103 listed above or an error will be printed. For modules which are
1104 contained in packages, the fully-qualified name should be given as
1105 \var{name} parameter. This should be the first thing after the
1106 \macro{section} used to introduce the module.
Fred Drakeacffaee1999-03-16 16:09:13 +00001107 \end{macrodesc}
1108
Fred Drakeadade921999-04-22 13:05:27 +00001109 \begin{macrodesc}{platform}{\p{specifier}}
Fred Drakeacffaee1999-03-16 16:09:13 +00001110 Specifies the portability of the module. \var{specifier} is a
1111 comma-separated list of keys that specify what platforms the
1112 module is available on. The keys are short identifiers;
1113 examples that are in use include \samp{IRIX}, \samp{Mac},
1114 \samp{Windows}, and \samp{Unix}. It is important to use a key
Fred Drake7a737df1999-04-23 14:41:44 +00001115 which has already been used when applicable. This is used to
1116 provide annotations in the Module Index and the HTML and GNU info
1117 output.
Fred Drakeacffaee1999-03-16 16:09:13 +00001118 \end{macrodesc}
1119
Fred Drakeadade921999-04-22 13:05:27 +00001120 \begin{macrodesc}{modulesynopsis}{\p{text}}
Fred Drakeacffaee1999-03-16 16:09:13 +00001121 The \var{text} is a short, ``one line'' description of the
1122 module that can be used as part of the chapter introduction.
Fred Drakeadade921999-04-22 13:05:27 +00001123 This is must be placed after \macro{declaremodule}.
Fred Drakeacffaee1999-03-16 16:09:13 +00001124 The synopsis is used in building the contents of the table
1125 inserted as the \macro{localmoduletable}. No text is
1126 produced at the point of the markup.
1127 \end{macrodesc}
1128
Fred Drakeadade921999-04-22 13:05:27 +00001129 \begin{macrodesc}{moduleauthor}{\p{name}\p{email}}
Fred Drakeacffaee1999-03-16 16:09:13 +00001130 This macro is used to encode information about who authored a
1131 module. This is currently not used to generate output, but can be
1132 used to help determine the origin of the module.
1133 \end{macrodesc}
1134
1135
Fred Drakef1b3de82001-07-24 14:38:34 +00001136 \subsection{Library-level Markup \label{library-markup}}
Fred Drakeacffaee1999-03-16 16:09:13 +00001137
1138 This markup is used when describing a selection of modules. For
Fred Drake698d5201999-11-10 15:54:57 +00001139 example, the \citetitle[../mac/mac.html]{Macintosh Library
1140 Modules} document uses this to help provide an overview of the
1141 modules in the collection, and many chapters in the
1142 \citetitle[../lib/lib.html]{Python Library Reference} use it for
Fred Drakeacffaee1999-03-16 16:09:13 +00001143 the same purpose.
1144
1145 \begin{macrodesc}{localmoduletable}{}
Fred Drake2c4e0091999-03-29 14:55:55 +00001146 If a \file{.syn} file exists for the current
Fred Drakeacffaee1999-03-16 16:09:13 +00001147 chapter (or for the entire document in \code{howto} documents), a
1148 \env{synopsistable} is created with the contents loaded from the
1149 \file{.syn} file.
1150 \end{macrodesc}
1151
1152
Fred Drakef1b3de82001-07-24 14:38:34 +00001153 \subsection{Table Markup \label{table-markup}}
Fred Drakeacffaee1999-03-16 16:09:13 +00001154
1155 There are three general-purpose table environments defined which
1156 should be used whenever possible. These environments are defined
1157 to provide tables of specific widths and some convenience for
1158 formatting. These environments are not meant to be general
1159 replacements for the standard \LaTeX{} table environments, but can
1160 be used for an advantage when the documents are processed using
1161 the tools for Python documentation processing. In particular, the
1162 generated HTML looks good! There is also an advantage for the
Fred Drake67f193f2001-07-09 16:04:03 +00001163 eventual conversion of the documentation to XML (see section
Fred Drake2c4e0091999-03-29 14:55:55 +00001164 \ref{futures}, ``Future Directions'').
Fred Drakeacffaee1999-03-16 16:09:13 +00001165
1166 Each environment is named \env{table\var{cols}}, where \var{cols}
1167 is the number of columns in the table specified in lower-case
1168 Roman numerals. Within each of these environments, an additional
1169 macro, \macro{line\var{cols}}, is defined, where \var{cols}
1170 matches the \var{cols} value of the corresponding table
Fred Drake2c4e0091999-03-29 14:55:55 +00001171 environment. These are supported for \var{cols} values of
1172 \code{ii}, \code{iii}, and \code{iv}. These environments are all
Fred Drakeda72b932000-09-21 15:58:02 +00001173 built on top of the \env{tabular} environment. Variants based on
1174 the \env{longtable} environment are also provided.
Fred Drakeacffaee1999-03-16 16:09:13 +00001175
Fred Drake2b853412000-04-11 19:08:30 +00001176 Note that all tables in the standard Python documentation use
1177 vertical lines between columns, and this must be specified in the
1178 markup for each table. A general border around the outside of the
1179 table is not used, but would be the responsibility of the
Fred Drakeda72b932000-09-21 15:58:02 +00001180 processor; the document markup should not include an exterior
1181 border.
1182
1183 The \env{longtable}-based variants of the table environments are
1184 formatted with extra space before and after, so should only be
1185 used on tables which are long enough that splitting over multiple
1186 pages is reasonable; tables with fewer than twenty rows should
1187 never by marked using the long flavors of the table environments.
1188 The header row is repeated across the top of each part of the
1189 table.
Fred Drake2b853412000-04-11 19:08:30 +00001190
Fred Drakeadade921999-04-22 13:05:27 +00001191 \begin{envdesc}{tableii}{\p{colspec}\p{col1font}\p{heading1}\p{heading2}}
Fred Drakeacffaee1999-03-16 16:09:13 +00001192 Create a two-column table using the \LaTeX{} column specifier
1193 \var{colspec}. The column specifier should indicate vertical
1194 bars between columns as appropriate for the specific table, but
1195 should not specify vertical bars on the outside of the table
1196 (that is considered a stylesheet issue). The \var{col1font}
1197 parameter is used as a stylistic treatment of the first column
1198 of the table: the first column is presented as
1199 \code{\e\var{col1font}\{column1\}}. To avoid treating the first
Fred Drakeadade921999-04-22 13:05:27 +00001200 column specially, \var{col1font} may be \samp{textrm}. The
Fred Drakeacffaee1999-03-16 16:09:13 +00001201 column headings are taken from the values \var{heading1} and
1202 \var{heading2}.
1203 \end{envdesc}
1204
Fred Drakeda72b932000-09-21 15:58:02 +00001205 \begin{envdesc}{longtableii}{\unspecified}
1206 Like \env{tableii}, but produces a table which may be broken
1207 across page boundaries. The parameters are the same as for
1208 \env{tableii}.
1209 \end{envdesc}
1210
Fred Drakeadade921999-04-22 13:05:27 +00001211 \begin{macrodesc}{lineii}{\p{column1}\p{column2}}
Fred Drakeda72b932000-09-21 15:58:02 +00001212 Create a single table row within a \env{tableii} or
1213 \env{longtableii} environment.
Fred Drakeacffaee1999-03-16 16:09:13 +00001214 The text for the first column will be generated by applying the
1215 macro named by the \var{col1font} value when the \env{tableii}
1216 was opened.
1217 \end{macrodesc}
1218
Fred Drakeadade921999-04-22 13:05:27 +00001219 \begin{envdesc}{tableiii}{\p{colspec}\p{col1font}\p{heading1}\p{heading2}\p{heading3}}
Fred Drakeacffaee1999-03-16 16:09:13 +00001220 Like the \env{tableii} environment, but with a third column.
1221 The heading for the third column is given by \var{heading3}.
1222 \end{envdesc}
1223
Fred Drakeda72b932000-09-21 15:58:02 +00001224 \begin{envdesc}{longtableiii}{\unspecified}
1225 Like \env{tableiii}, but produces a table which may be broken
1226 across page boundaries. The parameters are the same as for
1227 \env{tableiii}.
1228 \end{envdesc}
1229
Fred Drakeadade921999-04-22 13:05:27 +00001230 \begin{macrodesc}{lineiii}{\p{column1}\p{column2}\p{column3}}
Fred Drakeacffaee1999-03-16 16:09:13 +00001231 Like the \macro{lineii} macro, but with a third column. The
1232 text for the third column is given by \var{column3}.
1233 \end{macrodesc}
1234
Fred Drakeadade921999-04-22 13:05:27 +00001235 \begin{envdesc}{tableiv}{\p{colspec}\p{col1font}\p{heading1}\p{heading2}\p{heading3}\p{heading4}}
Fred Drakeacffaee1999-03-16 16:09:13 +00001236 Like the \env{tableiii} environment, but with a fourth column.
1237 The heading for the fourth column is given by \var{heading4}.
1238 \end{envdesc}
1239
Fred Drakeda72b932000-09-21 15:58:02 +00001240 \begin{envdesc}{longtableiv}{\unspecified}
1241 Like \env{tableiv}, but produces a table which may be broken
1242 across page boundaries. The parameters are the same as for
1243 \env{tableiv}.
1244 \end{envdesc}
1245
Fred Drakeadade921999-04-22 13:05:27 +00001246 \begin{macrodesc}{lineiv}{\p{column1}\p{column2}\p{column3}\p{column4}}
Fred Drakeacffaee1999-03-16 16:09:13 +00001247 Like the \macro{lineiii} macro, but with a fourth column. The
1248 text for the fourth column is given by \var{column4}.
1249 \end{macrodesc}
1250
Fred Drakef269e592001-07-17 23:05:57 +00001251 \begin{envdesc}{tablev}{\p{colspec}\p{col1font}\p{heading1}\p{heading2}\p{heading3}\p{heading4}\p{heading5}}
1252 Like the \env{tableiv} environment, but with a fifth column.
1253 The heading for the fifth column is given by \var{heading5}.
1254 \end{envdesc}
1255
1256 \begin{envdesc}{longtablev}{\unspecified}
1257 Like \env{tablev}, but produces a table which may be broken
1258 across page boundaries. The parameters are the same as for
1259 \env{tablev}.
1260 \end{envdesc}
1261
1262 \begin{macrodesc}{linev}{\p{column1}\p{column2}\p{column3}\p{column4}\p{column5}}
1263 Like the \macro{lineiv} macro, but with a fifth column. The
1264 text for the fifth column is given by \var{column5}.
1265 \end{macrodesc}
1266
Fred Drakeacffaee1999-03-16 16:09:13 +00001267
1268 An additional table-like environment is \env{synopsistable}. The
1269 table generated by this environment contains two columns, and each
1270 row is defined by an alternate definition of
Fred Drakee15956b2000-04-03 04:51:13 +00001271 \macro{modulesynopsis}. This environment is not normally used by
1272 authors, but is created by the \macro{localmoduletable} macro.
Fred Drakeacffaee1999-03-16 16:09:13 +00001273
Fred Drake0cac5f62001-08-14 21:36:19 +00001274 Here is a small example of a table given in the documentation for
1275 the \module{warnings} module; markup inside the table cells is
1276 minimal so the markup for the table itself is readily discernable.
1277 Here is the markup for the table:
1278
1279\begin{verbatim}
1280\begin{tableii}{l|l}{exception}{Class}{Description}
1281 \lineii{Warning}
1282 {This is the base class of all warning category classes. It
1283 is a subclass of \exception{Exception}.}
1284 \lineii{UserWarning}
1285 {The default category for \function{warn()}.}
1286 \lineii{DeprecationWarning}
1287 {Base category for warnings about deprecated features.}
1288 \lineii{SyntaxWarning}
1289 {Base category for warnings about dubious syntactic
1290 features.}
1291 \lineii{RuntimeWarning}
1292 {Base category for warnings about dubious runtime features.}
1293\end{tableii}
1294\end{verbatim}
1295
1296 Here is the resulting table:
1297
1298\begin{tableii}{l|l}{exception}{Class}{Description}
1299 \lineii{Warning}
1300 {This is the base class of all warning category classes. It
1301 is a subclass of \exception{Exception}.}
1302 \lineii{UserWarning}
1303 {The default category for \function{warn()}.}
1304 \lineii{DeprecationWarning}
1305 {Base category for warnings about deprecated features.}
1306 \lineii{SyntaxWarning}
1307 {Base category for warnings about dubious syntactic
1308 features.}
1309 \lineii{RuntimeWarning}
1310 {Base category for warnings about dubious runtime features.}
1311\end{tableii}
1312
1313 Note that the class names are implicitly marked using the
1314 \macro{exception} macro, since that is given as the \var{col1font}
1315 value for the \env{tableii} environment. To create a table using
1316 different markup for the first column, use \code{textrm} for the
1317 \var{col1font} value and mark each entry individually.
1318
1319 To add a horizontal line between vertical sections of a table, use
1320 the standard \macro{hline} macro between the rows which should be
1321 separated:
1322
1323\begin{verbatim}
1324\begin{tableii}{l|l}{constant}{Language}{Audience}
1325 \lineii{APL}{Masochists.}
1326 \lineii{BASIC}{First-time programmers on PC hardware.}
1327 \lineii{C}{\UNIX{} \&\ Linux kernel developers.}
1328 \hline
1329 \lineii{Python}{Everyone!}
1330\end{tableii}
1331\end{verbatim}
1332
1333 Note that not all presentation formats are capable of displaying a
1334 horizontal rule in this position. This is how the table looks in
1335 the format you're reading now:
1336
1337\begin{tableii}{l|l}{constant}{Language}{Audience}
1338 \lineii{APL}{Masochists.}
1339 \lineii{C}{\UNIX{} \&\ Linux kernel developers.}
1340 \lineii{JavaScript}{Web developers.}
1341 \hline
1342 \lineii{Python}{Everyone!}
1343\end{tableii}
1344
Fred Drakeacffaee1999-03-16 16:09:13 +00001345
1346 \subsection{Reference List Markup \label{references}}
1347
1348 Many sections include a list of references to module documentation
1349 or external documents. These lists are created using the
Fred Drake5ed35fd2001-11-30 18:09:54 +00001350 \env{seealso} or \env{seealso*} environments. These environments
1351 define some additional macros to support creating reference
1352 entries in a reasonable manner.
Fred Drakeacffaee1999-03-16 16:09:13 +00001353
Fred Drake5802e482000-07-06 05:24:41 +00001354 The \env{seealso} environment is typically placed in a section
1355 just before any sub-sections. This is done to ensure that
1356 reference links related to the section are not hidden in a
Fred Drake5ed35fd2001-11-30 18:09:54 +00001357 subsection in the hypertext renditions of the documentation. For
1358 the HTML output, it is shown as a ``side bar,'' boxed off from the
1359 main flow of the text. The \env{seealso*} environment is
1360 different in that it should be used when a list of references is
1361 being presented as part of the primary content; it is not
1362 specially set off from the text.
Fred Drake5802e482000-07-06 05:24:41 +00001363
Fred Drakeacffaee1999-03-16 16:09:13 +00001364 \begin{envdesc}{seealso}{}
1365 This environment creates a ``See also:'' heading and defines the
1366 markup used to describe individual references.
1367 \end{envdesc}
1368
Fred Drake5ed35fd2001-11-30 18:09:54 +00001369 \begin{envdesc}{seealso*}{}
1370 This environment is used to create a list of references which
1371 form part of the main content. It is not given a special
1372 header and is not set off from the main flow of the text. It
1373 provides the same additional markup used to describe individual
1374 references.
1375 \end{envdesc}
1376
Fred Drake48449982000-09-12 17:52:33 +00001377 For each of the following macros, \var{why} should be one or more
1378 complete sentences, starting with a capital letter (unless it
1379 starts with an identifier, which should not be modified), and
1380 ending with the apropriate punctuation.
Fred Drake5802e482000-07-06 05:24:41 +00001381
Fred Drakeb7cf3782000-09-12 19:58:10 +00001382 These macros are only defined within the content of the
Fred Drake5ed35fd2001-11-30 18:09:54 +00001383 \env{seealso} and \env{seealso*} environments.
Fred Drakeb7cf3782000-09-12 19:58:10 +00001384
Fred Drakeadade921999-04-22 13:05:27 +00001385 \begin{macrodesc}{seemodule}{\op{key}\p{name}\p{why}}
Fred Drakeacffaee1999-03-16 16:09:13 +00001386 Refer to another module. \var{why} should be a brief
1387 explanation of why the reference may be interesting. The module
1388 name is given in \var{name}, with the link key given in
1389 \var{key} if necessary. In the HTML and PDF conversions, the
1390 module name will be a hyperlink to the referred-to module.
Fred Drake64a5aaf2001-10-20 04:18:14 +00001391 \note{The module must be documented in the same
1392 document (the corresponding \macro{declaremodule} is required).}
Fred Drakeacffaee1999-03-16 16:09:13 +00001393 \end{macrodesc}
1394
Fred Drake08c5d0c2000-09-11 05:22:30 +00001395 \begin{macrodesc}{seepep}{\p{number}\p{title}\p{why}}
1396 Refer to an Python Enhancement Proposal (PEP). \var{number}
1397 should be the official number assigned by the PEP Editor,
1398 \var{title} should be the human-readable title of the PEP as
Fred Drake5802e482000-07-06 05:24:41 +00001399 found in the official copy of the document, and \var{why} should
Fred Drake08c5d0c2000-09-11 05:22:30 +00001400 explain what's interesting about the PEP. This should be used
1401 to refer the reader to PEPs which specify interfaces or language
1402 features relevant to the material in the annotated section of the
1403 documentation.
1404 \end{macrodesc}
1405
1406 \begin{macrodesc}{seerfc}{\p{number}\p{title}\p{why}}
1407 Refer to an IETF Request for Comments (RFC). Otherwise very
1408 similar to \macro{seepep}. This should be used
1409 to refer the reader to PEPs which specify protocols or data
Fred Drake5802e482000-07-06 05:24:41 +00001410 formats relevant to the material in the annotated section of the
1411 documentation.
1412 \end{macrodesc}
1413
Fred Drakeadade921999-04-22 13:05:27 +00001414 \begin{macrodesc}{seetext}{\p{text}}
Fred Drakeacffaee1999-03-16 16:09:13 +00001415 Add arbitrary text \var{text} to the ``See also:'' list. This
1416 can be used to refer to off-line materials or on-line materials
Fred Drake5802e482000-07-06 05:24:41 +00001417 using the \macro{url} macro. This should consist of one or more
1418 complete sentences.
1419 \end{macrodesc}
1420
Fred Drake48449982000-09-12 17:52:33 +00001421 \begin{macrodesc}{seetitle}{\op{url}\p{title}\p{why}}
1422 Add a reference to an external document named \var{title}. If
1423 \var{url} is given, the title is made a hyperlink in the HTML
1424 version of the documentation, and displayed below the title in
1425 the typeset versions of the documentation.
1426 \end{macrodesc}
1427
Fred Drake5802e482000-07-06 05:24:41 +00001428 \begin{macrodesc}{seeurl}{\p{url}\p{why}}
1429 References to specific on-line resources should be given using
Fred Drake5ed35fd2001-11-30 18:09:54 +00001430 the \macro{seeurl} macro if they don't have a meaningful title.
1431 Online documents which have identifiable titles should be
1432 referenced using the \macro{seetitle} macro, using the optional
1433 parameter to that macro to provide the URL.
Fred Drakeacffaee1999-03-16 16:09:13 +00001434 \end{macrodesc}
1435
1436
1437 \subsection{Index-generating Markup \label{indexing}}
1438
1439 Effective index generation for technical documents can be very
Fred Drakee15956b2000-04-03 04:51:13 +00001440 difficult, especially for someone familiar with the topic but not
Fred Drakeacffaee1999-03-16 16:09:13 +00001441 the creation of indexes. Much of the difficulty arises in the
1442 area of terminology: including the terms an expert would use for a
1443 concept is not sufficient. Coming up with the terms that a novice
Fred Drake2c4e0091999-03-29 14:55:55 +00001444 would look up is fairly difficult for an author who, typically, is
Fred Drakeacffaee1999-03-16 16:09:13 +00001445 an expert in the area she is writing on.
1446
Fred Drake2c4e0091999-03-29 14:55:55 +00001447 The truly difficult aspects of index generation are not areas with
1448 which the documentation tools can help. However, ease
Fred Drakee15956b2000-04-03 04:51:13 +00001449 of producing the index once content decisions are made is within
Fred Drakeacffaee1999-03-16 16:09:13 +00001450 the scope of the tools. Markup is provided which the processing
1451 software is able to use to generate a variety of kinds of index
1452 entry with minimal effort. Additionally, many of the environments
Fred Drake7a737df1999-04-23 14:41:44 +00001453 described in section \ref{info-units}, ``Information Units,'' will
Fred Drakeacffaee1999-03-16 16:09:13 +00001454 generate appropriate entries into the general and module indexes.
1455
1456 The following macro can be used to control the generation of index
Fred Drakeadade921999-04-22 13:05:27 +00001457 data, and should be used in the document preamble:
Fred Drakeacffaee1999-03-16 16:09:13 +00001458
1459 \begin{macrodesc}{makemodindex}{}
Fred Drakeadade921999-04-22 13:05:27 +00001460 This should be used in the document preamble if a ``Module
Fred Drakeacffaee1999-03-16 16:09:13 +00001461 Index'' is desired for a document containing reference material
1462 on many modules. This causes a data file
Fred Draked1fb7791999-05-17 16:33:54 +00001463 \code{lib\var{jobname}.idx} to be created from the
Fred Drakeacffaee1999-03-16 16:09:13 +00001464 \macro{declaremodule} macros. This file can be processed by the
1465 \program{makeindex} program to generate a file which can be
1466 \macro{input} into the document at the desired location of the
1467 module index.
1468 \end{macrodesc}
1469
1470 There are a number of macros that are useful for adding index
1471 entries for particular concepts, many of which are specific to
1472 programming languages or even Python.
1473
Fred Drakeadade921999-04-22 13:05:27 +00001474 \begin{macrodesc}{bifuncindex}{\p{name}}
Fred Drakeec8b9051999-04-23 20:01:17 +00001475 Add an index entry referring to a built-in function named
1476 \var{name}; parentheses should not be included after
Fred Drake2c4e0091999-03-29 14:55:55 +00001477 \var{name}.
Fred Drakeacffaee1999-03-16 16:09:13 +00001478 \end{macrodesc}
1479
Fred Drakeadade921999-04-22 13:05:27 +00001480 \begin{macrodesc}{exindex}{\p{exception}}
Fred Drake2c4e0091999-03-29 14:55:55 +00001481 Add a reference to an exception named \var{exception}. The
1482 exception may be either string- or class-based.
Fred Drakeacffaee1999-03-16 16:09:13 +00001483 \end{macrodesc}
1484
Fred Drakeadade921999-04-22 13:05:27 +00001485 \begin{macrodesc}{kwindex}{\p{keyword}}
Fred Drake2c4e0091999-03-29 14:55:55 +00001486 Add a reference to a language keyword (not a keyword parameter
1487 in a function or method call).
Fred Drakeacffaee1999-03-16 16:09:13 +00001488 \end{macrodesc}
1489
Fred Drakeadade921999-04-22 13:05:27 +00001490 \begin{macrodesc}{obindex}{\p{object type}}
Fred Drake2c4e0091999-03-29 14:55:55 +00001491 Add an index entry for a built-in object type.
Fred Drakeacffaee1999-03-16 16:09:13 +00001492 \end{macrodesc}
1493
Fred Drakeadade921999-04-22 13:05:27 +00001494 \begin{macrodesc}{opindex}{\p{operator}}
Fred Drake2c4e0091999-03-29 14:55:55 +00001495 Add a reference to an operator, such as \samp{+}.
Fred Drakeacffaee1999-03-16 16:09:13 +00001496 \end{macrodesc}
1497
Fred Drakeadade921999-04-22 13:05:27 +00001498 \begin{macrodesc}{refmodindex}{\op{key}\p{module}}
Fred Drakeacffaee1999-03-16 16:09:13 +00001499 Add an index entry for module \var{module}; if \var{module}
1500 contains an underscore, the optional parameter \var{key} should
1501 be provided as the same string with underscores removed. An
1502 index entry ``\var{module} (module)'' will be generated. This
1503 is intended for use with non-standard modules implemented in
1504 Python.
1505 \end{macrodesc}
1506
Fred Drakeadade921999-04-22 13:05:27 +00001507 \begin{macrodesc}{refexmodindex}{\op{key}\p{module}}
Fred Drakeacffaee1999-03-16 16:09:13 +00001508 As for \macro{refmodindex}, but the index entry will be
1509 ``\var{module} (extension module).'' This is intended for use
1510 with non-standard modules not implemented in Python.
1511 \end{macrodesc}
1512
Fred Drakeadade921999-04-22 13:05:27 +00001513 \begin{macrodesc}{refbimodindex}{\op{key}\p{module}}
Fred Drakeacffaee1999-03-16 16:09:13 +00001514 As for \macro{refmodindex}, but the index entry will be
1515 ``\var{module} (built-in module).'' This is intended for use
1516 with standard modules not implemented in Python.
1517 \end{macrodesc}
1518
Fred Drakeadade921999-04-22 13:05:27 +00001519 \begin{macrodesc}{refstmodindex}{\op{key}\p{module}}
Fred Drakeacffaee1999-03-16 16:09:13 +00001520 As for \macro{refmodindex}, but the index entry will be
1521 ``\var{module} (standard module).'' This is intended for use
1522 with standard modules implemented in Python.
1523 \end{macrodesc}
1524
Fred Drakeadade921999-04-22 13:05:27 +00001525 \begin{macrodesc}{stindex}{\p{statement}}
Fred Drake2c4e0091999-03-29 14:55:55 +00001526 Add an index entry for a statement type, such as \keyword{print}
Fred Drakeadade921999-04-22 13:05:27 +00001527 or \keyword{try}/\keyword{finally}.
1528
1529 XXX Need better examples of difference from \macro{kwindex}.
Fred Drakeacffaee1999-03-16 16:09:13 +00001530 \end{macrodesc}
1531
1532
1533 Additional macros are provided which are useful for conveniently
1534 creating general index entries which should appear at many places
1535 in the index by rotating a list of words. These are simple macros
1536 that simply use \macro{index} to build some number of index
1537 entries. Index entries build using these macros contain both
1538 primary and secondary text.
1539
Fred Drakeadade921999-04-22 13:05:27 +00001540 \begin{macrodesc}{indexii}{\p{word1}\p{word2}}
Fred Drakeacffaee1999-03-16 16:09:13 +00001541 Build two index entries. This is exactly equivalent to using
1542 \code{\e index\{\var{word1}!\var{word2}\}} and
1543 \code{\e index\{\var{word2}!\var{word1}\}}.
1544 \end{macrodesc}
1545
Fred Drakeadade921999-04-22 13:05:27 +00001546 \begin{macrodesc}{indexiii}{\p{word1}\p{word2}\p{word3}}
Fred Drakeacffaee1999-03-16 16:09:13 +00001547 Build three index entries. This is exactly equivalent to using
1548 \code{\e index\{\var{word1}!\var{word2} \var{word3}\}},
1549 \code{\e index\{\var{word2}!\var{word3}, \var{word1}\}}, and
1550 \code{\e index\{\var{word3}!\var{word1} \var{word2}\}}.
1551 \end{macrodesc}
1552
Fred Drakeadade921999-04-22 13:05:27 +00001553 \begin{macrodesc}{indexiv}{\p{word1}\p{word2}\p{word3}\p{word4}}
Fred Drakeacffaee1999-03-16 16:09:13 +00001554 Build four index entries. This is exactly equivalent to using
1555 \code{\e index\{\var{word1}!\var{word2} \var{word3} \var{word4}\}},
1556 \code{\e index\{\var{word2}!\var{word3} \var{word4}, \var{word1}\}},
1557 \code{\e index\{\var{word3}!\var{word4}, \var{word1} \var{word2}\}},
1558 and
1559 \code{\e index\{\var{word4}!\var{word1} \var{word2} \var{word3}\}}.
1560 \end{macrodesc}
1561
Fred Drake432cef02001-07-06 22:34:33 +00001562 \subsection{Grammar Production Displays \label{grammar-displays}}
Fred Drakeacffaee1999-03-16 16:09:13 +00001563
Fred Drake432cef02001-07-06 22:34:33 +00001564 Special markup is available for displaying the productions of a
1565 formal grammar. The markup is simple and does not attempt to
1566 model all aspects of BNF (or any derived forms), but provides
1567 enough to allow context-free grammars to be displayed in a way
1568 that causes uses of a symbol to be rendered as hyperlinks to the
1569 definition of the symbol. There is one environment and a pair of
1570 macros:
Fred Drakeacffaee1999-03-16 16:09:13 +00001571
Fred Drake432cef02001-07-06 22:34:33 +00001572 \begin{envdesc}{productionlist}{\op{language}}
1573 This environment is used to enclose a group of productions. The
1574 two macros are only defined within this environment. If a
1575 document descibes more than one language, the optional parameter
1576 \var{language} should be used to distinguish productions between
1577 languages. The value of the parameter should be a short name
1578 that can be used as part of a filename; colons or other
1579 characters that can't be used in filename across platforms
1580 should be included.
1581 \end{envdesc}
Fred Drakeacffaee1999-03-16 16:09:13 +00001582
Fred Drake432cef02001-07-06 22:34:33 +00001583 \begin{macrodesc}{production}{\p{name}\p{definition}}
1584 A production rule in the grammar. The rule defines the symbol
1585 \var{name} to be \var{definition}. \var{name} should not
1586 contain any markup, and the use of hyphens in a document which
1587 supports more than one grammar is undefined. \var{definition}
1588 may contain \macro{token} macros and any additional content
1589 needed to describe the grammatical model of \var{symbol}. Only
1590 one \macro{production} may be used to define a symbol ---
1591 multiple definitions are not allowed.
1592 \end{macrodesc}
Fred Drakeacffaee1999-03-16 16:09:13 +00001593
Fred Drake432cef02001-07-06 22:34:33 +00001594 \begin{macrodesc}{token}{\p{name}}
1595 The name of a symbol defined by a \macro{production} macro, used
1596 in the \var{definition} of a symbol. Where possible, this will
1597 be rendered as a hyperlink to the definition of the symbol
1598 \var{name}.
1599 \end{macrodesc}
Fred Drake42934682000-04-03 15:00:28 +00001600
Fred Drake432cef02001-07-06 22:34:33 +00001601 Note that the entire grammar does not need to be defined in a
1602 single \env{productionlist} environment; any number of
1603 groupings may be used to describe the grammar. Every use of the
1604 \macro{token} must correspond to a \macro{production}.
1605
1606 The following is an example taken from the
1607 \citetitle[../ref/identifiers.html]{Python Reference Manual}:
1608
1609\begin{verbatim}
1610\begin{productionlist}
1611 \production{identifier}
1612 {(\token{letter}|"_") (\token{letter} | \token{digit} | "_")*}
1613 \production{letter}
1614 {\token{lowercase} | \token{uppercase}}
1615 \production{lowercase}
1616 {"a"..."z"}
1617 \production{uppercase}
1618 {"A"..."Z"}
1619 \production{digit}
1620 {"0"..."9"}
1621\end{productionlist}
1622\end{verbatim}
1623
1624
Fred Drakef1b3de82001-07-24 14:38:34 +00001625\section{Graphical Interface Components \label{gui-markup}}
Fred Drake432cef02001-07-06 22:34:33 +00001626
1627 The components of graphical interfaces will be assigned markup, but
1628 the specifics have not been determined.
Fred Drakeacffaee1999-03-16 16:09:13 +00001629
1630
Fred Drakef1b3de82001-07-24 14:38:34 +00001631\section{Processing Tools \label{tools}}
Fred Drakeacffaee1999-03-16 16:09:13 +00001632
Fred Drakef1b3de82001-07-24 14:38:34 +00001633 \subsection{External Tools \label{tools-external}}
Fred Drakeacffaee1999-03-16 16:09:13 +00001634
1635 Many tools are needed to be able to process the Python
1636 documentation if all supported formats are required. This
Fred Drakeadade921999-04-22 13:05:27 +00001637 section lists the tools used and when each is required. Consult
1638 the \file{Doc/README} file to see if there are specific version
1639 requirements for any of these.
Fred Drakeacffaee1999-03-16 16:09:13 +00001640
1641 \begin{description}
1642 \item[\program{dvips}]
1643 This program is a typical part of \TeX{} installations. It is
1644 used to generate PostScript from the ``device independent''
Fred Drake2c4e0091999-03-29 14:55:55 +00001645 \file{.dvi} files. It is needed for the conversion to
Fred Drakeacffaee1999-03-16 16:09:13 +00001646 PostScript.
1647
1648 \item[\program{emacs}]
1649 Emacs is the kitchen sink of programmers' editors, and a damn
1650 fine kitchen sink it is. It also comes with some of the
1651 processing needed to support the proper menu structures for
1652 Texinfo documents when an info conversion is desired. This is
Fred Drake2c4e0091999-03-29 14:55:55 +00001653 needed for the info conversion. Using \program{xemacs}
Fred Drakeacffaee1999-03-16 16:09:13 +00001654 instead of FSF \program{emacs} may lead to instability in the
1655 conversion, but that's because nobody seems to maintain the
1656 Emacs Texinfo code in a portable manner.
1657
1658 \item[\program{latex}]
Fred Drakeb5f17f22001-08-28 18:09:11 +00001659 \LaTeX{} is a large and extensible macro package by Leslie
1660 Lamport, based on \TeX, a world-class typesetter by Donald
1661 Knuth. It is used for the conversion to PostScript, and is
1662 needed for the HTML conversion as well (\LaTeX2HTML requires
1663 one of the intermediate files it creates).
Fred Drakeacffaee1999-03-16 16:09:13 +00001664
1665 \item[\program{latex2html}]
1666 Probably the longest Perl script anyone ever attempted to
1667 maintain. This converts \LaTeX{} documents to HTML documents,
1668 and does a pretty reasonable job. It is required for the
1669 conversions to HTML and GNU info.
1670
1671 \item[\program{lynx}]
1672 This is a text-mode Web browser which includes an
1673 HTML-to-plain text conversion. This is used to convert
1674 \code{howto} documents to text.
1675
1676 \item[\program{make}]
1677 Just about any version should work for the standard documents,
1678 but GNU \program{make} is required for the experimental
1679 processes in \file{Doc/tools/sgmlconv/}, at least while
Fred Drakeb5f17f22001-08-28 18:09:11 +00001680 they're experimental. This is not required for running the
Fred Drakef9dc0432001-08-29 02:34:10 +00001681 \program{mkhowto} script.
Fred Drakeacffaee1999-03-16 16:09:13 +00001682
1683 \item[\program{makeindex}]
1684 This is a standard program for converting \LaTeX{} index data
1685 to a formatted index; it should be included with all \LaTeX{}
1686 installations. It is needed for the PDF and PostScript
1687 conversions.
1688
1689 \item[\program{makeinfo}]
1690 GNU \program{makeinfo} is used to convert Texinfo documents to
1691 GNU info files. Since Texinfo is used as an intermediate
1692 format in the info conversion, this program is needed in that
1693 conversion.
1694
1695 \item[\program{pdflatex}]
1696 pdf\TeX{} is a relatively new variant of \TeX, and is used to
1697 generate the PDF version of the manuals. It is typically
1698 installed as part of most of the large \TeX{} distributions.
Fred Drake7a737df1999-04-23 14:41:44 +00001699 \program{pdflatex} is pdf\TeX{} using the \LaTeX{} format.
Fred Drakeacffaee1999-03-16 16:09:13 +00001700
1701 \item[\program{perl}]
1702 Perl is required for \LaTeX2HTML{} and one of the scripts used
1703 to post-process \LaTeX2HTML output, as well as the
Fred Drake2c4e0091999-03-29 14:55:55 +00001704 HTML-to-Texinfo conversion. This is required for
Fred Drakeacffaee1999-03-16 16:09:13 +00001705 the HTML and GNU info conversions.
1706
1707 \item[\program{python}]
1708 Python is used for many of the scripts in the
1709 \file{Doc/tools/} directory; it is required for all
1710 conversions. This shouldn't be a problem if you're interested
1711 in writing documentation for Python!
1712 \end{description}
1713
1714
Fred Drakef1b3de82001-07-24 14:38:34 +00001715 \subsection{Internal Tools \label{tools-internal}}
Fred Drakeacffaee1999-03-16 16:09:13 +00001716
1717 This section describes the various scripts that are used to
1718 implement various stages of document processing or to orchestrate
Fred Drake2c4e0091999-03-29 14:55:55 +00001719 entire build sequences. Most of these tools are only useful
Fred Drakeacffaee1999-03-16 16:09:13 +00001720 in the context of building the standard documentation, but some
1721 are more general.
1722
1723 \begin{description}
1724 \item[\program{mkhowto}]
Fred Drake87f768e1999-05-17 15:22:45 +00001725 This is the primary script used to format third-party
1726 documents. It contains all the logic needed to ``get it
1727 right.'' The proper way to use this script is to make a
1728 symbolic link to it or run it in place; the actual script file
1729 must be stored as part of the documentation source tree,
1730 though it may be used to format documents outside the
Fred Drakece444982000-04-11 18:52:52 +00001731 tree. Use \program{mkhowto} \longprogramopt{help}
Fred Draked290c101999-11-09 18:03:00 +00001732 for a list of
Fred Draked2a727f1999-05-27 21:45:54 +00001733 command line options.
Fred Drake87f768e1999-05-17 15:22:45 +00001734
Fred Draked1fb7791999-05-17 16:33:54 +00001735 \program{mkhowto} can be used for both \code{howto} and
1736 \code{manual} class documents. (For the later, be sure to get
1737 the latest version from the Python CVS repository rather than
1738 the version distributed in the \file{latex-1.5.2.tgz} source
1739 archive.)
1740
Fred Drake87f768e1999-05-17 15:22:45 +00001741 XXX Need more here.
Fred Drakeacffaee1999-03-16 16:09:13 +00001742 \end{description}
1743
1744
1745\section{Future Directions \label{futures}}
1746
1747 The history of the Python documentation is full of changes, most of
1748 which have been fairly small and evolutionary. There has been a
1749 great deal of discussion about making large changes in the markup
1750 languages and tools used to process the documentation. This section
1751 deals with the nature of the changes and what appears to be the most
1752 likely path of future development.
1753
1754 \subsection{Structured Documentation \label{structured}}
1755
1756 Most of the small changes to the \LaTeX{} markup have been made
1757 with an eye to divorcing the markup from the presentation, making
1758 both a bit more maintainable. Over the course of 1998, a large
1759 number of changes were made with exactly this in mind; previously,
1760 changes had been made but in a less systematic manner and with
1761 more concern for not needing to update the existing content. The
1762 result has been a highly structured and semantically loaded markup
1763 language implemented in \LaTeX. With almost no basic \TeX{} or
1764 \LaTeX{} markup in use, however, the markup syntax is about the
1765 only evidence of \LaTeX{} in the actual document sources.
1766
1767 One side effect of this is that while we've been able to use
1768 standard ``engines'' for manipulating the documents, such as
1769 \LaTeX{} and \LaTeX2HTML, most of the actual transformations have
Fred Drake7a737df1999-04-23 14:41:44 +00001770 been created specifically for Python. The \LaTeX{} document
1771 classes and \LaTeX2HTML support are both complete implementations
1772 of the specific markup designed for these documents.
Fred Drakeacffaee1999-03-16 16:09:13 +00001773
1774 Combining highly customized markup with the somewhat esoteric
1775 systems used to process the documents leads us to ask some
1776 questions: Can we do this more easily? and, Can we do this
1777 better? After a great deal of discussion with the community, we
1778 have determined that actively pursuing modern structured
Fred Drake2c4e0091999-03-29 14:55:55 +00001779 documentation systems is worth some investment of time.
Fred Drakeacffaee1999-03-16 16:09:13 +00001780
1781 There appear to be two real contenders in this arena: the Standard
1782 General Markup Language (SGML), and the Extensible Markup Language
1783 (XML). Both of these standards have advantages and disadvantages,
1784 and many advantages are shared.
1785
1786 SGML offers advantages which may appeal most to authors,
1787 especially those using ordinary text editors. There are also
1788 additional abilities to define content models. A number of
Fred Drake67f193f2001-07-09 16:04:03 +00001789 high-quality tools with demonstrated maturity are available, but
Fred Drakeacffaee1999-03-16 16:09:13 +00001790 most are not free; for those which are, portability issues remain
1791 a problem.
1792
1793 The advantages of XML include the availability of a large number
1794 of evolving tools. Unfortunately, many of the associated
1795 standards are still evolving, and the tools will have to follow
1796 along. This means that developing a robust tool set that uses
1797 more than the basic XML 1.0 recommendation is not possible in the
1798 short term. The promised availability of a wide variety of
1799 high-quality tools which support some of the most important
1800 related standards is not immediate. Many tools are likely to be
Fred Drake67f193f2001-07-09 16:04:03 +00001801 free, and the portability issues of those which are, are not
1802 expected to be significant.
Fred Drakeacffaee1999-03-16 16:09:13 +00001803
Fred Drake67f193f2001-07-09 16:04:03 +00001804 It turns out that converting to an XML or SGML system holds
1805 promise for translators as well; how much can be done to ease the
1806 burden on translators remains to be seen, and may have some impact
1807 on the schema and specific technologies used.
1808
1809 XXX Eventual migration to XML.
1810
1811 The documentation will be moved to XML in the future, and tools
1812 are being written which will convert the documentation from the
1813 current format to something close to a finished version, to the
1814 extent that the desired information is already present in the
1815 documentation. Some XSLT stylesheets have been started for
1816 presenting a preliminary XML version as HTML, but the results are
1817 fairly rough..
1818
1819 The timeframe for the conversion is not clear since there doesn't
1820 seem to be much time available to work on this, but the appearant
1821 benefits are growing more substantial at a moderately rapid pace.
1822
Fred Drakeacffaee1999-03-16 16:09:13 +00001823
1824 \subsection{Discussion Forums \label{discussion}}
1825
1826 Discussion of the future of the Python documentation and related
Fred Drake7a737df1999-04-23 14:41:44 +00001827 topics takes place in the Documentation Special Interest Group, or
1828 ``Doc-SIG.'' Information on the group, including mailing list
1829 archives and subscription information, is available at
Fred Drakeacffaee1999-03-16 16:09:13 +00001830 \url{http://www.python.org/sigs/doc-sig/}. The SIG is open to all
1831 interested parties.
1832
1833 Comments and bug reports on the standard documents should be sent
1834 to \email{python-docs@python.org}. This may include comments
Fred Drakeadade921999-04-22 13:05:27 +00001835 about formatting, content, grammatical and spelling errors, or
Fred Draked1fb7791999-05-17 16:33:54 +00001836 this document. You can also send comments on this document
1837 directly to the author at \email{fdrake@acm.org}.
Fred Drakeacffaee1999-03-16 16:09:13 +00001838
1839\end{document}