Skip to content

IDLE: Only copy the text section of idle.html to idlelib/help.html #129873

Closed
@terryjreedy

Description

@terryjreedy

Parsing help.html to display the IDLE doc requires ignoring unneeded material both before and after the text section. It makes more sense to never copy this material into the file.

  1. In help.copystrip(), copy and strip only the IDLE text section of idle.html to idlelib/help.html. This includes the lines <section id="idle"> to the matching </section> (plus a couple of blank lines). The result is reduced from 1194 to 805 lines. This will remove irrelevant lines from help.html diffs, making them easier to check. It may speedup copystrip, though this does not matter.
  2. In help.HelpParser.handle_starttag, remove the code to skip the html before and after this section and set self.show on and off again. Edit all other code involving self.show. Proccessing only the needed html with less code will be faster. The simpler code will be a bit easier to understand and maintain.
  3. Include a reduced help.html in the PR.
  4. Near the top of Doc/library/idle.rst, add a comment (reminder) about running copystrip after editing.

Linked PRs

Metadata

Metadata

Assignees

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions