-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Include HTML docs with Windows installer instead of CHM #91242
Comments
CHM is getting too hard to handle (see e.g. bpo-47051 for the latest issue), so let's just bite the bullet and ship the HTML docs instead. |
Leaving this open and assigned to myself for a couple of days to deal with any other fallout. In particular, I wasn't able to test the (minor) changes to the publishing steps (e.g. GPG signing), so will have to wait for the next release to see what works/doesn't there. |
If you remove the .chm file from the Windows installer, I believe IDLE needs to be updated to look for the installed html files instead (see Lib/idlelib/editor.py). And does this mean we should no longer produce .chm files at all for 3.11+? If so, there is work to be done in the Doc section of the repo (Makefile, make.bat, README.rst tools/* all have references to .chm and .hhp files). I guess other than the references to chm files in the docs, this change would not otherwise affect the on-line docs building system. (Nosying Terry and Julien as subject experts.) |
Good call on IDLE, I didn't even think to check there (there is a registry key that points at the documentation if it was installed, which would be the best approach for IDLE to use). The makefiles don't urgently need to remove those references. If people still want to build it, they're welcome to [try]. It gives people with their own build processes a chance to adapt - we can remove it all later. |
For the registry key, reading the default value from key "HKCU\Software\Python\PythonCore\{sys.winver}\Help\Main Python Documentation" (or HKLM - no need to worry about the Wow6432Node bit here) and passing it to os.startfile() will work for all active releases. If the key is missing, so are the local docs, so falling back to the web docs is a fine option. |
The key is defined at https://github.com/python/cpython/blob/main/Tools/msi/doc/doc.wxs#L17 and is not set for a Store install at all. But we don't include the docs in that either - go straight to the web. |
Do you have any thoughts about distributing the docs in ePub format? |
At a minimum, though, Doc/tools/templates/download.html should be changed to remove the chm reference. |
If Windows includes a reader for all supported versions, and it's easy Most people are going to be fairly comfortable with their default |
Note that it's *much* easier to manufacture the docs in html format than it is in ePub format. |
In the IDLE Help menu, 'Python Docs', default hotkey 'F1', invokes '<<python-docs>>', which is handled by EditorWindow.help_docs. For Windows, line 599, is 'os.startfile(self.help_url)'. (Otherwise, webbrowser is used.) On Windows, help_url is os.path.join(sys.base_prefix, 'Doc','Python%s.chm' % _sphinx_version()) How do I use winreg to get the file name from |
This should work for you (luckily, this is about the simplest possible case): import sys
import winreg
def get_help():
KEY = rf"Software\Python\PythonCore\{sys.winver}\Help\Main Python Documentation"
try:
return winreg.QueryValue(winreg.HKEY_CURRENT_USER, KEY)
except FileNotFoundError:
pass
try:
return winreg.QueryValue(winreg.HKEY_LOCAL_MACHINE, KEY)
except FileNotFoundError:
pass
return f"https://docs.python.org/{sys.version_info.major}.{sys.version_info.minor}/" |
python#91242 replaced the Windows chm help file with a copy of the html docs. This PR replaces the IDLE code that fetches the Windows local help url passed to os.startfile.
pythonGH-91242 replaced the Windows chm help file with a copy of the html docs. This PR replaces the IDLE code that fetches the Windows local help url passed to os.startfile. Co-authored-by: Steve Dower (cherry picked from commit bdb2cf8) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
pythonGH-91242 replaced the Windows chm help file with a copy of the html docs. This PR replaces the IDLE code that fetches the Windows local help url passed to os.startfile. Co-authored-by: Steve Dower (cherry picked from commit bdb2cf8) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
GH-91242 replaced the Windows chm help file with a copy of the html docs. This PR replaces the IDLE code that fetches the Windows local help url passed to os.startfile. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Steve Dower Approved by Steve Dower, #95845 (review), 2nd subblock. (cherry picked from commit bdb2cf8)
CHM is totally removed? It is very good at search and fast navigating, rather than render all the documentation tree. |
People can still compile the CHM themselves - use |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: