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

Suggestion for the save menu #5200

Closed
oscar6echo opened this issue Aug 24, 2018 · 7 comments · Fixed by #5968
Closed

Suggestion for the save menu #5200

oscar6echo opened this issue Aug 24, 2018 · 7 comments · Fixed by #5968

Comments

@oscar6echo
Copy link

@oscar6echo oscar6echo commented Aug 24, 2018

As discussed with @jasongrout and previously discussed with @maartenbreddels, here is a proposal for save options in the menu:

  • Save Inputs: clear ipywidgets state, clear all cells output, save notebook in its leanest form.
  • Save Custom: save notebook after keeping only those options ticked in a setting file if present, else in a popup displaying all possible options (ipywidgets, metadata, etc), which a user can save for a subsequent 'save custom'.
  • Save All: save notebook with all options ticked.

Maybe ask for confirmation if some output cells or metadata in the notebook are to be erased - for the case of long calculations.

The benefits, I think, are:

  • regular users have 2 simple plain options (Save Inputs and Save All): the first one to keep a minimal sized notebook on disk (convenient on github), the second to keep absolutely everything (from matplotlib images, to displayed ipywdgets, to cell 'status' like expanded/folded) they see and find it again upon reopening.
  • advanced users can customize at will.

And of course these 3 actions are available programmatically.
Hope it makes sense.

@oscar6echo
Copy link
Author

@oscar6echo oscar6echo commented Sep 11, 2018

I would like to mention jupytext article & repo.

It is not directly related to the save menu options described above but explores another avenue to save notebooks in an 'orderly' fashion ie. convenient wrt github and IDEs, and I think shows the community's interest find a way to save 'clean' versions of notebooks on github.

@jasongrout
Copy link
Contributor

@jasongrout jasongrout commented Sep 12, 2018

Something like this is needed for saving widget state in the notebook, so bumping to 1.0.

@jasongrout jasongrout removed this from the Future milestone Sep 12, 2018
@jasongrout jasongrout added this to the 1.0 milestone Sep 12, 2018
@vidartf
Copy link
Member

@vidartf vidartf commented Sep 12, 2018

Although this is likely an issue that needs to be solved in the jupyter widgets repo? Or is there anything that needs to be done on the lab side as well?

@vidartf
Copy link
Member

@vidartf vidartf commented Sep 12, 2018

Oh, read over the initial issue. I see they are complementary.

@jasongrout jasongrout self-assigned this Sep 12, 2018
@saulshanabrook
Copy link
Member

@saulshanabrook saulshanabrook commented Sep 12, 2018

I added the "Save with extras" command that currently saves collapsed view state: #3981

@jasongrout
Copy link
Contributor

@jasongrout jasongrout commented Sep 19, 2018

Some technical thoughts:

Plugins can register a save handler with the notebook model, which has a title, description, and callback. These handlers are put in the "Save Custom" dialog box. For each one checked, the appropriate handler is called in

toJSON(): nbformat.INotebookContent {
to modify the serialized output (or perhaps they should modify a copy of the model, created by serializing and hydrating the minimal model, so that it's easy to subclass the model to create an ipymd file, for example).

I think we should get some experience with this before perhaps moving it up to generic documents and serialization, if we can.

@jasongrout
Copy link
Contributor

@jasongrout jasongrout commented Feb 22, 2019

FYI, I'm working on solving these needs in #5968.

@saulshanabrook saulshanabrook removed their assignment Mar 20, 2019
@afshin afshin closed this in #5968 Apr 6, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

5 participants