guysv / ilua

Portable Lua kernel for Jupyter
GNU General Public License v2.0
115 stars 11 forks source link

RFE: A way to pass additional help_links from kernel.json #15

Closed hroncok closed 2 years ago

hroncok commented 3 years ago

I'd like to create a kernel.json for RPM Lua. So far so good:

{
    "argv":
    [
        "python",
        "-m",
        "ilua.app",
        "-c",
        "{connection_file}",
        "-i",
        "rpmlua"
    ],
    "display_name": "RPM Lua",
    "language": "lua",
    "interrupt_mode": "message",
}

Next, I wanted to include a link to https://rpm.org/user_doc/lua.html in help_links. However, AFAIK this is not possible from the json kernel configuration.

I've seen:

https://github.com/guysv/ilua/blob/9f621dc9609869a224853f4e750851a597c0b97a/ilua/kernel.py#L55-L58

I wonder whether it would make sense to extend the list based on environment variables? E.g. I'd do something like this:

{
    ...
    "env": {
        "ILUA_HELP_LINKS": "Lua in RPM: https://rpm.org/user_doc/lua.html"
    }
}

And the code would add the links to the list. The devil is in the details, such as defining correct separators etc. However, before I do a Pull Request, would something like this be accepted?

guysv commented 3 years ago

sorry for the late answer, cool idea! Passing extra data over env-vars seems OK to me. The docs states it's pretty easy to do too https://jupyter-client.readthedocs.io/en/stable/kernels.html#kernel-specs

Feel free to send the PR! I'd happily accept it!

hroncok commented 2 years ago

BTW I have not forgotten this entirely, but it is very low on my priority list, sorry about that.

hroncok commented 2 years ago

Finally got to this. https://github.com/guysv/ilua/pull/23