mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Markup nits.
Make module references hyperlinks.
This commit is contained in:
parent
b7168c3a07
commit
4e28c593ad
2 changed files with 45 additions and 46 deletions
|
@ -1,7 +1,7 @@
|
|||
\section{\module{htmllib} ---
|
||||
A parser for HTML documents.}
|
||||
\declaremodule{standard}{htmllib}
|
||||
A parser for HTML documents}
|
||||
|
||||
\declaremodule{standard}{htmllib}
|
||||
\modulesynopsis{A parser for HTML documents.}
|
||||
|
||||
\index{HTML}
|
||||
|
@ -17,15 +17,13 @@ in string form via a method, and makes calls to methods of a
|
|||
other classes in order to add functionality, and allows most of its
|
||||
methods to be extended or overridden. In turn, this class is derived
|
||||
from and extends the \class{SGMLParser} class defined in module
|
||||
\module{sgmllib}\refstmodindex{sgmllib}. The \class{HTMLParser}
|
||||
\refmodule{sgmllib}\refstmodindex{sgmllib}. The \class{HTMLParser}
|
||||
implementation supports the HTML 2.0 language as described in
|
||||
\rfc{1866}. Two implementations of formatter objects are provided in
|
||||
the \module{formatter}\refstmodindex{formatter} module; refer to the
|
||||
the \refmodule{formatter}\refstmodindex{formatter} module; refer to the
|
||||
documentation for that module for information on the formatter
|
||||
interface.
|
||||
\index{SGML}
|
||||
\withsubitem{(in module sgmllib)}{\ttindex{SGMLParser}}
|
||||
\index{formatter}
|
||||
|
||||
The following is a summary of the interface defined by
|
||||
\class{sgmllib.SGMLParser}:
|
||||
|
@ -49,16 +47,16 @@ parser.close()
|
|||
|
||||
\item
|
||||
The interface to define semantics for HTML tags is very simple: derive
|
||||
a class and define methods called \code{start_\var{tag}()},
|
||||
\code{end_\var{tag}()}, or \code{do_\var{tag}()}. The parser will
|
||||
call these at appropriate moments: \code{start_\var{tag}} or
|
||||
\code{do_\var{tag}()} is called when an opening tag of the form
|
||||
\code{<\var{tag} ...>} is encountered; \code{end_\var{tag}()} is called
|
||||
a class and define methods called \method{start_\var{tag}()},
|
||||
\method{end_\var{tag}()}, or \method{do_\var{tag}()}. The parser will
|
||||
call these at appropriate moments: \method{start_\var{tag}} or
|
||||
\method{do_\var{tag}()} is called when an opening tag of the form
|
||||
\code{<\var{tag} ...>} is encountered; \method{end_\var{tag}()} is called
|
||||
when a closing tag of the form \code{<\var{tag}>} is encountered. If
|
||||
an opening tag requires a corresponding closing tag, like \code{<H1>}
|
||||
... \code{</H1>}, the class should define the \code{start_\var{tag}()}
|
||||
... \code{</H1>}, the class should define the \method{start_\var{tag}()}
|
||||
method; if a tag requires no closing tag, like \code{<P>}, the class
|
||||
should define the \code{do_\var{tag}()} method.
|
||||
should define the \method{do_\var{tag}()} method.
|
||||
|
||||
\end{itemize}
|
||||
|
||||
|
@ -90,8 +88,9 @@ affects the operation of \method{handle_data()} and \method{save_end()}.
|
|||
This method is called at the start of an anchor region. The arguments
|
||||
correspond to the attributes of the \code{<A>} tag with the same
|
||||
names. The default implementation maintains a list of hyperlinks
|
||||
(defined by the \code{href} attribute) within the document. The list
|
||||
of hyperlinks is available as the data attribute \code{anchorlist}.
|
||||
(defined by the \code{HREF} attribute for \code{<A>} tags) within the
|
||||
document. The list of hyperlinks is available as the data attribute
|
||||
\member{anchorlist}.
|
||||
\end{methoddesc}
|
||||
|
||||
\begin{methoddesc}{anchor_end}{}
|
||||
|
@ -115,7 +114,7 @@ nested.
|
|||
|
||||
\begin{methoddesc}{save_end}{}
|
||||
Ends buffering character data and returns all data saved since the
|
||||
preceeding call to \method{save_bgn()}. If the \code{nofill} flag is
|
||||
preceeding call to \method{save_bgn()}. If the \member{nofill} flag is
|
||||
false, whitespace is collapsed to single spaces. A call to this
|
||||
method without a preceeding call to \method{save_bgn()} will raise a
|
||||
\exception{TypeError} exception.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue