summaryrefslogtreecommitdiff
path: root/Doc
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2008-05-20 06:08:38 +0000
committerFred Drake <fdrake@acm.org>2008-05-20 06:08:38 +0000
commitd995e1150cab57ed7c885d4b7dd943495022936b (patch)
tree5daaf7592952fd99af8699b93c1d87d0084a9c1d /Doc
parent1f60af87f5657800e333090fb9b204f54163254e (diff)
downloadcpython-git-d995e1150cab57ed7c885d4b7dd943495022936b.tar.gz
revert creation of the html.entities and html.parser modules
(http://bugs.python.org/issue2882)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/html.entities.rst42
-rw-r--r--Doc/library/htmllib.rst45
-rw-r--r--Doc/library/htmlparser.rst (renamed from Doc/library/html.parser.rst)19
-rw-r--r--Doc/library/markup.rst3
4 files changed, 52 insertions, 57 deletions
diff --git a/Doc/library/html.entities.rst b/Doc/library/html.entities.rst
deleted file mode 100644
index 601e181c44..0000000000
--- a/Doc/library/html.entities.rst
+++ /dev/null
@@ -1,42 +0,0 @@
-:mod:`html.entities` --- Definitions of HTML general entities
-=============================================================
-
-.. module:: htmlentitydefs
- :synopsis: Old name for the html.entities module.
-
-.. module:: html.entities
- :synopsis: Definitions of HTML general entities.
-.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
-
-.. note::
- The :mod:`htmlentitydefs` module has been renamed to :mod:`html.entities` in
- Python 3.0. It is importable under both names in Python 2.6 and the rest of
- the 2.x series.
-
-
-This module defines three dictionaries, ``name2codepoint``, ``codepoint2name``,
-and ``entitydefs``. ``entitydefs`` is used by the :mod:`htmllib` module to
-provide the :attr:`entitydefs` member of the :class:`HTMLParser` class. The
-definition provided here contains all the entities defined by XHTML 1.0 that
-can be handled using simple textual substitution in the Latin-1 character set
-(ISO-8859-1).
-
-
-.. data:: entitydefs
-
- A dictionary mapping XHTML 1.0 entity definitions to their replacement text in
- ISO Latin-1.
-
-
-.. data:: name2codepoint
-
- A dictionary that maps HTML entity names to the Unicode codepoints.
-
- .. versionadded:: 2.3
-
-
-.. data:: codepoint2name
-
- A dictionary that maps Unicode codepoints to HTML entity names.
-
- .. versionadded:: 2.3
diff --git a/Doc/library/htmllib.rst b/Doc/library/htmllib.rst
index 953a4e41a2..16c1b3586c 100644
--- a/Doc/library/htmllib.rst
+++ b/Doc/library/htmllib.rst
@@ -77,12 +77,12 @@ The module defines a parser class and an exception:
Interface definition for transforming an abstract flow of formatting events into
specific output events on writer objects.
- Module :mod:`html.parser`
+ Module :mod:`HTMLParser`
Alternate HTML parser that offers a slightly lower-level view of the input, but
is designed to work with XHTML, and does not implement some of the SGML syntax
not used in "HTML as deployed" and which isn't legal for XHTML.
- Module :mod:`html.entities`
+ Module :mod:`htmlentitydefs`
Definition of replacement text for XHTML 1.0 entities.
Module :mod:`sgmllib`
@@ -147,3 +147,44 @@ additional methods and instance variables for use within tag methods.
call to :meth:`save_bgn`. If the :attr:`nofill` flag is false, whitespace is
collapsed to single spaces. A call to this method without a preceding call to
:meth:`save_bgn` will raise a :exc:`TypeError` exception.
+
+
+:mod:`htmlentitydefs` --- Definitions of HTML general entities
+==============================================================
+
+.. module:: htmlentitydefs
+ :synopsis: Definitions of HTML general entities.
+.. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
+
+.. note::
+ The :mod:`htmlentitydefs` module has been renamed to :mod:`html.entities` in
+ Python 3.0.
+
+
+This module defines three dictionaries, ``name2codepoint``, ``codepoint2name``,
+and ``entitydefs``. ``entitydefs`` is used by the :mod:`htmllib` module to
+provide the :attr:`entitydefs` member of the :class:`HTMLParser` class. The
+definition provided here contains all the entities defined by XHTML 1.0 that
+can be handled using simple textual substitution in the Latin-1 character set
+(ISO-8859-1).
+
+
+.. data:: entitydefs
+
+ A dictionary mapping XHTML 1.0 entity definitions to their replacement text in
+ ISO Latin-1.
+
+
+.. data:: name2codepoint
+
+ A dictionary that maps HTML entity names to the Unicode codepoints.
+
+ .. versionadded:: 2.3
+
+
+.. data:: codepoint2name
+
+ A dictionary that maps Unicode codepoints to HTML entity names.
+
+ .. versionadded:: 2.3
+
diff --git a/Doc/library/html.parser.rst b/Doc/library/htmlparser.rst
index 5fa5a70a6b..3019eb4699 100644
--- a/Doc/library/html.parser.rst
+++ b/Doc/library/htmlparser.rst
@@ -1,16 +1,13 @@
-:mod:`html.parser` --- Simple HTML and XHTML parser
-===================================================
-.. module:: HTMLParser
- :synopsis: Old name for the html.parser module.
+:mod:`HTMLParser` --- Simple HTML and XHTML parser
+==================================================
-.. module:: html.parser
+.. module:: HTMLParser
:synopsis: A simple parser that can handle HTML and XHTML.
.. note::
- The :mod:`HTMLParser` module has been renamed to :mod:`html.parser` in Python
- 3.0. It is importable under both names in Python 2.6 and the rest of the 2.x
- series.
+ The :mod:`HTMLParser` module has been renamed to
+ :mod:`html.parser` in Python 3.0.
.. versionadded:: 2.2
@@ -99,8 +96,8 @@ An exception is defined as well:
``handle_starttag('a', [('href', 'http://www.cwi.nl/')])``.
.. versionchanged:: 2.6
- All entity references from :mod:`html.entities` are now replaced in the
- attribute values.
+ All entity references from :mod:`htmlentitydefs` are now replaced in the attribute
+ values.
.. method:: HTMLParser.handle_startendtag(tag, attrs)
@@ -178,7 +175,7 @@ Example HTML Parser Application
As a basic example, below is a very basic HTML parser that uses the
:class:`HTMLParser` class to print out tags as they are encountered::
- from html.parser import HTMLParser
+ from HTMLParser import HTMLParser
class MyHTMLParser(HTMLParser):
diff --git a/Doc/library/markup.rst b/Doc/library/markup.rst
index e08f9531c4..dd0dd8f08f 100644
--- a/Doc/library/markup.rst
+++ b/Doc/library/markup.rst
@@ -23,8 +23,7 @@ definition of the Python bindings for the DOM and SAX interfaces.
.. toctree::
- html.parser.rst
- html.entities.rst
+ htmlparser.rst
sgmllib.rst
htmllib.rst
pyexpat.rst