ines / juniper

🍇 Edit and execute code snippets in the browser using Jupyter kernels
https://ines.github.io/juniper/
MIT License
224 stars 36 forks source link

use for other languages than python #3

Closed amn41 closed 5 years ago

amn41 commented 5 years ago

thanks for the awesome library! I'm now trying to use it for a kernel in another language.

from the options I thought the parameter would be defaultLang, but from looking at the code it seems like I should pass language in the options instead:

e.g. in console

j = new Juniper({ repo: 'amn41/bash_plus_kernel/', branch: 'master', kernelType: 'bash', language: 'shell'})
j.defaultLang
"shell"

if I run this shell on binder, I am able to execute bash commands. However, when I try to do so via juniper, I get:

  File "<ipython-input-1-8619f869794b>", line 1
    python hello.py &
               ^
SyntaxError: invalid syntax

so it still seems to be creating a python kernel. I did some digging into the jupyter/services code but couldn't find any hints there.

One other hint is that if I visit the url that juniper logs to the console Starting WebSocket: wss://hub.mybinder.org/user/amn41-bash_plus_... I see a JSON which contains name: python3