From 52fd6616235412d4a49ef28c1046bd133b30bc90 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Tue, 3 Sep 2019 14:09:57 -0700 Subject: [PATCH] bpo-38022: IDLE: upgrade help.html to sphinx 2.x HTML5 output (GH-15664) The HTML5 output from Sphinx 2.x adds '
' tags within list elements. Using a new prevtag attribute, ignore these instead of emitting unwanted '\n\n'. Also stop looking for 'first' classes on tags (no longer present) and fix the bug of double-spacing instead of single spacing after
blocks. (cherry picked from commit 580bdb0ece681537eadb360f0c796123ead7a559) Co-authored-by: Tal Einat--- Lib/idlelib/help.html | 386 ++++++++++++++++++++++++------------------ Lib/idlelib/help.py | 10 +- 2 files changed, 229 insertions(+), 167 deletions(-) diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index 91e66a4b9117b1..0754f2453baf66 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -1,11 +1,9 @@ - + - - + IDLE — Python 3.9.0a0 documentation @@ -108,17 +106,17 @@Navigation
IDLE is Python’s Integrated Development and Learning Environment.
IDLE has the following features:
-
@@ -357,32 +421,26 @@- coded in 100% pure Python, using the
-tkinter
GUI toolkit- cross-platform: works mostly the same on Windows, Unix, and macOS
-- Python shell window (interactive interpreter) with colorizing -of code input, output, and error messages
-- multi-window text editor with multiple undo, Python colorizing, -smart indent, call tips, auto completion, and other features
-- search within any window, replace within editor windows, and search -through multiple files (grep)
-- debugger with persistent breakpoints, stepping, and viewing -of global and local namespaces
-- configuration, browsers, and other dialogs
+- +
coded in 100% pure Python, using the
tkinter
GUI toolkit- +
cross-platform: works mostly the same on Windows, Unix, and macOS
- +
Python shell window (interactive interpreter) with colorizing +of code input, output, and error messages
- +
multi-window text editor with multiple undo, Python colorizing, +smart indent, call tips, auto completion, and other features
- +
search within any window, replace within editor windows, and search +through multiple files (grep)
- +
debugger with persistent breakpoints, stepping, and viewing +of global and local namespaces
configuration, browsers, and other dialogs
Key bindingsControl key on Windows and Unix and the Command key on macOS.
-
@@ -545,12 +601,12 @@- -
Backspace deletes to the left; Del deletes to the right
-- -
C-Backspace delete word left; C-Del delete word to the right
-- -
Arrow keys and Page Up/Page Down to move around
-- -
C-LeftArrow and C-RightArrow moves by words
-- -
Home/End go to begin/end of line
-- -
C-Home/C-End go to begin/end of file
-Some useful Emacs bindings are inherited from Tcl/Tk:
+- +
Backspace deletes to the left; Del deletes to the right
- +
C-Backspace delete word left; C-Del delete word to the right
- +
Arrow keys and Page Up/Page Down to move around
- +
C-LeftArrow and C-RightArrow moves by words
- +
Home/End go to begin/end of line
- +
C-Home/C-End go to begin/end of file
- @@ -485,17 +543,15 @@
Some useful Emacs bindings are inherited from Tcl/Tk:
-
- C-a beginning of line
-- C-e end of line
-- C-k kill line (but doesn’t put it in clipboard)
-- C-l center window around the insertion point
-- C-b go backward one character without deleting (usually you can -also use the cursor key for this)
-- C-f go forward one character without deleting (usually you can -also use the cursor key for this)
-- C-p go up one line (usually you can also use the cursor key for -this)
-- C-d delete next character
+- +
C-a beginning of line
- +
C-e end of line
- +
C-k kill line (but doesn’t put it in clipboard)
- +
C-l center window around the insertion point
- +
C-b go backward one character without deleting (usually you can +also use the cursor key for this)
- +
C-f go forward one character without deleting (usually you can +also use the cursor key for this)
- +
C-p go up one line (usually you can also use the cursor key for +this)
C-d delete next character
Python Shell windowC-c interrupts executing command - -
- -
C-d sends end-of-file; closes window if typed at a
->>>
promptAlt-/ (Expand word) is also useful to reduce typing
+- +
C-c interrupts executing command
- +
C-d sends end-of-file; closes window if typed at a
>>>
promptAlt-/ (Expand word) is also useful to reduce typing
Command history
-
- Alt-p retrieves previous command matching what you have typed. On -macOS use C-p.
-- Alt-n retrieves next. On macOS use C-n.
-- Return while on any previous command retrieves that command
+- +
Alt-p retrieves previous command matching what you have typed. On +macOS use C-p.
- +
Alt-n retrieves next. On macOS use C-n.
Return while on any previous command retrieves that command
Command line usage -
If -
,-c
, orr
is used, all arguments are placed in +- If
-
,-c
, orr
is used, all arguments are placed insys.argv[1:...]
andsys.argv[0]
is set to''
,'-c'
, or'-r'
. No editor window is opened, even if that is the default -set in the Options dialog.Otherwise, arguments are files opened for editing and - +set in the Options dialog. +sys.argv
reflects the arguments passed to IDLE itself.Otherwise, arguments are files opened for editing and +
sys.argv
reflects the arguments passed to IDLE itself.@@ -903,11 +959,11 @@diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py index e19d3615016f2f..ba2c6ec554812b 100644 --- a/Lib/idlelib/help.py +++ b/Lib/idlelib/help.py @@ -62,6 +62,7 @@ def __init__(self, text): self.simplelist = False # simple list (no double spacing) self.toc = [] # pair headers with text indexes for toc self.header = '' # text within header tags for toc + self.prevtag = None # info about previous tag (was opener, tag) def indent(self, amt=1): self.level += amt @@ -78,8 +79,11 @@ def handle_starttag(self, tag, attrs): self.show = True # start of main content elif tag == 'div' and class_ == 'sphinxsidebar': self.show = False # end of main content - elif tag == 'p' and class_ != 'first': - s = '\n\n' + elif tag == 'p' and self.prevtag and not self.prevtag[0]: + # begin a new block forNavigation
- Last updated on Aug 04, 2019. + Last updated on Sep 01, 2019. Found a bug?
- Created using Sphinx 2.1.1. + Created using Sphinx 2.1.2.tags after a closed tag + # avoid extra lines, e.g. after
tags + lastline = self.text.get('end-1c linestart', 'end-1c') + s = '\n\n' if lastline and not lastline.isspace() else '\n' elif tag == 'span' and class_ == 'pre': self.chartags = 'pre' elif tag == 'span' and class_ == 'versionmodified': @@ -120,6 +124,7 @@ def handle_starttag(self, tag, attrs): self.tags = tag if self.show: self.text.insert('end', s, (self.tags, self.chartags)) + self.prevtag = (True, tag) def handle_endtag(self, tag): "Handle endtags in help.html." @@ -139,6 +144,7 @@ def handle_endtag(self, tag): self.tags = '' elif tag in ['ul', 'dd', 'ol']: self.indent(amt=-1) + self.prevtag = (False, tag) def handle_data(self, data): "Handle date segments in help.html."