3
f=, @ s d Z ddlmZ ddlmZmZmZmZ ddlm Z ddl
mZmZm
Z
mZ ddlmZmZ ddl
mZ ddlmZ G d d
d
eZG dd de
ZG d
d deZG dd deZdd Zdd ZedkrddlmZ edddd ddlm Z e e dS )a help.py: Implement the Idle help menu.
Contents are subject to revision at any time, without notice.
Help => About IDLE: diplay About Idle dialog
Help => IDLE Help: Display help.html with proper formatting.
Doc/library/idle.rst (Sphinx)=> Doc/build/html/library/idle.html
(help.copy_strip)=> Lib/idlelib/help.html
HelpParser - Parse help.html and render to tk Text.
HelpText - Display formatted help.html.
HelpFrame - Contain text, scrollbar, and table-of-contents.
(This will be needed for display in a future tabbed window.)
HelpWindow - Display HelpFrame in a standalone window.
copy_strip - Copy idle.html to help.html, rstripping each line.
show_idlehelp - Create HelpWindow. Called in EditorWindow.help_dialog.
)
HTMLParser)abspathdirnameisfilejoin)python_version)ToplevelFrameTextMenu)
Menubutton Scrollbar)font)idleConfc @ s: e Zd ZdZdd ZdddZdd Zd d
Zdd Zd
S )
HelpParsera~ Render help.html into a text widget.
The overridden handle_xyz methods handle a subset of html tags.
The supplied text should have the needed tag configurations.
The behavior for unsupported tags, such as table, is undefined.
If the tags generated by Sphinx change, this class, especially
the handle_starttag and handle_endtags methods, might have to also.
c C sZ t j| dd || _d| _d| _d| _d| _d| _d| _d| _ d| _
d| _g | _d| _
d S )NT)Zconvert_charrefs Fr )r __init__texttagschartagsshowhdrlinklevelprehprefix nested_dl
simplelisttocheader)selfr r 1/opt/alt/python36/lib64/python3.6/idlelib/help.pyr 3 s zHelpParser.__init__ c C s0 | j |7 _ | j dkrdndt| j | _d S )Nr r l)r strr )r amtr r r! indentB s zHelpParser.indentc C s d}x|D ]\}}|dkr
|}q
W d}|dkr@|dkr@d| _ n|dkrZ|dkrZd| _ n|dkrr|d krrd
}nv|dkr|dkrd| _n\|dkr|d
krd| _nB|dkrd| _n0|d#kr|jdd$krd}d| _nd| _| j n|dkr
| jdkrd| _n|dkr&| jr dnd}n|dkrH| js