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

Save widget models with Execute preprocessor? #718

Closed
ricklupton opened this issue Dec 6, 2017 · 5 comments
Closed

Save widget models with Execute preprocessor? #718

ricklupton opened this issue Dec 6, 2017 · 5 comments

Comments

@ricklupton
Copy link
Contributor

I'm using a notebook & nbsphinx to document my custom widget. This works fine if I run the notebook by hand and explicitly "save widget state". But it doesn't work if I use nbsphinx to execute the notebook, because the execute preprocessor doesn't save widget states (comm messages are discarded here).

From a quick look it doesn't look like it would be too hard to dump these comm messages and save the data of the message into the widgets part of the notebook document. Is that a good idea?

@mpacer
Copy link
Member

mpacer commented Dec 9, 2017

That seems reasonable but I'd need to see the implementation. I'd happily review a PR if you have a working model.

@ricklupton
Copy link
Contributor Author

Thanks. I haven't finished testing with nbsphinx but this works with the unit test I wrote:
ricklupton@12cff06

It doesn't remove default values like the proper notebook does. Do you know if there's some existing logic for doing that somewhere that can be reused? Or maybe it doesn't matter.

@ricklupton
Copy link
Contributor Author

@mpacer I've finished testing this and it's working in practice for building my documentation using nbsphinx -- I've made a PR if you have a chance to look.

@scottdraves
Copy link

dup? #751

@t-makaro
Copy link
Contributor

t-makaro commented Aug 8, 2019

Most of the discussion is in #751, so I am closing this issue as the duplicate.

@t-makaro t-makaro closed this as completed Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants