Edit Notebook metadata

I am using Jupyter Lab 4.0.5 (Jupyter Notebook 7.0.3) and would like to edit the Notebook or Cell Metadata. I do have the Settings right side window with Advanced Tools open to see the property inspector windows with the cell and notebook metadata. When I edit the notebook metadata directly in the window and save the notebook, the changes are not saved and revert back to what was originally in the property inspector window. Even if I use Jupyter Notebook alone, I cannot edit the notebook metadata as it loses all changes.

I have a workaround of using Notepad++ to edit the metadata but would like to do so directly in Jupyter Lab or Notebook.

I have used an older version of Jupyter Notebook with “Edit Notebook Metadata” in the “Edit Menu” and could edit the notebook metadata. Is there something similar I should do to enable the Advance Tools property windows to be editable rather than read only?

Thank you for helping.

1 Like

I’m really surprised by this behavior. The cell metadata is visible in the property inspector → advanced tools section (JupyterLab 4.0.11), but it is NOT EDITABLE (i.e., edits do nothing and do not persist after selecting another cell). Perhaps there is a good reason for it, but this behavior seems insane to me. As @smengel mentioned, I can edit the metadata by opening the notebook in a text editor, but that is ridiculous. Any chance that anyone is working on adding functionality for editing the cell metadata via the property inspector?

1 Like

This should be doable, but right now the only way to edit the metadata is to load an extension for your use case.
What metadata do you want to add/change?

Did you click on the little tick icon that appears above the notebook metadata window? It appears when you’ve made valid edits, and you need to click on it and then save the notebook. It has tripped me up multiple times.

2 Likes

GOOD GOD that was it. I was going insane searching why it was not saving the changes to metadata and it turns out you have to click that INSANELY un-intuitive tick icon to save it.

Thank you man


Update:
Well now I see that I can not remove the changes I made. I can edit them, but I can not remove them. This is insane behavior

You should be able to remove your changes. Perhaps you’ve left a stray comma or something and it’s detecting the code as invalid (you’ll see a red border around the metadata window). The tick icon only appears if the code is valid.

Also worth noting that if the browser focus goes away from the metadata window – eg because you click on the notebook – any unsaved changes will be lost. I’ve now got into the habit of clicking the tick icon immediately after making any edits.

3 Likes

Did you click on the little tick icon that appears above the notebook metadata window? It appears when you’ve made valid edits, and you need to click on it and then save the notebook. It has tripped me up multiple times.

I can relate. Anyone ideas how to improve it? If yes, please do open an issue with enhancement request over on Issues · jupyterlab/jupyterlab · GitHub :slight_smile:

2 Likes