Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we use the .ipynb notebooks in Binder? #190

Open
lesteve opened this issue Feb 5, 2021 · 4 comments
Open

Can we use the .ipynb notebooks in Binder? #190

lesteve opened this issue Feb 5, 2021 · 4 comments
Labels
infrastructure Infrastructure (CI, tools, etc ...) to be more productive when working on the MOOC

Comments

@lesteve
Copy link
Collaborator

lesteve commented Feb 5, 2021

The easiest way to set up Binder was to use the .py files (loaded as notebook on the fly with Jupytext). Basically the generated URL reuse the file it was generated from.

That means that the logic to keep nice-looking admonitions in https://github.com/INRIA/scikit-learn-mooc/blob/master/build_tools/convert-python-script-to-notebook.py is not applied. Probably not that high-priority as Binder is used as a fall-back solution.

  • is there a way to configure Binder to use the generated notebooks as URL?
  • do we want to do that? We update the generated notebooks from time to time so the Binder content would lag behind master a bit. I guess that's probably fine.
@lesteve lesteve added the infrastructure Infrastructure (CI, tools, etc ...) to be more productive when working on the MOOC label Mar 17, 2021
@GaelVaroquaux
Copy link
Collaborator

I'm going to teach a course, and I was looking at the simplest way to reuse materials from the MOOC, and I agree that, in the long run it would be very nice if the binder was working as well as possible. So, if anyone has extra energy and want to improve things, as suggested above, I'm clearly supportive.

@lesteve
Copy link
Collaborator Author

lesteve commented Feb 14, 2022

Tips from my own course:

@GaelVaroquaux
Copy link
Collaborator

GaelVaroquaux commented Feb 14, 2022 via email

@lesteve
Copy link
Collaborator Author

lesteve commented Feb 23, 2022

Actually I thought about a possible hack (if what we want is not easily doable within JupyterBook): rewrite the link target with some js in _static/sklearn_mooc.js. We can find the binder button with js:

var el = document.getElementsByClassName('binder-button')[0]

The URL is something like this:
https://mybinder.org/v2/gh/INRIA/scikit-learn-mooc/main?urlpath=tree/python_scripts/01_tabular_data_exploration.py

So we want to replace python_scripts -> notebooks and .py -> .ipynb and it should "just" work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Infrastructure (CI, tools, etc ...) to be more productive when working on the MOOC
Projects
None yet
Development

No branches or pull requests

2 participants