Displaying HTML/Markdown content from bash_kernel

hi all,

I’m using JupyterLab with bash_kernel and I would like to be able to output HTML/Markdown/Images from there, things one usually does with IPython.display.

Is there some form of escape sequence for that ? Or maybe another route ?

many thanks!

ps.: I’m new here, apologies in advance if I’m posting on the wrong category/tags – I browsed around and didn’t anywhere more appropriate.

1 Like

It looks like the only thing it listens to is images by filename.

bash_kernel doesn’t get a lot of respect, despite being quite cool. It would be a lovely PR to think of a non-conflicting, shell-appropriate way to emit such things. Some interesting ways:

  • inaccurate shebangs as magics, e.g. #%%html
  • writing to a specific virtual files, e.g. echo '<the html>' | some-wrapper.sh
  • emitting some special strings, e.g. display::text/html::<the html>
3 Likes

Thanks @bollwyvl! Indeed bash_kernel is pretty versatile: I’m using it to develop in Go actually (compiling and running is so fast that it’s very interactive).

So after digging into its code I noticed that what I wanted (some escape sequence in Jupyter) doesn’t exist, and only the kernels can implement it.

So I added support for HTML to bash_kernel, in this pull request. I used the same trick it already used for images (see augmented docs). I also refactored it some to make it more generic, and easier to add new content types.