Created on 2011-12-24 06:23 by Ramchandra Apte, last changed 2014-06-03 15:59 by terry.reedy..
Sorry, new window in "I suggest a new window" should be a new read-only editor window.
It could be implemented through a wrapper around help.
IDLE could have a configuration option whether to use the traditional help() or the new help() which opens a new window.
If you're on Linux, run this as your first command in IDLE:
import pydoc; pydoc.pager = lambda text: pydoc.tempfilepager(pydoc.plain(text), 'xterm -e less')
If Windows:
import pydoc; pydoc.pager = lambda text: pydoc.tempfilepager(pydoc.plain(text), 'notepad')
All help() output for objects will now display outside of IDLE.
The Squeezer extension does something similar for output that is longer than 30 lines.
It should be possible to create a custom pager for the subprocess which communicates with IDLE to display this text. RPCProxy could be used to accomplish this in conjunction with the textView module.
I should like it if a separate window were either automatic or a configuration option for help on modules and classes, which should cover 'long' output. The Windows workaround, which I will never remember, brings up an extraneous cmd.exe window in addition to notepad.
What about having idle open a web browser session with pydocs new browse option?
python3 -m pydoc -b
We've added input fields to the pages that take the same input as help() command does. It also links to the online help pages, and you can view the source code of the files directly in the browser. (Sometimes that's the best documentation you can get.)
I would like that to be a help() option, such as help(module, -b) or more verbosely, help(module, browser=True). This would be useful for the regular interactive interpreter as well.
I don't think adding a "browser" arg to help() is a good idea.
The original suggestion of having the help in a separate window and adding a checkbox in the options to (de)activate the feature sounds good to me (it could even allow to select between normal/new window/browser).
Attached is an initial diff for creating a separate pager window by using a textView widget. The recently applied patch in issue964437 allows this window to be non-modal, which can be useful for interactive development.
The diff contains code to allow the pager to work with and without a subprocess. The "pager" and "use_help_window" in PyShell.py provide the core functionality. The "use_help_window" presently is a placeholder for implementing Ezio's suggestion in msg160114.
Does anyone know why "import pydoc" is wrapped in a try/except block? I omitted that in "pager".
Bump.
The attached patch ("issue13659.patch") adds a configuration option for selecting the output of help() as being in the shell or in the pager. It is an enhancement against 3.4.
Another possibility involves adding a checkable menu item under "Options" or "Help" to enable/disable the help pager.
Please review.
Patch LGTM.