ines / course-starter-python

👩‍🏫🐍 Starter repo for building interactive Python courses
https://course-starter-python.netlify.com
MIT License
504 stars 118 forks source link

Resuse binder session across snippets #13

Open NixBiks opened 5 years ago

NixBiks commented 5 years ago

Is it possible to use the same binder session for multiple snippets? For some exercises I want to continue on previous solutions.

ines commented 5 years ago

Yes, this is the isolateCells setting here, which is true by default (new session for each cell, i.e. code block):

https://github.com/ines/course-starter-python/blob/57d8b1ac80caddcdb921e6794b4f6666344cc48e/src/components/juniper.js#L23

Out-of-the-box, this is a global setting, though, so you have to decide if you want isolated cells for the whole course, or not. It might be possible to just add this as an attribute to <codeblock>, which passes it down to the Juniper component... but I'm not sure, it might have unintended side-effects.

NixBiks commented 5 years ago

Cool but it doesn't seem to work?

I just did a = 2 in one session and then a was not recognized in another window.

I get Launching Docker container on mybinder.org... each time I run code in a new codeblock which takes ~20 sec. No chance to have it faster?

hfboyce commented 4 years ago

Sorry @ines, I also tried this changing isolateCells: true in src/components/juniper.js and I am still not having follow up cells a retaining the variables in the previous cell's environment. Is there anywhere I should look to debug this? I think this feature could be really useful especially for importing modules and data.