-
Notifications
You must be signed in to change notification settings - Fork 153
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
Store notebook title/name in metadata #91
Comments
It seems like #46 might be related. Do we not automatically create the |
Right now it's not automatically created, it was just specced out for the format. Generally I don't think we can assume the title is there as we move from |
Very early versions of the notebook format did, but...
Or if they rename the file via any normal means, it won't update the name inside the file. I think I'd give the new API an optional parameter to give a notebook name, and have a default (e.g. |
Title and author went in via #46 |
I'm working on a mechanism for passing a notebook along with a configuration file via a post request to an active notebook server.
In order to send everything as one big JSON blob, I've got top level fields like "config" and "notebook" which have JSON based config files and JSONified notebook. Unfortunately, if that were passed in, the notebook JSON doesn't have any notion of the name of the notebook from which it was derived.
Right now, the way that the notebook determines the name of the notebook is by examining the path of the notebook being converted. This is fine for the use case of converting a notebook via the browser with a custom configuration (since I can just get the name of the current notebook using the path as before). However, if someone wanted to pass a notebook via a post request originating from somewhere that is not the current notebook interface, there is no path(it's just a JSON blob) and therefore no name/title.
I could include a top level "name" feature as part of the API that needs to be specified, but that seems like a hacky solution rather than being able to extract the name directly from the notebook's json blob. I can even see there being a way to overwrite the name using an optional argument, but to make it required in order for the notebook to have a name at all (when in almost all cases notebooks do already have a name) seems a bit odd.
I was genuinely surprised that this wasn't already a part of the spec, so I figured I'd raise the possibility here.
I could see one problem arising if people were to edit the JSON directly and get the name out of sync with the file name. But my intuition is that in order to keep consistency with current behaviour whenever nbformat is run on a notebook with a file name (and not just a JSON blob) it would reassign the JSON name to be identical to the file name. Thus there is always a resolution method and the file system name always has priority in the case of a conflict.
The text was updated successfully, but these errors were encountered: