jupyter-book
jupyter-book copied to clipboard
Download of `ipynb` files broken
Instead of downloading the Jupyter Notebook, the source of the file is openes on a new page.
For example, on this page of the Jupyter Book documentation:
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"(file-types:notebooks)=\n",
"# Jupyter Notebook files\n",
"\n",
"You can create content with Jupyter notebooks.\n",
"For example, the content for the current page is contained in {download}`this notebook file <./notebooks.ipynb>`.\n",
"\n",
"```{margin}\n",
"If you'd like to write in plain-text files, but still keep a notebook structure, you can write\n",
"Jupyter notebooks with MyST Markdown, which are then automatically converted to notebooks.\n",
"See [](./myst-notebooks.md) for more details.\n",
"```\n",
"\n",
"Jupyter Book supports all Markdown that is supported by Jupyter Notebook.\n",
"This is mostly a flavour of Markdown called [CommonMark Markdown](https://commonmark.org/) with minor modifications.\n",
"For more information about writing Jupyter-flavoured Markdown in Jupyter Book, see [](./markdown.md).\n",
"\n",
"## Code blocks and image outputs\n",
"\n",
"Jupyter Book will also embed your code blocks and output in your book.\n",
"For example, here's some sample Matplotlib code:"
I believe this is an issue with ReadTheDocs, which may or not be their intended behavior: https://github.com/readthedocs/readthedocs.org/issues/11728
I am having this issue above (wasn't a problem until a couple of weeks ago, but now I get the problem above even when trying to download ipynb from the Jupyterbook documentation pages and students have started emailing me that they can't download my teaching materials so I think it is not just me...).
Is there any chance of a fix within JupyterBook or something we can include in our book source code to fix it? I realise we can right click and save the file but this is clunky, and as the download button is present by default (can't even be removed, I think?) it would be great if it worked as expected.
By the way, I'm not a developer but use Jupyterbook for my teaching materials (which has been great, thanks) - any advice on a similar technical level as the JupyterBook docs would be much appreciated.
Thanks so much!
I'm having this problem now too, just in the last few weeks.
I think the recent reason for this change is that a Jupyter notebook mime-type was added to mime-db in March, and that's what GitHub pages uses. See: https://github.com/jshttp/mime-db/pull/282
So this change means that the browser opens the file as JSON, in the browser.
also, this is likely a sphinx-book-theme issue and not a jupyter-book issue.
https://github.com/executablebooks/sphinx-book-theme/issues/863
sadly this fix does not seem to work for me.
https://github.com/orgs/TeachBooks/discussions/44#discussioncomment-14425186
I agree this issue can be closed, as it's something that needs to be handled at the theme (or extension) level.