jupyter / notebook

Jupyter Interactive Notebook
https://jupyter-notebook.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
11.61k stars 4.87k forks source link

Richer Exporting ("Print Preview" and "Download as…") interface #2044

Open mpacer opened 7 years ago

mpacer commented 7 years ago

Some of the nicer features of nbconvert are currently only easily available on the command line. Those more comfortable in the browser can indirectly customise their exports using the jupyter_config and jupyter_notebook_config files, but that only picks up changes if you restart the server.

One suggested solution is to have a richer version of the "Download as…" that then actually calls out to nbconvert using an API (rather than what it's currently doing which is seemingly more complicated than just running a subprocess with nbconvert calls). @Carreau can hopefully say more about this both what the current mechanism is and how the API would work.

Additionally, rather than just "Download as…" being customisable, it would be useful to have a customisable version of "Print Preview". That would include a live preview, which in Jupyter lab could be updated in real-time (or as close to realtime as is possible) @fperez @bollwyvl.

This stems from the January 17, 2017 Jupyter dev meeting discussion.

dsblank commented 7 years ago

Oh, I like this idea!

Perhaps a related issue: I spent about 20 minutes today trying to get a version of my syllabus (a notebook) to print adequately for handout. I have a table with links in the notebook which caused problems:

I had to download as HTML and remove some "print" CSS to keep the links from showing. The actual notebook is here if interested [1].

A richer version of "Download as..." could conceivably have some options to give more possibilities.

[1] - https://athena.brynmawr.edu/jupyter/hub/dblank/public/CS110%20Intro%20to%20Computing/2017-Spring/Syllabus.ipynb

juhasch commented 7 years ago

An API for controlling nbconvert from the notebook would be really welcome, I asked for something similar in #1629.

In the printview extension I currently I have to call the Python kernel of the notebook directly to be able to customize nbconvert options. This is not a good solution and only works when a Python kernel is running.

For testing, some time ago I added a put request to the nbconvert handler, so I was able to transfer a JSON block with nbconvert configuration options from the frontend to the notebook server. That allowed kernel-agnostic per-notebook nbconvert options. This is what I would like to see as functionality in the notebook (obviously not implemented as a hack like I have done).