Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
terryjreedy opened this issue Feb 9, 2025 · 0 comments
Closed

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

terryjreedy opened this issue Feb 9, 2025 · 0 comments
Assignees

Comments

@terryjreedy
Copy link
Member

terryjreedy commented Feb 9, 2025

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

@terryjreedy terryjreedy self-assigned this Feb 9, 2025
terryjreedy added a commit that referenced this issue Feb 9, 2025
In `help.copy_strip`, only copy the text `<section>`.  In `help.HelpParser.handle_starttag` and elsewhere, remove code to skip the no longer present html.  Add a reminder at the top of idle.rst to run copy_strip after changes.
---------

Co-authored-by: Terry Jan Reedy <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 9, 2025
…onGH-129859)

In `help.copy_strip`, only copy the text `<section>`.  In `help.HelpParser.handle_starttag` and elsewhere, remove code to skip the no longer present html.  Add a reminder at the top of idle.rst to run copy_strip after changes.
---------

(cherry picked from commit 6fbf15f)

Co-authored-by: Stan Ulbrych <[email protected]>
Co-authored-by: Terry Jan Reedy <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 9, 2025
…onGH-129859)

In `help.copy_strip`, only copy the text `<section>`.  In `help.HelpParser.handle_starttag` and elsewhere, remove code to skip the no longer present html.  Add a reminder at the top of idle.rst to run copy_strip after changes.
---------

(cherry picked from commit 6fbf15f)

Co-authored-by: Stan Ulbrych <[email protected]>
Co-authored-by: Terry Jan Reedy <[email protected]>
terryjreedy added a commit that referenced this issue Feb 9, 2025
…129859) (#129884)

gh-129873: IDLE: Improve help.py's method of parsing HTML (GH-129859)

In `help.copy_strip`, only copy the text `<section>`.  In `help.HelpParser.handle_starttag` and elsewhere, remove code to skip the no longer present html.  Add a reminder at the top of idle.rst to run copy_strip after changes.
---------

(cherry picked from commit 6fbf15f)

Co-authored-by: Stan Ulbrych <[email protected]>
Co-authored-by: Terry Jan Reedy <[email protected]>
terryjreedy added a commit that referenced this issue Feb 9, 2025
…129859) (#129885)

gh-129873: IDLE: Improve help.py's method of parsing HTML (GH-129859)

In `help.copy_strip`, only copy the text `<section>`.  In `help.HelpParser.handle_starttag` and elsewhere, remove code to skip the no longer present html.  Add a reminder at the top of idle.rst to run copy_strip after changes.
---------

(cherry picked from commit 6fbf15f)

Co-authored-by: Stan Ulbrych <[email protected]>
Co-authored-by: Terry Jan Reedy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

1 participant