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

Button to download jupyter/open in colab? #66

Closed
avivajpeyi opened this issue Jan 13, 2023 · 3 comments
Closed

Button to download jupyter/open in colab? #66

avivajpeyi opened this issue Jan 13, 2023 · 3 comments

Comments

@avivajpeyi
Copy link

Do you have any suggestions how this can be adapted to have a button to allow users to download the ipynb/open the ipynb in colab?

@JanPalasek
Copy link
Owner

@avivajpeyi Hello, if I understand correctly, you want to have a button in the exported html file by pretty jupyter that sends you to the ipynb notebook on colab, right?

If so, then you can use standard html link with a button, for example something like this:

<button><a href="url/link/to/ipynb/notebook/in/colab" alt="alt">Button text</a></button>

Since both opening and downloading from colab should correspond to sending a GET request to an url, so you just need to find what that url is.

Did this answer help?

@avivajpeyi
Copy link
Author

avivajpeyi commented Jan 18, 2023

Ah ok -- this is something I could just manually add to the top of my ipynb in a markdown cell.

I think I was wondering how to do this more like the executable book version (a bar on the top)
http://catalog.tess-atlas.cloud.edu.au/content/toi_notebooks/toi_103.html
Screen Shot 2023-01-18 at 4 11 22 pm

however, I think your suggestion will suffice!

(i have to switch away from the executable-book build as it takes too long to process 1000+s of pages, and I think your tool can be an alterative!)

@JanPalasek
Copy link
Owner

If you want to add the buttons to every notebook, you can create your own template. Check out this docs:

https://pretty-jupyter.readthedocs.io/en/latest/custom_template.html

It also has an example linked down below.

Also you can check out Quarto, I think it might have better support for these kind of documents and features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants