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: Idle: improve idle.html help viewer.
Type: enhancement Stage: resolved
Components: IDLE Versions: Python 3.8, Python 3.7, Python 3.6, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder: IDLE: Improve and document help doc viewer
View: 33396
Assigned To: terry.reedy Nosy List: cheryl.sabella, markroseman, python-dev, terry.reedy
Priority: normal Keywords: patch

Created on 2015-09-21 00:07 by terry.reedy, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
help-indent-fix.patch markroseman, 2015-09-24 15:19 review
top-of-window.diff terry.reedy, 2015-09-27 08:55 review
Pull Requests
URL Status Linked Edit
PR 6665 open cheryl.sabella, 2018-04-30 23:44
Messages (13)
msg251181 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-09-21 00:07
I just pushed the new viewer as part of #16893.  Possible improvements:

* Font size should initially reflect user's size choice.  Possibly change with control-mousewheel.  (Possible same for edit windows.)

* Make within-file links work.

* Make Find ^F work, even without menu entry.

* Possible immediate bug fixes.
msg251409 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-09-23 07:01
List indent glitch: In the command line section, after the box, idle.rst has 

If there are arguments:

#. If ``-``, ``-c``, or ``r`` is used, all arguments are placed in
   ``sys.argv[1:...]`` and ``sys.argv[0]`` is set to ``''``, ``'-c'``,
   or ``'-r'``.  No editor window is opened, even if that is the default
   set in the Options dialog.

Firefox shows this as (but does not allow copying of '1. ')

If there are arguments:

    1. If -, -c, or r is used, all arguments are placed in sys.argv[1:...] and sys.argv[0] is set to '', '-c', or '-r'. No editor window is opened, even if that is the default set in the Options dialog.

The help window shows this, for example, (but not copy indent) as

If there are arguments: 

  * If -, -c, or r is used, all arguments are placed in sys.argv[1:...] and sys.argv[0] is set to
'', '-c', or '-r'.  No editor window is opened, even if that is the default set in the Options dialog.

The point is not '1. ' versus '* ', this being the only place where idle.rst uses '#' for a list (and I changed this).  The problem is the dedent of the second line.  This only occurs if the second line starts with a font change.  If I narrow the window so it begins with 'to', the line is indented properly. Narrow further so it begins with 'sys', no ident. I am pretty sure I have not touched your indent code.  Any ideas on how to fix?  or a tk glitch?
msg251534 - (view) Author: Mark Roseman (markroseman) * Date: 2015-09-24 15:19
Have attached help-indent-fix.patch. Basically the parser is very fragile when it comes to combining tags, so the handling of the 'span .pre' was stomping on the indent tag. Separated out handling of character level tags (e.g. italic) from block level tags (e.g. lists, headings).
msg251547 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-09-24 21:33
New changeset 8b3dc527a62c by Terry Jan Reedy in branch '2.7':
Issue #25198: In Idle doc viewer, fix indent of fixed-pitch <pre> text
https://hg.python.org/cpython/rev/8b3dc527a62c

New changeset 1d0f4b94066b by Terry Jan Reedy in branch '3.4':
Issue #25198: In Idle doc viewer, fix indent of fixed-pitch <pre> text
https://hg.python.org/cpython/rev/1d0f4b94066b
msg251556 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-09-24 23:16
Fixed.  I added a light background as with Sphinx html. I am delighted with how well this is working so far.  I like the little always-there [TOC] button better than the browser sidebar.  Besides making it easy to verify the look of doc changes, I think it looks better. I like the appearance of the tk version, without the down arrow, a bit better than the ttk version with an arrow, but would switch, when possible, if there were functional reason (see below).

To improve the button: I want to add an activebackground (or foreground) so when moused over, the button is more obviously a live button to be pushed.  Any particular suggestion?  Is there a standard?  Or do I worry too much? Idle buttons don't change when moused over, but they have relief to convey 'push me'.

So that people can navigate without mouse, I tested adding takefocus=True to toc creation, takefocus=False to text, and toc.focus_set(). <space> (and <click>), <enter>, and <esc> work as expected. However the tk Menubutton (but not ttk version) seems to have a bug (at least here, ).  After <space>, it is left in a 'pressed' state, with a black outline, while the menu is displayed, and after.  (With <click> the outline and menu appear on button-press and the outline disappears on button-release, while the menu remains.) A click on the button is required to reset it and remove the outline.  Then either <space> or <click> work as before.  I tried an expanded command function to reset toc,
           def cmd(mark=tag):
                toc['state'] = 'disabled'
                toc['state'] = 'normal'
                text.see(mark)
