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

HTML: Add download link for the current notebook #5

Closed
mgeier opened this issue Jan 6, 2016 · 8 comments
Closed

HTML: Add download link for the current notebook #5

mgeier opened this issue Jan 6, 2016 · 8 comments

Comments

@mgeier
Copy link
Member

mgeier commented Jan 6, 2016

Ideally, this should already work with the "Source" link (but currently it doesn't).

We could also include an (optional) link above or below the first section title (like here) or at the bottom of the page (like here).

@mgeier
Copy link
Member Author

mgeier commented Jan 6, 2016

It would probably also be nice, instead of having a link to a copy of the file, to have a link to the Github/Bitbucket page of the (proper version of the) notebook.

These links might be interesting:
https://pypi.python.org/pypi/sphinxcontrib-srclinks
https://gist.github.com/MantasVaitkunas/7c16de233812adcb7028
http://mg.pov.lt/blog/sphinx-edit-on-github.html

@mgeier
Copy link
Member Author

mgeier commented Jan 20, 2016

I just asked for this on the sphinx-dev mailing list: https://groups.google.com/forum/#!topic/sphinx-dev/q8dGyV6dN4A

@mgeier
Copy link
Member Author

mgeier commented Mar 29, 2016

I've created a PR for Sphinx: sphinx-doc/sphinx#2399

@mgeier
Copy link
Member Author

mgeier commented Dec 5, 2016

I've mentioned the option html_sourcelink_suffix in 8566fe7.

@ketch
Copy link

ketch commented Mar 9, 2017

Just for others who arrive here, the quick solution (not yet in the docs, as far as I can tell) is to add the following to conf.py:

html_sourcelink_suffix = ''

Then if one right-clicks on the "show source" link and saves the file, it will have the correct .ipynb extension.

It would still be nice to add a more obvious link to download the notebook (in my opinion).

@mgeier
Copy link
Member Author

mgeier commented Mar 10, 2017

@ketch Thanks for mentioning that. I consider doc/conf.py part of the documentation, therefore it is documented. If you think it should also be mentioned somewhere else in the documentation, please make a PR!

It would still be nice to add a more obvious link to download the notebook (in my opinion)

Definitely!
I'm hoping for contributions!

@mgeier
Copy link
Member Author

mgeier commented Dec 13, 2017

@ketch

It would still be nice to add a more obvious link to download the notebook (in my opinion).

I've just created #150, which could be used to create an arbitrarily obvious download link.

What do you think about it?

@mgeier
Copy link
Member Author

mgeier commented Jan 2, 2018

I've just released version 0.3.0, which includes the options nbsphinx_prolog and nbsphinx_epilog, which can be used to create download links, see http://nbsphinx.readthedocs.io/en/0.3.0/prolog-and-epilog.html.

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