annotate Doc/lib/libhtmllib.tex @ 21467:4e35fa5d5708 legacy-trunk

Add documentation for the help() built-in; contributed by Ka-Ping Yee. This is part of SF patch #494622.
author Fred Drake <fdrake@acm.org>
date Tue, 18 Dec 2001 16:31:08 +0000
parents 7de5c376232c
children 2cfd916dd312
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8918
acfffe14628e New section header style.
Fred Drake <fdrake@acm.org>
parents: 8716
diff changeset
1 \section{\module{htmllib} ---
10693
9e0402ee3812 Markup nits.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
2 A parser for HTML documents}
9e0402ee3812 Markup nits.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
3
8716
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 7877
diff changeset
4 \declaremodule{standard}{htmllib}
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 7877
diff changeset
5 \modulesynopsis{A parser for HTML documents.}
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 7877
diff changeset
6
2453
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
7 \index{HTML}
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
8 \index{hypertext}
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
9
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
10
4381
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
11 This module defines a class which can serve as a base for parsing text
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
12 files formatted in the HyperText Mark-up Language (HTML). The class
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
13 is not directly concerned with I/O --- it must be provided with input
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
14 in string form via a method, and makes calls to methods of a
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
15 ``formatter'' object in order to produce output. The
7229
bc28a0ea6640 Removed all references to the \rfcindex{} macro; now only \rfc{} is used.
Fred Drake <fdrake@acm.org>
parents: 7219
diff changeset
16 \class{HTMLParser} class is designed to be used as a base class for
4381
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
17 other classes in order to add functionality, and allows most of its
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
18 methods to be extended or overridden. In turn, this class is derived
7229
bc28a0ea6640 Removed all references to the \rfcindex{} macro; now only \rfc{} is used.
Fred Drake <fdrake@acm.org>
parents: 7219
diff changeset
19 from and extends the \class{SGMLParser} class defined in module
10693
9e0402ee3812 Markup nits.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
20 \refmodule{sgmllib}\refstmodindex{sgmllib}. The \class{HTMLParser}
7229
bc28a0ea6640 Removed all references to the \rfcindex{} macro; now only \rfc{} is used.
Fred Drake <fdrake@acm.org>
parents: 7219
diff changeset
21 implementation supports the HTML 2.0 language as described in
bc28a0ea6640 Removed all references to the \rfcindex{} macro; now only \rfc{} is used.
Fred Drake <fdrake@acm.org>
parents: 7219
diff changeset
22 \rfc{1866}. Two implementations of formatter objects are provided in
10693
9e0402ee3812 Markup nits.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
23 the \refmodule{formatter}\refstmodindex{formatter} module; refer to the
7229
bc28a0ea6640 Removed all references to the \rfcindex{} macro; now only \rfc{} is used.
Fred Drake <fdrake@acm.org>
parents: 7219
diff changeset
24 documentation for that module for information on the formatter
bc28a0ea6640 Removed all references to the \rfcindex{} macro; now only \rfc{} is used.
Fred Drake <fdrake@acm.org>
parents: 7219
diff changeset
25 interface.
7667
35f29b7dacf5 Use {classdesc} instead of {funcdesc} for HTMLParser.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
26 \withsubitem{(in module sgmllib)}{\ttindex{SGMLParser}}
2453
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
27
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
28 The following is a summary of the interface defined by
7229
bc28a0ea6640 Removed all references to the \rfcindex{} macro; now only \rfc{} is used.
Fred Drake <fdrake@acm.org>
parents: 7219
diff changeset
29 \class{sgmllib.SGMLParser}:
2453
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
30
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
31 \begin{itemize}
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
32
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
33 \item
7229
bc28a0ea6640 Removed all references to the \rfcindex{} macro; now only \rfc{} is used.
Fred Drake <fdrake@acm.org>
parents: 7219
diff changeset
34 The interface to feed data to an instance is through the \method{feed()}
2453
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
35 method, which takes a string argument. This can be called with as
7229
bc28a0ea6640 Removed all references to the \rfcindex{} macro; now only \rfc{} is used.
Fred Drake <fdrake@acm.org>
parents: 7219
diff changeset
36 little or as much text at a time as desired; \samp{p.feed(a);
bc28a0ea6640 Removed all references to the \rfcindex{} macro; now only \rfc{} is used.
Fred Drake <fdrake@acm.org>
parents: 7219
diff changeset
37 p.feed(b)} has the same effect as \samp{p.feed(a+b)}. When the data
4381
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
38 contains complete HTML tags, these are processed immediately;
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
39 incomplete elements are saved in a buffer. To force processing of all
7229
bc28a0ea6640 Removed all references to the \rfcindex{} macro; now only \rfc{} is used.
Fred Drake <fdrake@acm.org>
parents: 7219
diff changeset
40 unprocessed data, call the \method{close()} method.
2453
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
41
4381
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
42 For example, to parse the entire contents of a file, use:
7277
bf4e790bd61a Remove all \bcode / \ecode cruft; this is no longer needed. See previous
Fred Drake <fdrake@acm.org>
parents: 7229
diff changeset
43 \begin{verbatim}
4381
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
44 parser.feed(open('myfile.html').read())
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
45 parser.close()
7277
bf4e790bd61a Remove all \bcode / \ecode cruft; this is no longer needed. See previous
Fred Drake <fdrake@acm.org>
parents: 7229
diff changeset
46 \end{verbatim}
7667
35f29b7dacf5 Use {classdesc} instead of {funcdesc} for HTMLParser.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
47
2453
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
48 \item
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
49 The interface to define semantics for HTML tags is very simple: derive
10693
9e0402ee3812 Markup nits.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
50 a class and define methods called \method{start_\var{tag}()},
9e0402ee3812 Markup nits.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
51 \method{end_\var{tag}()}, or \method{do_\var{tag}()}. The parser will
9e0402ee3812 Markup nits.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
52 call these at appropriate moments: \method{start_\var{tag}} or
9e0402ee3812 Markup nits.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
53 \method{do_\var{tag}()} is called when an opening tag of the form
9e0402ee3812 Markup nits.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
54 \code{<\var{tag} ...>} is encountered; \method{end_\var{tag}()} is called
2453
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
55 when a closing tag of the form \code{<\var{tag}>} is encountered. If
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
56 an opening tag requires a corresponding closing tag, like \code{<H1>}
10693
9e0402ee3812 Markup nits.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
57 ... \code{</H1>}, the class should define the \method{start_\var{tag}()}
2453
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
58 method; if a tag requires no closing tag, like \code{<P>}, the class
10693
9e0402ee3812 Markup nits.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
59 should define the \method{do_\var{tag}()} method.
2453
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
60
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
61 \end{itemize}
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
62
4381
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
63 The module defines a single class:
2453
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
64
7667
35f29b7dacf5 Use {classdesc} instead of {funcdesc} for HTMLParser.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
65 \begin{classdesc}{HTMLParser}{formatter}
4381
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
66 This is the basic HTML parser class. It supports all entity names
7219
640b97d105df Use the new RFC macros wherever RFCs are referenced by number. No other
Fred Drake <fdrake@acm.org>
parents: 6862
diff changeset
67 required by the HTML 2.0 specification (\rfc{1866}). It also defines
4381
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
68 handlers for all HTML 2.0 and many HTML 3.0 and 3.2 elements.
7667
35f29b7dacf5 Use {classdesc} instead of {funcdesc} for HTMLParser.
Fred Drake <fdrake@acm.org>
parents: 7277
diff changeset
69 \end{classdesc}
2453
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
70
11028
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
71
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
72 \begin{seealso}
18396
7de5c376232c Added more information on the differences between the htmllib and HTMLParser
Fred Drake <fdrake@acm.org>
parents: 13625
diff changeset
73 \seemodule{HTMLParser}{Alternate HTML parser that offers a slightly
7de5c376232c Added more information on the differences between the htmllib and HTMLParser
Fred Drake <fdrake@acm.org>
parents: 13625
diff changeset
74 lower-level view of the input, but is
7de5c376232c Added more information on the differences between the htmllib and HTMLParser
Fred Drake <fdrake@acm.org>
parents: 13625
diff changeset
75 designed to work with XHTML, and does not
7de5c376232c Added more information on the differences between the htmllib and HTMLParser
Fred Drake <fdrake@acm.org>
parents: 13625
diff changeset
76 implement some of the SGML syntax not used in
7de5c376232c Added more information on the differences between the htmllib and HTMLParser
Fred Drake <fdrake@acm.org>
parents: 13625
diff changeset
77 ``HTML as deployed'' and which isn't legal
7de5c376232c Added more information on the differences between the htmllib and HTMLParser
Fred Drake <fdrake@acm.org>
parents: 13625
diff changeset
78 for XHTML.}
11028
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
79 \seemodule{htmlentitydefs}{Definition of replacement text for HTML
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
80 2.0 entities.}
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
81 \seemodule{sgmllib}{Base class for \class{HTMLParser}.}
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
82 \end{seealso}
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
83
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
84
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
85 \subsection{HTMLParser Objects \label{html-parser-objects}}
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
86
7229
bc28a0ea6640 Removed all references to the \rfcindex{} macro; now only \rfc{} is used.
Fred Drake <fdrake@acm.org>
parents: 7219
diff changeset
87 In addition to tag methods, the \class{HTMLParser} class provides some
4381
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
88 additional methods and instance variables for use within tag methods.
2453
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
89
7768
8f177933c41f Use the new {methoddesc} and {memberdesc} environments as appropriate.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
90 \begin{memberdesc}{formatter}
4381
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
91 This is the formatter instance associated with the parser.
7768
8f177933c41f Use the new {methoddesc} and {memberdesc} environments as appropriate.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
92 \end{memberdesc}
2453
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
93
7768
8f177933c41f Use the new {methoddesc} and {memberdesc} environments as appropriate.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
94 \begin{memberdesc}{nofill}
4381
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
95 Boolean flag which should be true when whitespace should not be
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
96 collapsed, or false when it should be. In general, this should only
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
97 be true when character data is to be treated as ``preformatted'' text,
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
98 as within a \code{<PRE>} element. The default value is false. This
7229
bc28a0ea6640 Removed all references to the \rfcindex{} macro; now only \rfc{} is used.
Fred Drake <fdrake@acm.org>
parents: 7219
diff changeset
99 affects the operation of \method{handle_data()} and \method{save_end()}.
7768
8f177933c41f Use the new {methoddesc} and {memberdesc} environments as appropriate.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
100 \end{memberdesc}
2453
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
101
7229
bc28a0ea6640 Removed all references to the \rfcindex{} macro; now only \rfc{} is used.
Fred Drake <fdrake@acm.org>
parents: 7219
diff changeset
102
7768
8f177933c41f Use the new {methoddesc} and {memberdesc} environments as appropriate.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
103 \begin{methoddesc}{anchor_bgn}{href, name, type}
4381
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
104 This method is called at the start of an anchor region. The arguments
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
105 correspond to the attributes of the \code{<A>} tag with the same
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
106 names. The default implementation maintains a list of hyperlinks
10693
9e0402ee3812 Markup nits.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
107 (defined by the \code{HREF} attribute for \code{<A>} tags) within the
9e0402ee3812 Markup nits.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
108 document. The list of hyperlinks is available as the data attribute
9e0402ee3812 Markup nits.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
109 \member{anchorlist}.
7768
8f177933c41f Use the new {methoddesc} and {memberdesc} environments as appropriate.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
110 \end{methoddesc}
2453
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
111
7768
8f177933c41f Use the new {methoddesc} and {memberdesc} environments as appropriate.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
112 \begin{methoddesc}{anchor_end}{}
4381
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
113 This method is called at the end of an anchor region. The default
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
114 implementation adds a textual footnote marker using an index into the
7229
bc28a0ea6640 Removed all references to the \rfcindex{} macro; now only \rfc{} is used.
Fred Drake <fdrake@acm.org>
parents: 7219
diff changeset
115 list of hyperlinks created by \method{anchor_bgn()}.
7768
8f177933c41f Use the new {methoddesc} and {memberdesc} environments as appropriate.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
116 \end{methoddesc}
2453
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
117
7768
8f177933c41f Use the new {methoddesc} and {memberdesc} environments as appropriate.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
118 \begin{methoddesc}{handle_image}{source, alt\optional{, ismap\optional{, align\optional{, width\optional{, height}}}}}
4381
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
119 This method is called to handle images. The default implementation
7229
bc28a0ea6640 Removed all references to the \rfcindex{} macro; now only \rfc{} is used.
Fred Drake <fdrake@acm.org>
parents: 7219
diff changeset
120 simply passes the \var{alt} value to the \method{handle_data()}
4381
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
121 method.
7768
8f177933c41f Use the new {methoddesc} and {memberdesc} environments as appropriate.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
122 \end{methoddesc}
2453
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
123
7768
8f177933c41f Use the new {methoddesc} and {memberdesc} environments as appropriate.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
124 \begin{methoddesc}{save_bgn}{}
4381
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
125 Begins saving character data in a buffer instead of sending it to the
7229
bc28a0ea6640 Removed all references to the \rfcindex{} macro; now only \rfc{} is used.
Fred Drake <fdrake@acm.org>
parents: 7219
diff changeset
126 formatter object. Retrieve the stored data via \method{save_end()}.
bc28a0ea6640 Removed all references to the \rfcindex{} macro; now only \rfc{} is used.
Fred Drake <fdrake@acm.org>
parents: 7219
diff changeset
127 Use of the \method{save_bgn()} / \method{save_end()} pair may not be
4381
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
128 nested.
7768
8f177933c41f Use the new {methoddesc} and {memberdesc} environments as appropriate.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
129 \end{methoddesc}
2453
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
130
7768
8f177933c41f Use the new {methoddesc} and {memberdesc} environments as appropriate.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
131 \begin{methoddesc}{save_end}{}
4381
798732e69b3b (libhtmllib.tex): Revised documentation for HTML support.
Fred Drake <fdrake@acm.org>
parents: 2576
diff changeset
132 Ends buffering character data and returns all data saved since the
13625
fdfd1049f36e Rob W. W. Hooft's spelling fixes for the Library Reference. I hope
Thomas Wouters <thomas@python.org>
parents: 11028
diff changeset
133 preceding call to \method{save_bgn()}. If the \member{nofill} flag is
7229
bc28a0ea6640 Removed all references to the \rfcindex{} macro; now only \rfc{} is used.
Fred Drake <fdrake@acm.org>
parents: 7219
diff changeset
134 false, whitespace is collapsed to single spaces. A call to this
13625
fdfd1049f36e Rob W. W. Hooft's spelling fixes for the Library Reference. I hope
Thomas Wouters <thomas@python.org>
parents: 11028
diff changeset
135 method without a preceding call to \method{save_bgn()} will raise a
7229
bc28a0ea6640 Removed all references to the \rfcindex{} macro; now only \rfc{} is used.
Fred Drake <fdrake@acm.org>
parents: 7219
diff changeset
136 \exception{TypeError} exception.
7768
8f177933c41f Use the new {methoddesc} and {memberdesc} environments as appropriate.
Fred Drake <fdrake@acm.org>
parents: 7712
diff changeset
137 \end{methoddesc}
11028
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
138
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
139
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
140
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
141 \section{\module{htmlentitydefs} ---
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
142 Definitions of HTML general entities}
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
143
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
144 \declaremodule{standard}{htmlentitydefs}
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
145 \modulesynopsis{Definitions of HTML general entities.}
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
146 \sectionauthor{Fred L. Drake, Jr.}{fdrake@acm.org}
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
147
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
148 This module defines a single dictionary, \code{entitydefs}, which is
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
149 used by the \refmodule{htmllib} module to provide the
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
150 \member{entitydefs} member of the \class{HTMLParser} class. The
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
151 definition provided here contains all the entities defined by HTML 2.0
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
152 that can be handled using simple textual substitution in the Latin-1
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
153 character set (ISO-8859-1).
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
154
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
155
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
156 \begin{datadesc}{entitydefs}
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
157 A dictionary mapping HTML 2.0 entity definitions to their
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
158 replacement text in ISO Latin-1.
3819eb7c834b Added some "See also" references to htmllib docs.
Fred Drake <fdrake@acm.org>
parents: 10693
diff changeset
159 \end{datadesc}