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

share server: implement proxying notebooks hosted on github, similar to what nbviewer provides #6015

Closed
williamstein opened this issue Jun 24, 2022 · 4 comments
Labels
A-share share server; making things public; user generated content I-feature request

Comments

@williamstein
Copy link
Contributor

williamstein commented Jun 24, 2022

Consider this URL:

https://nbviewer.org/github/sagemanifolds/IntroToManifolds/blob/main/01Manifold_Def.ipynb

that is one of the links from https://sagemanifolds.obspm.fr/intro_to_manifolds.html

It's a notebook that you can see view nbviewer. It's hosted on github here:

https://github.com/sagemanifolds/IntroToManifolds

The point of this ticket is to make it so

https://cocalc.com/github/sagemanifolds/IntroToManifolds/blob/main/01Manifold_Def.ipynb

does the same exact thing... with the added benefit that with a click you can be quickly interactively using the notebook with the Sage kernel right in your web browser, which is something nbviewer/github don't provide (especially not for Sage).

Also, CoCalc can render far more document types than nbviewer, e.g., markdown, latex, etc., so this could be more generally useful.

@williamstein williamstein added I-feature request A-share share server; making things public; user generated content labels Jun 24, 2022
@williamstein
Copy link
Contributor Author

One way in which this provides significant value over just cloning the code from

https://github.com/sagemanifolds/IntroToManifolds.git

and hosting it in the normal way on CoCalc, is that if that upstream git repo is updated, then the newer versions are available. For example, I just used git clone to put a copy here:

https://cocalc.com/wstein/support/IntroToManifolds

and this is great, but it's a single point in time and isn't automatically kept in sync with github...

@williamstein
Copy link
Contributor Author

with the added benefit that with a click you can be quickly interactively using the notebook with the Sage kernel right in your web browser, which is something nbviewer/github don't provide (especially not for Sage).

I want to clarify that there is a "Run this in binder" button on nbviewer specifically for these Sage manifolds notebooks. However, that's not the quality of experience I'm aiming for (or that we already have on cocalc). I just tried that link for one of these notebooks, and you get sent to another page, watch a terminal do something, see a big spinner, get asked for money in a big red box, see that something should be starting, and (I'm timing it with a stopwatch) over 10 minutes later, it still doesn't work. Maybe it's challenging getting sage to work with mybinder robustly, since sage is so big.

@williamstein
Copy link
Contributor Author

Update: mybinder did successfully load that notebook, but it took exactly 16 minutes according to my stopwatch.
However, loading a second notebook from the repo was then much faster (less than 20 seconds*), but then I quickly got

image

and it was really broken. I refresh the browser, and got stuck with "Kernel starting, please wait..." for a while, then failed. So maybe mybinder loads but doesn't actually work long for these. In any case, it's clearly not the best possible imaginable experience we want for Sage users. I'm definitely not saying cocalc is either, but I want to try, hence tickets like this one.

I like how in mybinder they somehow add buttons to the Jupyter notebook that provide links back to the Github version of the notebook and the binder version:

image

@williamstein williamstein changed the title share server: implement proxying noterbooks hosted on github, similar to what nbviewer provides share server: implement proxying notebooks hosted on github, similar to what nbviewer provides Jun 25, 2022
@williamstein
Copy link
Contributor Author

This is now live!

To use it, just make a url like

The URL schema is exactly the same as what https://nbviewer.org uses, i.e., github/<github url>, url/<anything on the internet> and gist/[github user]/[gist id].

The main differences relative to nbviewer are:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-share share server; making things public; user generated content I-feature request
Projects
None yet
Development

No branches or pull requests

1 participant