This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Improve HTMLParser doc
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ezio.melotti Nosy List: eli.bendersky, eric.araujo, ezio.melotti, python-dev, terry.reedy
Priority: normal Keywords: patch

Created on 2012-02-15 13:59 by ezio.melotti, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue14020.diff ezio.melotti, 2012-02-15 13:59 Patch against 2.7
Messages (7)
msg153401 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-02-15 13:59
Attached patch reworks a bit the HTMLParser doc:
 - moved the basic example on the top and showed the output;
 - added a more complete parser with other examples;
 - fixed some factual errors;
 - added additional information for some methods;
 - added a couple of headers to divide the sections;
 - rephrased the text a bit to be more coherent and clear;
 - fixed a few links, typos, and terms;

I think the note about IE condcoms could be removed by the handle_comment doc, since it's already in the examples at the bottom.  A note in handle_data about the behavior with buffered input might be added in addition to the example at the bottom.
msg153406 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-02-15 15:55
Didn’t review in detail but the plan LGTM.

In a subsequent commit, you could update the markup to use nested class/method directives.
msg153489 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-02-16 17:41
Do you remember how to do it?
msg153563 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-02-17 16:29
It’s all in the Documenting Python doc.

.. class:: HTMLParser()

   Blah blah.

   .. method:: feed(data)

      Do X and Y.

   The following attributes are supported:

   .. attribute:: pos

      etc.
msg153568 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-02-17 16:44
Yes, but there's a section with the example in the middle now, so that doesn't work.  I was thinking about a way to tell sphinx "these are methods of the Foo class", without having them directly indented under the 'class' directive.
msg153577 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-02-17 17:19
Just indent the example, or move it below!
msg153611 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-02-18 00:03
New changeset 7052eb923fb8 by Ezio Melotti in branch '2.7':
#14020: improve HTMLParser documentation.
http://hg.python.org/cpython/rev/7052eb923fb8

New changeset 569566cbfd13 by Ezio Melotti in branch '3.2':
#14020: improve HTMLParser documentation.
http://hg.python.org/cpython/rev/569566cbfd13

New changeset 1850f45f6169 by Ezio Melotti in branch 'default':
#14020: merge with 3.2.
http://hg.python.org/cpython/rev/1850f45f6169
History
Date User Action Args
2022-04-11 14:57:26adminsetgithub: 58228
2012-02-18 00:04:13ezio.melottisetstatus: open -> closed
resolution: fixed
stage: commit review -> resolved
2012-02-18 00:03:51python-devsetnosy: + python-dev
messages: + msg153611
2012-02-17 17:19:52eric.araujosetmessages: + msg153577
2012-02-17 16:44:57ezio.melottisetmessages: + msg153568
2012-02-17 16:29:17eric.araujosetmessages: + msg153563
2012-02-16 17:41:50ezio.melottisetmessages: + msg153489
2012-02-15 15:55:44eric.araujosetmessages: + msg153406
2012-02-15 13:59:31ezio.melotticreate