but this does not work.  If this bug windows-only or general? Do you know of any other workaround to make the tk version work right?  Since click-to-reset is not obvious, and defeats keyboard-only use, I will not enable focus when click-reset is needed.
msg251571 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-09-25 04:07
Another minor glitch: in a browser, each press of up or down arrow, when there is no cursor (after clicking outside of an entry box like this one), moves text up or down.  (3 lines for me in FF, even though wheel click moved more) In an editor, each press moves the *cursor* up or down one line, and text only moves when the cursor is at the top or bottom of the window.  The read-only text has an invisible cursor, which one must invisibly move to top or bottom before anything happens.

Some of the code with #17535 might help, but not looking now.

Another enhancement: use user set Initial Window size.
msg251573 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-09-25 04:50
New changeset c1eccae07977 by Terry Jan Reedy in branch '2.7':
Issue #25198: Idle doc viewer now uses user width and height setting.
https://hg.python.org/cpython/rev/c1eccae07977

New changeset 1c119da20663 by Terry Jan Reedy in branch '3.4':
Issue #25198: Idle doc viewer now uses user width and height setting.
https://hg.python.org/cpython/rev/1c119da20663
msg251574 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-09-25 04:56
Had to adjust number of line by 3/4 because average 4/3 as high as in editor due to taller header lines and extra interline spacing.  Net result for me, using 12 pitch in editor also, is box size within 5%.
msg251690 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-09-27 08:40
New changeset 40bab637295d by Terry Jan Reedy in branch '2.7':
Issue #25198: When using the Idle dov TOC menu, put the section title at the
https://hg.python.org/cpython/rev/40bab637295d

New changeset 5b635a3ca3d5 by Terry Jan Reedy in branch '3.4':
Issue #25198: When using the Idle dov TOC menu, put the section title at the
https://hg.python.org/cpython/rev/5b635a3ca3d5
msg251692 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-09-27 08:55
By reading http://www.tcl.tk/man/tcl8.6/TkCmd/text.htm I discovered that Text.yview(index) puts the line with index at the top of the windows, given enough line below to fill the window.  This fixes another glitch.

Still left: the original 3 items (msg251181), navigating the text with up and down arrow (msg251571), and operating TOC button with keyboard (msg251556).
msg251715 - (view) Author: Mark Roseman (markroseman) * Date: 2015-09-27 18:59
Good catch about yview for text widgets!
msg315976 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2018-04-30 23:45
I've created PR6665 for the first bullet item.

* Font size should initially reflect user's size choice.  Possibly change with control-mousewheel.
msg315986 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-05-01 05:56
The files uploaded 2015-09-24 and 27 were merged later the same day.  The merge in between on 2015-09-25 was shorter and not uploaded separately.  I opened #33396 as an index issue for the other items and any new ones.  I open #33397 for font sizing and changed the title of PR6665.
History
Date User Action Args
2022-04-11 14:58:21adminsetgithub: 69385
2018-05-01 05:56:33terry.reedysetstatus: open -> closed
versions: + Python 3.7, Python 3.8, - Python 3.4, Python 3.5
superseder: IDLE: Improve and document help doc viewer
messages: + msg315986

resolution: fixed
stage: needs patch -> resolved
2018-04-30 23:45:57cheryl.sabellasetnosy: + cheryl.sabella

messages: + msg315976
stage: patch review -> needs patch
2018-04-30 23:44:36cheryl.sabellasetstage: needs patch -> patch review
pull_requests: + pull_request6359
2017-06-19 19:09:25terry.reedysetcomponents: + IDLE
2015-09-27 18:59:04markrosemansetmessages: + msg251715
2015-09-27 08:55:30terry.reedysetfiles: + top-of-window.diff

messages: + msg251692
2015-09-27 08:40:51python-devsetmessages: + msg251690
2015-09-25 04:56:23terry.reedysetmessages: + msg251574
2015-09-25 04:50:08python-devsetmessages: + msg251573
2015-09-25 04:07:25terry.reedysetmessages: + msg251571
2015-09-24 23:16:00terry.reedysetmessages: + msg251556
2015-09-24 21:33:15python-devsetnosy: + python-dev
messages: + msg251547
2015-09-24 15:19:21markrosemansetfiles: + help-indent-fix.patch
keywords: + patch
messages: + msg251534
2015-09-23 07:01:52terry.reedysetmessages: + msg251409
2015-09-21 00:07:47terry.reedycreate