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.
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.
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.