-
Notifications
You must be signed in to change notification settings - Fork 2
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
Implement a way to open a libretexts page as a jupyter notebook on the LIbreTexts jupyterhub #82
Comments
There's a way we can basically do this using nbgitpuller. You can simply add nbgitpuller link anywhere on the page, and then when clicked on, it redirects the user to our jupyter.libretexts.org and then they choose a Jupyter Environment to spawn and it will contain the files we want them to be able to run. The problems are that 1. Users need to have an account with us 2. They have to manually choose an environment (it doesn't matter which) so it isn't a smooth process of "click link then immediatly open a JupyterLab hosted by us" and 3. we need to setup a github repo in order to do this. I've added this type of link to our sandbox on the Chem LibreText library if you want to test. Another way is to use our binder URL, but I don't see a way other than just visiting the binder page, clicking run, and then launching the notebook we want them to run. Not sure if we can prepopulate the repo field with the one we want them to build anyways. We'd have to discuss other ways to do it if you want a more smooth and continuous process. |
But doesn't the libretexts page have to be converted to ipynb somewhere in the process? |
You're right, I misread the title. I figured it just meant importing all the code cells, but if you want the texts and everything too, that's a bit more involved. Something along these lines could be useful then, where we scrape the |
Yes, I think we have to take the HTML in the LibreTexts page and convert it to the IPYNB format. A custom parser may be needed, but we should also see if someone else has solved this already. I suspect there may be a solution of some variety. Also be aware that there is the command line tool nbconvert, which converts IPYNB to different formats. It is possible that is used to go the other way too. If we have to write something our selves, I think using pandoc might be best. You can write a custom plugin for pandoc that does the conversion. |
pandoc does this nicely already. |
This will probably require #81 to be solved first. |
A button "Open in JupyterHub" should be on each Jupyter enabled LIbretexts page. When a user presses it a new tab should open at jupyter.libretexts.org, they log in, and then the hub uploads the page to their home directory and opens it for execution.
The text was updated successfully, but these errors were encountered: