blob: 7ea9b3549de35e4ae3a24a57146bff218069b1eb [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{
13 Corporation for National Research Initiatives (CNRI) \\
14 1895 Preston White Drive, Reston, Va 20191, USA \\
15 E-mail: \email{fdrake@acm.org}
16}
Fred Drakeacffaee1999-03-16 16:09:13 +000017
18
19\begin{document}
20
21\maketitle
22
23\begin{abstract}
24\noindent
25The Python language documentation has a substantial body of
26documentation, much of it contributed by various authors. The markup
27used for the Python documentation is based on \LaTeX{} and requires a
28significant set of macros written specifically for documenting Python.
Fred Drake5eb992b1999-06-11 14:25:45 +000029This document describes the macros introduced to support Python
30documentation and how they should be used to support a wide range of
31output formats.
Fred Drakeacffaee1999-03-16 16:09:13 +000032
33This document describes the document classes and special markup used
34in the Python documentation. Authors may use this guide, in
35conjunction with the template files provided with the
36distribution, to create or maintain whole documents or sections.
37\end{abstract}
38
39\tableofcontents
40
41
42\section{Introduction}
43
44 Python's documentation has long been considered to be good for a
45 free programming language. There are a number of reasons for this,
46 the most important being the early commitment of Python's creator,
47 Guido van Rossum, to providing documentation on the language and its
48 libraries, and the continuing involvement of the user community in
49 providing assistance for creating and maintaining documentation.
50
51 The involvement of the community takes many forms, from authoring to
Fred Drake7a737df1999-04-23 14:41:44 +000052 bug reports to just plain complaining when the documentation could
53 be more complete or easier to use. All of these forms of input from
54 the community have proved useful during the time I've been involved
55 in maintaining the documentation.
Fred Drakeacffaee1999-03-16 16:09:13 +000056
Fred Drake2c4e0091999-03-29 14:55:55 +000057 This document is aimed at authors and potential authors of
Fred Drake7a737df1999-04-23 14:41:44 +000058 documentation for Python. More specifically, it is for people
59 contributing to the standard documentation and developing additional
60 documents using the same tools as the standard documents. This
61 guide will be less useful for authors using the Python documentation
62 tools for topics other than Python, and less useful still for
63 authors not using the tools at all.
Fred Drakeacffaee1999-03-16 16:09:13 +000064
Fred Drake2c4e0091999-03-29 14:55:55 +000065 The material in this guide is intended to assist authors using the
66 Python documentation tools. It includes information on the source
67 distribution of the standard documentation, a discussion of the
Fred Drake7a737df1999-04-23 14:41:44 +000068 document types, reference material on the markup defined in the
69 document classes, a list of the external tools needed for processing
Fred Drake2c4e0091999-03-29 14:55:55 +000070 documents, and reference material on the tools provided with the
71 documentation resources. At the end, there is also a section
Fred Drake7a737df1999-04-23 14:41:44 +000072 discussing future directions for the Python documentation and where
73 to turn for more information.
Fred Drakeacffaee1999-03-16 16:09:13 +000074
75\section{Directory Structure}
76
77 The source distribution for the standard Python documentation
78 contains a large number of directories. While third-party documents
79 do not need to be placed into this structure or need to be placed
80 within a similar structure, it can be helpful to know where to look
81 for examples and tools when developing new documents using the
82 Python documentation tools. This section describes this directory
83 structure.
84
85 The documentation sources are usually placed within the Python
Fred Drake7a737df1999-04-23 14:41:44 +000086 source distribution as the top-level directory \file{Doc/}, but
87 are not dependent on the Python source distribution in any way.
Fred Drakeacffaee1999-03-16 16:09:13 +000088
89 The \file{Doc/} directory contains a few files and several
90 subdirectories. The files are mostly self-explanatory, including a
91 \file{README} and a \file{Makefile}. The directories fall into
92 three categories:
93
94 \begin{definitions}
95 \term{Document Sources}
96 The \LaTeX{} sources for each document are placed in a
97 separate directory. These directories are given short,
Fred Drake2f4bebd1999-04-28 16:43:11 +000098 three-character names:
99
100 \begin{tableii}{p{.75in}|p{3in}}{filenq}{Directory}{Document Title}
Fred Drake698d5201999-11-10 15:54:57 +0000101 \lineii{api/}{\citetitle[../api/api.html]{The Python/C API}}
102 \lineii{doc/}{\citetitle[../doc/doc.html]{Documenting Python}}
103 \lineii{ext/}{\citetitle[../ext/ext.html]{Extending and Embedding the Python Interpreter}}
104 \lineii{lib/}{\citetitle[../lib/lib.html]{Python Library Reference}}
105 \lineii{mac/}{\citetitle[../mac/mac.html]{Macintosh Module Reference}}
106 \lineii{ref/}{\citetitle[../ref/ref.html]{Python Reference Manual}}
107 \lineii{tut/}{\citetitle[../tut/tut.html]{Python Tutorial}}
Fred Drake2f4bebd1999-04-28 16:43:11 +0000108 \end{tableii}
Fred Drakeacffaee1999-03-16 16:09:13 +0000109
110 \term{Format-Specific Output}
Fred Drake2c4e0091999-03-29 14:55:55 +0000111 Most output formats have a directory which contains a
Fred Drakeacffaee1999-03-16 16:09:13 +0000112 \file{Makefile} which controls the generation of that format
113 and provides storage for the formatted documents. The only
Fred Drake2c4e0091999-03-29 14:55:55 +0000114 variations within this category are the Portable Document
115 Format (PDF) and PostScript versions are placed in the
Fred Drake7a737df1999-04-23 14:41:44 +0000116 directories \file{paper-a4/} and \file{paper-letter/} (this
117 causes all the temporary files created by \LaTeX{} to be kept
118 in the same place for each paper size, where they can be more
119 easily ignored).
Fred Drakeacffaee1999-03-16 16:09:13 +0000120
Fred Drake2f4bebd1999-04-28 16:43:11 +0000121 \begin{tableii}{p{.75in}|p{3in}}{filenq}{Directory}{Output Formats}
122 \lineii{html/}{HTML output}
123 \lineii{info/}{GNU info output}
124 \lineii{paper-a4/}{PDF and PostScript, A4 paper}
125 \lineii{paper-letter/}{PDF and PostScript, US-Letter paper}
126 \end{tableii}
127
Fred Drakeacffaee1999-03-16 16:09:13 +0000128 \term{Supplemental Files}
129 Some additional directories are used to store supplemental
130 files used for the various processes. Directories are
131 included for the shared \LaTeX{} document classes, the
132 \LaTeX2HTML support, template files for various document
133 components, and the scripts used to perform various steps in
134 the formatting processes.
Fred Drake2f4bebd1999-04-28 16:43:11 +0000135
136 \begin{tableii}{p{.75in}|p{3in}}{filenq}{Directory}{Contents}
137 \lineii{perl/}{Support for \LaTeX2HTML processing}
138 \lineii{templates/}{Example files for source documents}
139 \lineii{texinputs/}{Style implementation for \LaTeX}
140 \lineii{tools/}{Custom processing scripts}
141 \end{tableii}
142
Fred Drakeacffaee1999-03-16 16:09:13 +0000143 \end{definitions}
144
Fred Drake2c4e0091999-03-29 14:55:55 +0000145
Fred Drakeadade921999-04-22 13:05:27 +0000146\section{\LaTeX{} Primer \label{latex-primer}}
Fred Drake2c4e0091999-03-29 14:55:55 +0000147
Fred Drakeadade921999-04-22 13:05:27 +0000148 This section is a brief introduction to \LaTeX{} concepts and
149 syntax, to provide authors enough information to author documents
150 productively without having to become ``\TeX{}nicians.''
151
Fred Drake5eb992b1999-06-11 14:25:45 +0000152 Perhaps the most important concept to keep in mind while marking up
153 Python documentation is the while \TeX{} is unstructured, \LaTeX{} was
154 designed as a layer on top of \TeX{} which specifically supports
155 structured markup. The Python-specific markup is intended to extend
156 the structure provided by standard \LaTeX{} document classes to
157 support additional information specific to Python.
158
Fred Drakeadade921999-04-22 13:05:27 +0000159 \LaTeX{} documents contain two parts: the preamble and the body.
160 The preamble is used to specify certain metadata about the document
161 itself, such as the title, the list of authors, the date, and the
162 \emph{class} the document belongs to. Additional information used
163 to control index generation and the use of bibliographic databases
Fred Drake7a737df1999-04-23 14:41:44 +0000164 can also be placed in the preamble. For most authors, the preamble
Fred Drakeadade921999-04-22 13:05:27 +0000165 can be most easily created by copying it from an existing document
166 and modifying a few key pieces of information.
167
168 The \dfn{class} of a document is used to place a document within a
169 broad category of documents and set some fundamental formatting
170 properties. For Python documentation, two classes are used: the
171 \code{manual} class and the \code{howto} class. These classes also
172 define the additional markup used to document Python concepts and
173 structures. Specific information about these classes is provided in
Fred Drake7a737df1999-04-23 14:41:44 +0000174 section \ref{classes}, ``Document Classes,'' below. The first thing
Fred Drakeadade921999-04-22 13:05:27 +0000175 in the preamble is the declaration of the document's class.
176
177 After the class declaration, a number of \emph{macros} are used to
178 provide further information about the document and setup any
Fred Drake7a737df1999-04-23 14:41:44 +0000179 additional markup that is needed. No output is generated from the
180 preamble; it is an error to include free text in the preamble
181 because it would cause output.
Fred Drakeadade921999-04-22 13:05:27 +0000182
183 The document body follows the preamble. This contains all the
184 printed components of the document marked up structurally.
185
186 XXX This section will discuss what the markup looks like, and
187 explain the difference between an environment and a macro.
Fred Drake2c4e0091999-03-29 14:55:55 +0000188
189
Fred Drakeadade921999-04-22 13:05:27 +0000190\section{Document Classes \label{classes}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000191
192 Two \LaTeX{} document classes are defined specifically for use with
193 the Python documentation. The \code{manual} class is for large
194 documents which are sectioned into chapters, and the \code{howto}
195 class is for smaller documents.
196
197 The \code{manual} documents are larger and are used for most of the
198 standard documents. This document class is based on the standard
199 \LaTeX{} \code{report} class and is formatted very much like a long
Fred Drake698d5201999-11-10 15:54:57 +0000200 technical report. The \citetitle[../ref/ref.html]{Python Reference
201 Manual} is a good example of a \code{manual} document, and the
202 \citetitle[../lib/lib.html]{Python Library Reference} is a large
203 example.
Fred Drakeacffaee1999-03-16 16:09:13 +0000204
205 The \code{howto} documents are shorter, and don't have the large
206 structure of the \code{manual} documents. This class is based on
207 the standard \LaTeX{} \code{article} class and is formatted somewhat
208 like the Linux Documentation Project's ``HOWTO'' series as done
209 originally using the LinuxDoc software. The original intent for the
210 document class was that it serve a similar role as the LDP's HOWTO
211 series, but the applicability of the class turns out to be somewhat
212 more broad. This class is used for ``how-to'' documents (this
213 document is an example) and for shorter reference manuals for small,
214 fairly cohesive module libraries. Examples of the later use include
Fred Drake698d5201999-11-10 15:54:57 +0000215 the standard \citetitle[../mac/mac.html]{Macintosh Library Modules}
216 and
217\citetitle[http://starship.python.org/crew/fdrake/manuals/krb5py/krb5py.html]{Using
Fred Drakeacffaee1999-03-16 16:09:13 +0000218 Kerberos from Python}, which contains reference material for an
219 extension package. These documents are roughly equivalent to a
220 single chapter from a larger work.
221
222
Fred Drake7a737df1999-04-23 14:41:44 +0000223\section{Special Markup Constructs}
Fred Drakeacffaee1999-03-16 16:09:13 +0000224
Fred Drake2c4e0091999-03-29 14:55:55 +0000225 The Python document classes define a lot of new environments and
226 macros. This section contains the reference material for these
227 facilities.
228
Fred Drakeacffaee1999-03-16 16:09:13 +0000229 \subsection{Information Units \label{info-units}}
230
Fred Drake2f4bebd1999-04-28 16:43:11 +0000231 XXX Explain terminology, or come up with something more ``lay.''
Fred Drakeacffaee1999-03-16 16:09:13 +0000232
Fred Drakeadade921999-04-22 13:05:27 +0000233 There are a number of environments used to describe specific
234 features provided by modules. Each environment requires
235 parameters needed to provide basic information about what is being
236 described, and the environment content should be the description.
237 Most of these environments make entries in the general index (if
238 one is being produced for the document); if no index entry is
239 desired, non-indexing variants are available for many of these
240 environments. The environments have names of the form
241 \code{\var{feature}desc}, and the non-indexing variants are named
242 \code{\var{feature}descni}. The available variants are explicitly
243 included in the list below.
244
245 For each of these environments, the first parameter, \var{name},
246 provides the name by which the feature is accessed.
247
248 Environments which describe features of objects within a module,
249 such as object methods or data attributes, allow an optional
250 \var{type name} parameter. When the feature is an attribute of
251 class instances, \var{type name} only needs to be given if the
252 class was not the most recently described class in the module; the
253 \var{name} value from the most recent \env{classdesc} is implied.
254 For features of built-in or extension types, the \var{type name}
Fred Drake7a737df1999-04-23 14:41:44 +0000255 value should always be provided. Another special case includes
256 methods and members of general ``protocols,'' such as the
257 formatter and writer protocols described for the
258 \module{formatter} module: these may be documented without any
259 specific implementation classes, and will always require the
260 \var{type name} parameter to be provided.
Fred Drakeadade921999-04-22 13:05:27 +0000261
262 \begin{envdesc}{datadesc}{\p{name}}
263 This environment is used to document global data in a module,
264 including both variables and values used as ``defined
265 constants.'' Class and object attributes are not documented
266 using this environment.
Fred Drakeacffaee1999-03-16 16:09:13 +0000267 \end{envdesc}
Fred Drake7a737df1999-04-23 14:41:44 +0000268 \begin{envdesc}{datadescni}{\p{name}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000269 Like \env{datadesc}, but without creating any index entries.
270 \end{envdesc}
271
Fred Drakeadade921999-04-22 13:05:27 +0000272 \begin{envdesc}{excdesc}{\p{name}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000273 Describe an exception. This may be either a string exception or
274 a class exception.
275 \end{envdesc}
276
Fred Drakeadade921999-04-22 13:05:27 +0000277 \begin{envdesc}{funcdesc}{\p{name}\p{parameters}}
278 Describe a module-level function. \var{parameters} should
279 not include the parentheses used in the call syntax. Object
280 methods are not documented using this environment. Bound object
281 methods placed in the module namespace as part of the public
282 interface of the module are documented using this, as they are
283 equivalent to normal functions for most purposes.
284
285 The description should include information about the parameters
286 required and how they are used (especially whether mutable
287 objects passed as parameters are modified), side effects, and
288 possible exceptions. A small example may be provided.
Fred Drakeacffaee1999-03-16 16:09:13 +0000289 \end{envdesc}
Fred Drakeadade921999-04-22 13:05:27 +0000290 \begin{envdesc}{funcdescni}{\p{name}\p{parameters}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000291 Like \env{funcdesc}, but without creating any index entries.
292 \end{envdesc}
293
Fred Drakeadade921999-04-22 13:05:27 +0000294 \begin{envdesc}{classdesc}{\p{name}\p{constructor parameters}}
295 Describe a class and its constructor. \var{constructor
296 parameters} should not include the \var{self} parameter or
297 the parentheses used in the call syntax.
Fred Drakeacffaee1999-03-16 16:09:13 +0000298 \end{envdesc}
299
Fred Drakeadade921999-04-22 13:05:27 +0000300 \begin{envdesc}{memberdesc}{\op{type name}\p{name}}
301 Describe an object data attribute. The description should
302 include information about the type of the data to be expected
303 and whether it may be changed directly.
Fred Drakeacffaee1999-03-16 16:09:13 +0000304 \end{envdesc}
Fred Drakeadade921999-04-22 13:05:27 +0000305 \begin{envdesc}{memberdescni}{\op{type name}\p{name}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000306 Like \env{memberdesc}, but without creating any index entries.
307 \end{envdesc}
308
Fred Drakeadade921999-04-22 13:05:27 +0000309 \begin{envdesc}{methoddesc}{\op{type name}\p{name}\p{parameters}}
310 Describe an object method. \var{parameters} should not include
311 the \var{self} parameter or the parentheses used in the call
312 syntax. The description should include similar information to
313 that described for \env{funcdesc}.
Fred Drakeacffaee1999-03-16 16:09:13 +0000314 \end{envdesc}
Fred Drakeadade921999-04-22 13:05:27 +0000315 \begin{envdesc}{methoddescni}{\op{type name}\p{name}\p{parameters}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000316 Like \env{methoddesc}, but without creating any index entries.
317 \end{envdesc}
318
319
Fred Drake5eb992b1999-06-11 14:25:45 +0000320 \subsection{Showing Code Examples}
321
322 Examples of Python source code or interactive sessions are
323 represented as \env{verbatim} environments. This environment
324 is a standard part of \LaTeX{}. It is important to only use
325 spaces for indentation in code examples since \TeX{} drops tabs
326 instead of converting them to spaces.
327
328 Representing an interactive session requires including the prompts
329 and output along with the Python code. No special markup is
330 required for interactive sessions.
331
332 Within the \env{verbatim} environment, characters special to
333 \LaTeX{} do not need to be specially marked in any way. The entire
334 example will be presented in a monospaced font; no attempt at
335 ``pretty-printing'' is made, as the environment must work for
336 non-Python code and non-code displays.
337
338 The Python Documentation Special Interest Group has discussed a
339 number of approaches to creating pretty-printed code displays and
340 interactive sessions; see the Doc-SIG area on the Python Web site
341 for more information on this topic.
342
343
Fred Drakeacffaee1999-03-16 16:09:13 +0000344 \subsection{Inline Markup}
345
Fred Drake87f768e1999-05-17 15:22:45 +0000346 The macros described in this section are used to mark just about
347 anything interesting in the document text. They may be used in
348 headings (though anything involving hyperlinks should be avoided
349 there) as well as in the body text.
Fred Drake2f4bebd1999-04-28 16:43:11 +0000350
351 \begin{macrodesc}{bfcode}{\p{text}}
352 Like \macro{code}, but also makes the font bold-face.
353 \end{macrodesc}
354
355 \begin{macrodesc}{cdata}{\p{name}}
356 The name of a C-language variable.
357 \end{macrodesc}
358
359 \begin{macrodesc}{cfunction}{\p{name}}
360 The name of a C-language function. \var{name} should include the
361 function name and the trailing parentheses.
362 \end{macrodesc}
363
364 \begin{macrodesc}{character}{\p{char}}
365 A character when discussing the character rather than a one-byte
366 string value. The character will be typeset as with \macro{samp}.
367 \end{macrodesc}
368
Fred Drake29a710f1999-11-10 22:51:18 +0000369 \begin{macrodesc}{citetitle}{\op{url}\p{title}}
370 A title for a referenced publication. If \var{url} is specified,
371 the title will be made into a hyperlink when formatted as HTML.
372 \end{macrodesc}
373
Fred Drake2f4bebd1999-04-28 16:43:11 +0000374 \begin{macrodesc}{class}{\p{name}}
375 A class name; a dotted name may be used.
376 \end{macrodesc}
377
378 \begin{macrodesc}{code}{\p{text}}
379 A short code fragment or literal constant value. Typically, it
380 should not include any spaces since no quotation marks are
381 added.
382 \end{macrodesc}
383
384 \begin{macrodesc}{constant}{\p{name}}
385 The name of a ``defined'' constant. This may be a C-language
386 \code{\#define} or a Python variable that is not intended to be
387 changed.
388 \end{macrodesc}
389
390 \begin{macrodesc}{ctype}{\p{name}}
391 The name of a C \keyword{typedef} or structure. For structures
392 defined without a \keyword{typedef}, use \code{\e ctype\{struct
393 struct_tag\}} to make it clear that the \keyword{struct} is
394 required.
395 \end{macrodesc}
396
397 \begin{macrodesc}{deprecated}{\p{version}\p{what to do}}
398 Declare whatever is being described as being deprecated starting
399 with release \var{version}. The text given as \var{what to do}
400 should recommend something to use instead.
401 \end{macrodesc}
402
403 \begin{macrodesc}{dfn}{\p{term}}
404 Mark the defining instance of \var{term} in the text. (No index
405 entries are generated.)
406 \end{macrodesc}
407
Fred Draked1fb7791999-05-17 16:33:54 +0000408 \begin{macrodesc}{e}{}
409 Produces a backslash. This is convenient in \macro{code} and
410 similar macros.
411 \end{macrodesc}
412
Fred Drake2f4bebd1999-04-28 16:43:11 +0000413 \begin{macrodesc}{email}{\p{address}}
414 An email address. Note that this is \emph{not} hyperlinked in
415 any of the possible output formats.
416 \end{macrodesc}
417
418 \begin{macrodesc}{emph}{\p{text}}
419 Emphasized text; this will be presented in an italic font.
420 \end{macrodesc}
421
422 \begin{macrodesc}{envvar}{\p{name}}
423 An environment variable. Index entries are generated.
424 \end{macrodesc}
425
426 \begin{macrodesc}{exception}{\p{name}}
427 The name of an exception. A dotted name may be used.
428 \end{macrodesc}
429
430 \begin{macrodesc}{file}{\p{file or dir}}
431 The name of a file or directory. In the PDF and PostScript
432 outputs, single quotes and a font change are used to indicate
433 the file name, but no quotes are used in the HTML output.
434 \end{macrodesc}
435
436 \begin{macrodesc}{filenq}{\p{file or dir}}
437 Like \macro{file}, but single quotes are never used. This can
438 be used in conjunction with tables if a column will only contain
439 file or directory names.
440 \end{macrodesc}
441
442 \begin{macrodesc}{function}{\p{name}}
443 The name of a Python function; dotted names may be used.
444 \end{macrodesc}
445
446 \begin{macrodesc}{kbd}{\p{key sequence}}
447 Mark a sequence of keystrokes. What form \var{key sequence}
448 takes may depend on platform- or application-specific
449 conventions. For example, an \program{xemacs} key sequence
450 may be marked like \code{\e kbd\{C-x C-f\}}.
451 \end{macrodesc}
452
453 \begin{macrodesc}{keyword}{\p{name}}
454 The name of a keyword in a programming language.
455 \end{macrodesc}
456
457 \begin{macrodesc}{makevar}{\p{name}}
458 The name of a \program{make} variable.
459 \end{macrodesc}
460
461 \begin{macrodesc}{manpage}{\p{name}\p{section}}
462 A reference to a \UNIX{} manual page.
463 \end{macrodesc}
464
465 \begin{macrodesc}{member}{\p{name}}
466 The name of a data attribute of an object.
467 \end{macrodesc}
468
469 \begin{macrodesc}{method}{\p{name}}
470 The name of a method of an object. \var{name} should include the
471 method name and the trailing parentheses. A dotted name may be
472 used.
473 \end{macrodesc}
474
475 \begin{macrodesc}{mimetype}{\p{name}}
476 The name of a MIME type.
477 \end{macrodesc}
478
479 \begin{macrodesc}{module}{\p{name}}
480 The name of a module; a dotted name may be used.
481 \end{macrodesc}
482
483 \begin{macrodesc}{newsgroup}{\p{name}}
484 The name of a USENET newsgroup.
485 \end{macrodesc}
486
Fred Drake2f4bebd1999-04-28 16:43:11 +0000487 \begin{macrodesc}{program}{\p{name}}
488 The name of an executable program. This may differ from the
489 file name for the executable for some platforms. In particular,
490 the \file{.exe} (or other) extension should be omitted for DOS
491 and Windows programs.
492 \end{macrodesc}
493
Fred Drake29a710f1999-11-10 22:51:18 +0000494 \begin{macrodesc}{programopt}{\p{option}}
495 A command-line option to an executable program.
496 \end{macrodesc}
497
Fred Drake2f4bebd1999-04-28 16:43:11 +0000498 \begin{macrodesc}{refmodule}{\op{key}\p{name}}
499 Like \macro{module}, but create a hyperlink to the documentation
500 for the named module. Note that the corresponding
501 \macro{declaremodule} must be in the same document. If the
502 \macro{declaremodule} defines a module key different from the
503 module name, it must also be provided as \var{key} to the
504 \macro{refmodule} macro.
505 \end{macrodesc}
506
507 \begin{macrodesc}{regexp}{\p{string}}
508 Mark a regular expression.
509 \end{macrodesc}
510
511 \begin{macrodesc}{rfc}{\p{number}}
512 A reference to an Internet Request for Comments. This generates
513 appropriate index entries. The text \samp{RFC \var{number}} is
514 generated; in the HTML output, this text is a hyperlink to an
515 online copy of the specified RFC.
516 \end{macrodesc}
517
518 \begin{macrodesc}{samp}{\p{text}}
519 A short code sample, but possibly longer than would be given
520 using \macro{code}. Since quotation marks are added, spaces are
521 acceptable.
522 \end{macrodesc}
523
524 \begin{macrodesc}{strong}{\p{text}}
525 Strongly emphasized text; this will be presented using a bold
526 font.
527 \end{macrodesc}
528
Fred Draked1fb7791999-05-17 16:33:54 +0000529 \begin{macrodesc}{url}{\p{url}}
530 A URL (or URN). The URL will be presented as text. In the HTML
531 and PDF formatted versions, the URL will also be a hyperlink.
532 This can be used when referring to external resources. Note
533 that many characters are special to \LaTeX{} and this macro
534 does not always do the right thing. In particular, the tilde
535 character (\character{\~}) is mis-handled; encoding it as a
536 hex-sequence does work, use \samp{\%7e} in place of the tilde
537 character.
538 \end{macrodesc}
539
Fred Drake2f4bebd1999-04-28 16:43:11 +0000540 \begin{macrodesc}{var}{\p{name}}
541 The name of a variable or formal parameter in running text.
542 \end{macrodesc}
543
544 \begin{macrodesc}{version}{}
545 The version number for the documentation, as specified using
546 \macro{release} in the preamble.
547 \end{macrodesc}
Fred Drakeacffaee1999-03-16 16:09:13 +0000548
549
550 \subsection{Module-specific Markup}
551
552 The markup described in this section is used to provide information
553 about a module being documented. A typical use of this markup
554 appears at the top of the section used to document a module. A
555 typical example might look like this:
556
557\begin{verbatim}
558\section{\module{spam} ---
559 Access to the SPAM facility}
560
561\declaremodule{extension}{spam}
Fred Drake2c4e0091999-03-29 14:55:55 +0000562 \platform{Unix}
Fred Drakeadade921999-04-22 13:05:27 +0000563\modulesynopsis{Access to the SPAM facility of \UNIX{}.}
Fred Drake2c4e0091999-03-29 14:55:55 +0000564\moduleauthor{Jane Doe}{jane.doe@frobnitz.org}
Fred Drakeacffaee1999-03-16 16:09:13 +0000565\end{verbatim}
566
Fred Drakeadade921999-04-22 13:05:27 +0000567 \begin{macrodesc}{declaremodule}{\op{key}\p{type}\p{name}}
Fred Drake87f768e1999-05-17 15:22:45 +0000568 Requires two parameters: module type (\samp{standard},
569 \samp{builtin}, \samp{extension}, or \samp{}), and the module
570 name. An optional parameter should be given as the basis for the
571 module's ``key'' used for linking to or referencing the section.
572 The ``key'' should only be given if the module's name contains any
573 underscores, and should be the name with the underscores stripped.
574 Note that the \var{type} parameter must be one of the values
575 listed above or an error will be printed. For modules which are
576 contained in packages, the fully-qualified name should be given as
577 \var{name} parameter. This should be the first thing after the
578 \macro{section} used to introduce the module.
Fred Drakeacffaee1999-03-16 16:09:13 +0000579 \end{macrodesc}
580
Fred Drakeadade921999-04-22 13:05:27 +0000581 \begin{macrodesc}{platform}{\p{specifier}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000582 Specifies the portability of the module. \var{specifier} is a
583 comma-separated list of keys that specify what platforms the
584 module is available on. The keys are short identifiers;
585 examples that are in use include \samp{IRIX}, \samp{Mac},
586 \samp{Windows}, and \samp{Unix}. It is important to use a key
Fred Drake7a737df1999-04-23 14:41:44 +0000587 which has already been used when applicable. This is used to
588 provide annotations in the Module Index and the HTML and GNU info
589 output.
Fred Drakeacffaee1999-03-16 16:09:13 +0000590 \end{macrodesc}
591
Fred Drakeadade921999-04-22 13:05:27 +0000592 \begin{macrodesc}{modulesynopsis}{\p{text}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000593 The \var{text} is a short, ``one line'' description of the
594 module that can be used as part of the chapter introduction.
Fred Drakeadade921999-04-22 13:05:27 +0000595 This is must be placed after \macro{declaremodule}.
Fred Drakeacffaee1999-03-16 16:09:13 +0000596 The synopsis is used in building the contents of the table
597 inserted as the \macro{localmoduletable}. No text is
598 produced at the point of the markup.
599 \end{macrodesc}
600
Fred Drakeadade921999-04-22 13:05:27 +0000601 \begin{macrodesc}{moduleauthor}{\p{name}\p{email}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000602 This macro is used to encode information about who authored a
603 module. This is currently not used to generate output, but can be
604 used to help determine the origin of the module.
605 \end{macrodesc}
606
607
608 \subsection{Library-level Markup}
609
610 This markup is used when describing a selection of modules. For
Fred Drake698d5201999-11-10 15:54:57 +0000611 example, the \citetitle[../mac/mac.html]{Macintosh Library
612 Modules} document uses this to help provide an overview of the
613 modules in the collection, and many chapters in the
614 \citetitle[../lib/lib.html]{Python Library Reference} use it for
Fred Drakeacffaee1999-03-16 16:09:13 +0000615 the same purpose.
616
617 \begin{macrodesc}{localmoduletable}{}
Fred Drake2c4e0091999-03-29 14:55:55 +0000618 If a \file{.syn} file exists for the current
Fred Drakeacffaee1999-03-16 16:09:13 +0000619 chapter (or for the entire document in \code{howto} documents), a
620 \env{synopsistable} is created with the contents loaded from the
621 \file{.syn} file.
622 \end{macrodesc}
623
624
625 \subsection{Table Markup}
626
627 There are three general-purpose table environments defined which
628 should be used whenever possible. These environments are defined
629 to provide tables of specific widths and some convenience for
630 formatting. These environments are not meant to be general
631 replacements for the standard \LaTeX{} table environments, but can
632 be used for an advantage when the documents are processed using
633 the tools for Python documentation processing. In particular, the
634 generated HTML looks good! There is also an advantage for the
Fred Drake7a737df1999-04-23 14:41:44 +0000635 eventual conversion of the documentation to SGML (see section
Fred Drake2c4e0091999-03-29 14:55:55 +0000636 \ref{futures}, ``Future Directions'').
Fred Drakeacffaee1999-03-16 16:09:13 +0000637
638 Each environment is named \env{table\var{cols}}, where \var{cols}
639 is the number of columns in the table specified in lower-case
640 Roman numerals. Within each of these environments, an additional
641 macro, \macro{line\var{cols}}, is defined, where \var{cols}
642 matches the \var{cols} value of the corresponding table
Fred Drake2c4e0091999-03-29 14:55:55 +0000643 environment. These are supported for \var{cols} values of
644 \code{ii}, \code{iii}, and \code{iv}. These environments are all
645 built on top of the \env{tabular} environment.
Fred Drakeacffaee1999-03-16 16:09:13 +0000646
Fred Drakeadade921999-04-22 13:05:27 +0000647 \begin{envdesc}{tableii}{\p{colspec}\p{col1font}\p{heading1}\p{heading2}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000648 Create a two-column table using the \LaTeX{} column specifier
649 \var{colspec}. The column specifier should indicate vertical
650 bars between columns as appropriate for the specific table, but
651 should not specify vertical bars on the outside of the table
652 (that is considered a stylesheet issue). The \var{col1font}
653 parameter is used as a stylistic treatment of the first column
654 of the table: the first column is presented as
655 \code{\e\var{col1font}\{column1\}}. To avoid treating the first
Fred Drakeadade921999-04-22 13:05:27 +0000656 column specially, \var{col1font} may be \samp{textrm}. The
Fred Drakeacffaee1999-03-16 16:09:13 +0000657 column headings are taken from the values \var{heading1} and
658 \var{heading2}.
659 \end{envdesc}
660
Fred Drakeadade921999-04-22 13:05:27 +0000661 \begin{macrodesc}{lineii}{\p{column1}\p{column2}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000662 Create a single table row within a \env{tableii} environment.
663 The text for the first column will be generated by applying the
664 macro named by the \var{col1font} value when the \env{tableii}
665 was opened.
666 \end{macrodesc}
667
Fred Drakeadade921999-04-22 13:05:27 +0000668 \begin{envdesc}{tableiii}{\p{colspec}\p{col1font}\p{heading1}\p{heading2}\p{heading3}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000669 Like the \env{tableii} environment, but with a third column.
670 The heading for the third column is given by \var{heading3}.
671 \end{envdesc}
672
Fred Drakeadade921999-04-22 13:05:27 +0000673 \begin{macrodesc}{lineiii}{\p{column1}\p{column2}\p{column3}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000674 Like the \macro{lineii} macro, but with a third column. The
675 text for the third column is given by \var{column3}.
676 \end{macrodesc}
677
Fred Drakeadade921999-04-22 13:05:27 +0000678 \begin{envdesc}{tableiv}{\p{colspec}\p{col1font}\p{heading1}\p{heading2}\p{heading3}\p{heading4}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000679 Like the \env{tableiii} environment, but with a fourth column.
680 The heading for the fourth column is given by \var{heading4}.
681 \end{envdesc}
682
Fred Drakeadade921999-04-22 13:05:27 +0000683 \begin{macrodesc}{lineiv}{\p{column1}\p{column2}\p{column3}\p{column4}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000684 Like the \macro{lineiii} macro, but with a fourth column. The
685 text for the fourth column is given by \var{column4}.
686 \end{macrodesc}
687
688
689 An additional table-like environment is \env{synopsistable}. The
690 table generated by this environment contains two columns, and each
691 row is defined by an alternate definition of
692 \macro{modulesynopsis}. This environment is not normally use by
693 the user, but is created by the \macro{localmoduletable} macro.
694
695
696 \subsection{Reference List Markup \label{references}}
697
698 Many sections include a list of references to module documentation
699 or external documents. These lists are created using the
700 \env{seealso} environment. This environment defines some
701 additional macros to support creating reference entries in a
702 reasonable manner.
703
704 \begin{envdesc}{seealso}{}
705 This environment creates a ``See also:'' heading and defines the
706 markup used to describe individual references.
707 \end{envdesc}
708
Fred Drakeadade921999-04-22 13:05:27 +0000709 \begin{macrodesc}{seemodule}{\op{key}\p{name}\p{why}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000710 Refer to another module. \var{why} should be a brief
711 explanation of why the reference may be interesting. The module
712 name is given in \var{name}, with the link key given in
713 \var{key} if necessary. In the HTML and PDF conversions, the
714 module name will be a hyperlink to the referred-to module.
Fred Drakeadade921999-04-22 13:05:27 +0000715 \strong{Note:} The module must be documented in the same
716 document (the corresponding \macro{declaremodule} is required).
Fred Drakeacffaee1999-03-16 16:09:13 +0000717 \end{macrodesc}
718
Fred Drakeadade921999-04-22 13:05:27 +0000719 \begin{macrodesc}{seetext}{\p{text}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000720 Add arbitrary text \var{text} to the ``See also:'' list. This
721 can be used to refer to off-line materials or on-line materials
722 using the \macro{url} macro.
723 \end{macrodesc}
724
725
726 \subsection{Index-generating Markup \label{indexing}}
727
728 Effective index generation for technical documents can be very
729 difficult, especially for someone familliar with the topic but not
730 the creation of indexes. Much of the difficulty arises in the
731 area of terminology: including the terms an expert would use for a
732 concept is not sufficient. Coming up with the terms that a novice
Fred Drake2c4e0091999-03-29 14:55:55 +0000733 would look up is fairly difficult for an author who, typically, is
Fred Drakeacffaee1999-03-16 16:09:13 +0000734 an expert in the area she is writing on.
735
Fred Drake2c4e0091999-03-29 14:55:55 +0000736 The truly difficult aspects of index generation are not areas with
737 which the documentation tools can help. However, ease
Fred Drakeacffaee1999-03-16 16:09:13 +0000738 of producing the index once content decisions are make is within
739 the scope of the tools. Markup is provided which the processing
740 software is able to use to generate a variety of kinds of index
741 entry with minimal effort. Additionally, many of the environments
Fred Drake7a737df1999-04-23 14:41:44 +0000742 described in section \ref{info-units}, ``Information Units,'' will
Fred Drakeacffaee1999-03-16 16:09:13 +0000743 generate appropriate entries into the general and module indexes.
744
745 The following macro can be used to control the generation of index
Fred Drakeadade921999-04-22 13:05:27 +0000746 data, and should be used in the document preamble:
Fred Drakeacffaee1999-03-16 16:09:13 +0000747
748 \begin{macrodesc}{makemodindex}{}
Fred Drakeadade921999-04-22 13:05:27 +0000749 This should be used in the document preamble if a ``Module
Fred Drakeacffaee1999-03-16 16:09:13 +0000750 Index'' is desired for a document containing reference material
751 on many modules. This causes a data file
Fred Draked1fb7791999-05-17 16:33:54 +0000752 \code{lib\var{jobname}.idx} to be created from the
Fred Drakeacffaee1999-03-16 16:09:13 +0000753 \macro{declaremodule} macros. This file can be processed by the
754 \program{makeindex} program to generate a file which can be
755 \macro{input} into the document at the desired location of the
756 module index.
757 \end{macrodesc}
758
759 There are a number of macros that are useful for adding index
760 entries for particular concepts, many of which are specific to
761 programming languages or even Python.
762
Fred Drakeadade921999-04-22 13:05:27 +0000763 \begin{macrodesc}{bifuncindex}{\p{name}}
Fred Drakeec8b9051999-04-23 20:01:17 +0000764 Add an index entry referring to a built-in function named
765 \var{name}; parentheses should not be included after
Fred Drake2c4e0091999-03-29 14:55:55 +0000766 \var{name}.
Fred Drakeacffaee1999-03-16 16:09:13 +0000767 \end{macrodesc}
768
Fred Drakeadade921999-04-22 13:05:27 +0000769 \begin{macrodesc}{exindex}{\p{exception}}
Fred Drake2c4e0091999-03-29 14:55:55 +0000770 Add a reference to an exception named \var{exception}. The
771 exception may be either string- or class-based.
Fred Drakeacffaee1999-03-16 16:09:13 +0000772 \end{macrodesc}
773
Fred Drakeadade921999-04-22 13:05:27 +0000774 \begin{macrodesc}{kwindex}{\p{keyword}}
Fred Drake2c4e0091999-03-29 14:55:55 +0000775 Add a reference to a language keyword (not a keyword parameter
776 in a function or method call).
Fred Drakeacffaee1999-03-16 16:09:13 +0000777 \end{macrodesc}
778
Fred Drakeadade921999-04-22 13:05:27 +0000779 \begin{macrodesc}{obindex}{\p{object type}}
Fred Drake2c4e0091999-03-29 14:55:55 +0000780 Add an index entry for a built-in object type.
Fred Drakeacffaee1999-03-16 16:09:13 +0000781 \end{macrodesc}
782
Fred Drakeadade921999-04-22 13:05:27 +0000783 \begin{macrodesc}{opindex}{\p{operator}}
Fred Drake2c4e0091999-03-29 14:55:55 +0000784 Add a reference to an operator, such as \samp{+}.
Fred Drakeacffaee1999-03-16 16:09:13 +0000785 \end{macrodesc}
786
Fred Drakeadade921999-04-22 13:05:27 +0000787 \begin{macrodesc}{refmodindex}{\op{key}\p{module}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000788 Add an index entry for module \var{module}; if \var{module}
789 contains an underscore, the optional parameter \var{key} should
790 be provided as the same string with underscores removed. An
791 index entry ``\var{module} (module)'' will be generated. This
792 is intended for use with non-standard modules implemented in
793 Python.
794 \end{macrodesc}
795
Fred Drakeadade921999-04-22 13:05:27 +0000796 \begin{macrodesc}{refexmodindex}{\op{key}\p{module}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000797 As for \macro{refmodindex}, but the index entry will be
798 ``\var{module} (extension module).'' This is intended for use
799 with non-standard modules not implemented in Python.
800 \end{macrodesc}
801
Fred Drakeadade921999-04-22 13:05:27 +0000802 \begin{macrodesc}{refbimodindex}{\op{key}\p{module}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000803 As for \macro{refmodindex}, but the index entry will be
804 ``\var{module} (built-in module).'' This is intended for use
805 with standard modules not implemented in Python.
806 \end{macrodesc}
807
Fred Drakeadade921999-04-22 13:05:27 +0000808 \begin{macrodesc}{refstmodindex}{\op{key}\p{module}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000809 As for \macro{refmodindex}, but the index entry will be
810 ``\var{module} (standard module).'' This is intended for use
811 with standard modules implemented in Python.
812 \end{macrodesc}
813
Fred Drakeadade921999-04-22 13:05:27 +0000814 \begin{macrodesc}{stindex}{\p{statement}}
Fred Drake2c4e0091999-03-29 14:55:55 +0000815 Add an index entry for a statement type, such as \keyword{print}
Fred Drakeadade921999-04-22 13:05:27 +0000816 or \keyword{try}/\keyword{finally}.
817
818 XXX Need better examples of difference from \macro{kwindex}.
Fred Drakeacffaee1999-03-16 16:09:13 +0000819 \end{macrodesc}
820
821
822 Additional macros are provided which are useful for conveniently
823 creating general index entries which should appear at many places
824 in the index by rotating a list of words. These are simple macros
825 that simply use \macro{index} to build some number of index
826 entries. Index entries build using these macros contain both
827 primary and secondary text.
828
Fred Drakeadade921999-04-22 13:05:27 +0000829 \begin{macrodesc}{indexii}{\p{word1}\p{word2}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000830 Build two index entries. This is exactly equivalent to using
831 \code{\e index\{\var{word1}!\var{word2}\}} and
832 \code{\e index\{\var{word2}!\var{word1}\}}.
833 \end{macrodesc}
834
Fred Drakeadade921999-04-22 13:05:27 +0000835 \begin{macrodesc}{indexiii}{\p{word1}\p{word2}\p{word3}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000836 Build three index entries. This is exactly equivalent to using
837 \code{\e index\{\var{word1}!\var{word2} \var{word3}\}},
838 \code{\e index\{\var{word2}!\var{word3}, \var{word1}\}}, and
839 \code{\e index\{\var{word3}!\var{word1} \var{word2}\}}.
840 \end{macrodesc}
841
Fred Drakeadade921999-04-22 13:05:27 +0000842 \begin{macrodesc}{indexiv}{\p{word1}\p{word2}\p{word3}\p{word4}}
Fred Drakeacffaee1999-03-16 16:09:13 +0000843 Build four index entries. This is exactly equivalent to using
844 \code{\e index\{\var{word1}!\var{word2} \var{word3} \var{word4}\}},
845 \code{\e index\{\var{word2}!\var{word3} \var{word4}, \var{word1}\}},
846 \code{\e index\{\var{word3}!\var{word4}, \var{word1} \var{word2}\}},
847 and
848 \code{\e index\{\var{word4}!\var{word1} \var{word2} \var{word3}\}}.
849 \end{macrodesc}
850
851
852\section{Special Names}
853
854 Many special names are used in the Python documentation, including
855 the names of operating systems, programming languages, standards
856 bodies, and the like. Many of these were assigned \LaTeX{} macros
857 at some point in the distant past, and these macros lived on long
858 past their usefulness. In the current markup, these entities are
859 not assigned any special markup, but the preferred spellings are
860 given here to aid authors in maintaining the consistency of
861 presentation in the Python documentation.
862
863 \begin{description}
864 \item[POSIX]
865 The name assigned to a particular group of standards. This is
866 always uppercase.
867
868 \item[Python]
869 The name of our favorite programming language is always
870 capitalized.
871 \end{description}
872
873
874\section{Processing Tools}
875
876 \subsection{External Tools}
877
878 Many tools are needed to be able to process the Python
879 documentation if all supported formats are required. This
Fred Drakeadade921999-04-22 13:05:27 +0000880 section lists the tools used and when each is required. Consult
881 the \file{Doc/README} file to see if there are specific version
882 requirements for any of these.
Fred Drakeacffaee1999-03-16 16:09:13 +0000883
884 \begin{description}
885 \item[\program{dvips}]
886 This program is a typical part of \TeX{} installations. It is
887 used to generate PostScript from the ``device independent''
Fred Drake2c4e0091999-03-29 14:55:55 +0000888 \file{.dvi} files. It is needed for the conversion to
Fred Drakeacffaee1999-03-16 16:09:13 +0000889 PostScript.
890
891 \item[\program{emacs}]
892 Emacs is the kitchen sink of programmers' editors, and a damn
893 fine kitchen sink it is. It also comes with some of the
894 processing needed to support the proper menu structures for
895 Texinfo documents when an info conversion is desired. This is
Fred Drake2c4e0091999-03-29 14:55:55 +0000896 needed for the info conversion. Using \program{xemacs}
Fred Drakeacffaee1999-03-16 16:09:13 +0000897 instead of FSF \program{emacs} may lead to instability in the
898 conversion, but that's because nobody seems to maintain the
899 Emacs Texinfo code in a portable manner.
900
901 \item[\program{latex}]
902 This is a world-class typesetter by Donald Knuth. It is used
903 for the conversion to PostScript, and is needed for the HTML
904 conversion as well (\LaTeX2HTML requires one of the
905 intermediate files it creates).
906
907 \item[\program{latex2html}]
908 Probably the longest Perl script anyone ever attempted to
909 maintain. This converts \LaTeX{} documents to HTML documents,
910 and does a pretty reasonable job. It is required for the
911 conversions to HTML and GNU info.
912
913 \item[\program{lynx}]
914 This is a text-mode Web browser which includes an
915 HTML-to-plain text conversion. This is used to convert
916 \code{howto} documents to text.
917
918 \item[\program{make}]
919 Just about any version should work for the standard documents,
920 but GNU \program{make} is required for the experimental
921 processes in \file{Doc/tools/sgmlconv/}, at least while
922 they're experimental.
923
924 \item[\program{makeindex}]
925 This is a standard program for converting \LaTeX{} index data
926 to a formatted index; it should be included with all \LaTeX{}
927 installations. It is needed for the PDF and PostScript
928 conversions.
929
930 \item[\program{makeinfo}]
931 GNU \program{makeinfo} is used to convert Texinfo documents to
932 GNU info files. Since Texinfo is used as an intermediate
933 format in the info conversion, this program is needed in that
934 conversion.
935
936 \item[\program{pdflatex}]
937 pdf\TeX{} is a relatively new variant of \TeX, and is used to
938 generate the PDF version of the manuals. It is typically
939 installed as part of most of the large \TeX{} distributions.
Fred Drake7a737df1999-04-23 14:41:44 +0000940 \program{pdflatex} is pdf\TeX{} using the \LaTeX{} format.
Fred Drakeacffaee1999-03-16 16:09:13 +0000941
942 \item[\program{perl}]
943 Perl is required for \LaTeX2HTML{} and one of the scripts used
944 to post-process \LaTeX2HTML output, as well as the
Fred Drake2c4e0091999-03-29 14:55:55 +0000945 HTML-to-Texinfo conversion. This is required for
Fred Drakeacffaee1999-03-16 16:09:13 +0000946 the HTML and GNU info conversions.
947
948 \item[\program{python}]
949 Python is used for many of the scripts in the
950 \file{Doc/tools/} directory; it is required for all
951 conversions. This shouldn't be a problem if you're interested
952 in writing documentation for Python!
953 \end{description}
954
955
956 \subsection{Internal Tools}
957
958 This section describes the various scripts that are used to
959 implement various stages of document processing or to orchestrate
Fred Drake2c4e0091999-03-29 14:55:55 +0000960 entire build sequences. Most of these tools are only useful
Fred Drakeacffaee1999-03-16 16:09:13 +0000961 in the context of building the standard documentation, but some
962 are more general.
963
964 \begin{description}
965 \item[\program{mkhowto}]
Fred Drake87f768e1999-05-17 15:22:45 +0000966 This is the primary script used to format third-party
967 documents. It contains all the logic needed to ``get it
968 right.'' The proper way to use this script is to make a
969 symbolic link to it or run it in place; the actual script file
970 must be stored as part of the documentation source tree,
971 though it may be used to format documents outside the
Fred Draked290c101999-11-09 18:03:00 +0000972 tree. Use \program{mkhowto} \programopt{-}\programopt{-help}
973 for a list of
Fred Draked2a727f1999-05-27 21:45:54 +0000974 command line options.
Fred Drake87f768e1999-05-17 15:22:45 +0000975
Fred Draked1fb7791999-05-17 16:33:54 +0000976 \program{mkhowto} can be used for both \code{howto} and
977 \code{manual} class documents. (For the later, be sure to get
978 the latest version from the Python CVS repository rather than
979 the version distributed in the \file{latex-1.5.2.tgz} source
980 archive.)
981
Fred Drake87f768e1999-05-17 15:22:45 +0000982 XXX Need more here.
Fred Drakeacffaee1999-03-16 16:09:13 +0000983 \end{description}
984
985
986\section{Future Directions \label{futures}}
987
988 The history of the Python documentation is full of changes, most of
989 which have been fairly small and evolutionary. There has been a
990 great deal of discussion about making large changes in the markup
991 languages and tools used to process the documentation. This section
992 deals with the nature of the changes and what appears to be the most
993 likely path of future development.
994
995 \subsection{Structured Documentation \label{structured}}
996
997 Most of the small changes to the \LaTeX{} markup have been made
998 with an eye to divorcing the markup from the presentation, making
999 both a bit more maintainable. Over the course of 1998, a large
1000 number of changes were made with exactly this in mind; previously,
1001 changes had been made but in a less systematic manner and with
1002 more concern for not needing to update the existing content. The
1003 result has been a highly structured and semantically loaded markup
1004 language implemented in \LaTeX. With almost no basic \TeX{} or
1005 \LaTeX{} markup in use, however, the markup syntax is about the
1006 only evidence of \LaTeX{} in the actual document sources.
1007
1008 One side effect of this is that while we've been able to use
1009 standard ``engines'' for manipulating the documents, such as
1010 \LaTeX{} and \LaTeX2HTML, most of the actual transformations have
Fred Drake7a737df1999-04-23 14:41:44 +00001011 been created specifically for Python. The \LaTeX{} document
1012 classes and \LaTeX2HTML support are both complete implementations
1013 of the specific markup designed for these documents.
Fred Drakeacffaee1999-03-16 16:09:13 +00001014
1015 Combining highly customized markup with the somewhat esoteric
1016 systems used to process the documents leads us to ask some
1017 questions: Can we do this more easily? and, Can we do this
1018 better? After a great deal of discussion with the community, we
1019 have determined that actively pursuing modern structured
Fred Drake2c4e0091999-03-29 14:55:55 +00001020 documentation systems is worth some investment of time.
Fred Drakeacffaee1999-03-16 16:09:13 +00001021
1022 There appear to be two real contenders in this arena: the Standard
1023 General Markup Language (SGML), and the Extensible Markup Language
1024 (XML). Both of these standards have advantages and disadvantages,
1025 and many advantages are shared.
1026
1027 SGML offers advantages which may appeal most to authors,
1028 especially those using ordinary text editors. There are also
1029 additional abilities to define content models. A number of
1030 high-quality tools with demonstrated maturity is available, but
1031 most are not free; for those which are, portability issues remain
1032 a problem.
1033
1034 The advantages of XML include the availability of a large number
1035 of evolving tools. Unfortunately, many of the associated
1036 standards are still evolving, and the tools will have to follow
1037 along. This means that developing a robust tool set that uses
1038 more than the basic XML 1.0 recommendation is not possible in the
1039 short term. The promised availability of a wide variety of
1040 high-quality tools which support some of the most important
1041 related standards is not immediate. Many tools are likely to be
1042 free.
1043
Fred Drakeadade921999-04-22 13:05:27 +00001044 XXX Eventual migration to SGML/XML.
Fred Drakeacffaee1999-03-16 16:09:13 +00001045
1046 \subsection{Discussion Forums \label{discussion}}
1047
1048 Discussion of the future of the Python documentation and related
Fred Drake7a737df1999-04-23 14:41:44 +00001049 topics takes place in the Documentation Special Interest Group, or
1050 ``Doc-SIG.'' Information on the group, including mailing list
1051 archives and subscription information, is available at
Fred Drakeacffaee1999-03-16 16:09:13 +00001052 \url{http://www.python.org/sigs/doc-sig/}. The SIG is open to all
1053 interested parties.
1054
1055 Comments and bug reports on the standard documents should be sent
1056 to \email{python-docs@python.org}. This may include comments
Fred Drakeadade921999-04-22 13:05:27 +00001057 about formatting, content, grammatical and spelling errors, or
Fred Draked1fb7791999-05-17 16:33:54 +00001058 this document. You can also send comments on this document
1059 directly to the author at \email{fdrake@acm.org}.
Fred Drakeacffaee1999-03-16 16:09:13 +00001060
1061\end{document}