Language mapping in Hydrogen



How can I map one Jupyter kernel to several Atom languages when using Hydrogen? Specifically I’d like to map both rmarkdown (I’m using “GitHub Markdown” here) and “R” to the Jupyter R kernel. Thanks!



It looks like kernels are entirely determined by the grammar you have active. So you’d have to change the grammar.


I’ve just started using Hydrogen, and it seems to have this language mapping ability built in now. I guess it didn’t have it a year ago.

I’m having difficulty setting up a mapping. Could someone explain what I’m meant to put into the Language Mappings setting box? What is the “kernel language name” and what is the “Atom’s grammar name”?

I’m trying to use Hydrogen with Fortran using the language-fortran package for Atom and the jupyter_fortran_kernel package for Jupyter.

The grammar I’m using is called “Fortran - Free Form” and the scope says

The JSON spec for the kernel is:

"fortran_spec": {
      "resource_dir": "C:\\ProgramData\\jupyter\\kernels\\fortran_spec",
      "spec": {
        "argv": [
        "env": {},
        "display_name": "Fortran",
        "language": "Fortran"

I’ve tried all the combinations I can think of for “kernel language name” and “Atom’s grammar name” but I can’t get Hydrogen to recognise that my file is a Fortran file. :confused:

Should it be something like this:

{ "Fortran": "Fortran - Free Form" }

or maybe:

{ "fortran_spec": "" }

Neither of those seem to work for me.


I thought it might help to add some screenshots:

This is the grammar I’m using:

This is the list of Jupyter kernels found by Hydrogen:

This is what I’ve tried in the language mapping box:

And this is the error I get:


The string that most resembles a kernel name to me would be "jupyter_fortran_kernel", so I would suggest you try { "jupyter_fortran_kernel": "" }.


It turns out the problem was due to case changes—the code only looks for lower case matches for some reason.

This didn’t work:

{ “Fortran": "Fortran - Free Form" }

This did work:

{ “fortran”: "fortran - free form" }