Search code examples
pythonpython-idle

Linking offline documentation to IDLE - Linux


With internet access, < F1 > on IDLE works fine on Linux. With no internet access of course it does not work. I have downloaded the Python doc as html, but can't get IDLE to refer to it directly.

There is a dialog under "IDLE Preferences" called "Additional Help Sources", but this only enables the user to specify single files for single subjects, not the whole directory structure. I can enter a URL, but I am unclear as to what I should enter as the "Menu Item".

I should add that adding the URL to the local directory to my browser enables me to look at the offline doc, it is just the link to IDLE I am missing.

I found reference to a PYTHONDOCS environment variable, but this does not appear to work on Linux, it seems it is specific to Windows.


Solution

  • You almost did all settings you need to refer to local documentation via menu item. Let's look more precisely of what can be done:

    1. Download documentaion for your Python version as zipped html.
    2. Unpack that archive to you desired directory, e.g /home/username/python-docs.
    3. Go to Idle: Options -> Configure Idle... -> General -> Additional help sources -> Add.
    4. Enter label for the "Menu item" field (it will be a label of a new menu item that will appear in IDLE's Help menu), e.g. "local docs".
    5. Press "Browse" button and choose path to "index.html" in unzipped help sources.
    6. Move to Help -> local docs, it will open your local version of Python documentation.

    UPDATE:

    I've created a ticket on Python issue tracker that requests enhancement of standard IDLE keys configuration so it could be possible to add key bindings for custom added addiotional help sources menu items.