jupyter-book / thebe

Turn static HTML pages into live documents with Jupyter kernels.
https://thebe.readthedocs.io
BSD 3-Clause "New" or "Revised" License
393 stars 68 forks source link

Multiple kernel support #79

Open vishwesh5 opened 6 years ago

vishwesh5 commented 6 years ago

Hi!

I am trying to display codes in two or more different programming languages on the same webpage. Is it possible to use multiple kernels in thebelab?

Thanks

nthiery commented 6 years ago

I am trying to display codes in two or more different programming languages on the same webpage. Is it possible to use multiple kernels in thebelab?

At this stage, this is not supported out of the box: all cells are connected to the same kernel (see https://github.com/minrk/thebelab/blob/master/src/thebelab.js#L426). That being said, the code is relatively short, and it sounds like it could be adapted to support several kernels. This would be a nice contribution :-) Of course it would take extending the syntax for configuring kernels, etc.

But @minrk will know better!

vishwesh5 commented 6 years ago

Thanks for the reply @nthiery ! I will wait for @minrk's reply. :smiley: Meanwhile, I think only option is to create separate webpage for the separate programming languages.

vishwesh5 commented 6 years ago

One similar issue was posted on thebe github repo. But even there it's one kernel per page :(

mathieuboudreau commented 5 years ago

This can be done with the ScriptOfScripts kernel. I got it running with Thebelab in a demo Jupyter Book (Octave/Matlab + Python cells, data being transferred between them) by simply switching out the "sos" tags in the markdown that were generated by "python" manually (this might be a Jupyter Book-specific step I think).

Live demo: https://mathieuboudreau.github.io/introML-book/01/mvp_sos.html Repo (contains Dockerfile with all settings for SoS): https://github.com/mathieuboudreau/introML-book

bionicles commented 5 years ago

@mathieuboudreau links down !