Nbconvert: How to save widget state after executing notebook

Created on 5 Feb 2018  路  15Comments  路  Source: jupyter/nbconvert

I automate the execution and conversion to html of notebooks with this convenience package notebook-snapshot. In particular the execution script is there straight from the documentation.

My notebooks contain widgets. So I need to 'save widget state' after execution.
If I run a notebook manually, I would use click on 'Clear widget state' then 'Save widget state' to embed only the latest state in the notebook.

How to do that from nbconvert ?

Execute

Most helpful comment

Hey, what's the state of this? I'm very interested in this feature because I convert a lot of notebooks to html via cmd line and was hoping to include my widgets in those conversions and I think this is a feature I've been looking for.

All 15 comments

We would like to develop a fix for this. Any special guidance from the maintainers?

We would like to develop a fix for this. Any special guidance from the maintainers?

It looks like you are already working on it, from the referenced commits above. Thanks! How is it going? Any sticky points?

https://github.com/jupyter/nbconvert/pull/779
there's a problem with python2.7 and unicode that we should have resolved tomorrow.
actually have several PRs that could use attention....

Could you list those PRs?

Hey, what's the state of this? I'm very interested in this feature because I convert a lot of notebooks to html via cmd line and was hoping to include my widgets in those conversions and I think this is a feature I've been looking for.

I guess this is also related to the ongoing (usability) discussion on whether Jupyter should save the widget state by default (see this comment and the following ones).

Latest PR addressing this issue: https://github.com/jupyter/nbconvert/pull/900

I believe this was closed in 5.5, see here.

Indeed, however with the new widgets functionality present in nbconvert 5.5, I am trying to convert a very simple notebook containing a slider to slides like this:

$ jupyter nbconvert --execute Untitled.ipynb --ExecutePreprocessor.store_widget_state=True --to slides

However, when I see them the widget is not shown. Perhaps I did not understand the feature?

This might be an unrelated issue, about embedding notebook javascript in the slides template; do you see the widgets if you convert to html?

Sorry, lazy comment - I will open a new issue with a notebook to reproduce and some screenshots.

@maartenbreddels, should this issue be closed? (I believe you're one of the devs that are up to date on its status, my apologies if it isn't the case.)

Indeed, this can be closed.

Regarding my last comment, this issue has already been reported at https://github.com/jupyter/nbconvert/issues/1097.

Was this page helpful?
0 / 5 - 0 ratings