jupyterlab / extension-examples

JupyterLab Extensions by Examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example how to save the notebook (frontend?) and get path and main metadata of the notebook (from the server side?)

paugier opened this issue · comments

I'd like to have an extension that adds a button (like this) to trigger a command written by the user in the metadata of the notebook.

I guess the command needs to be run on the server side because it uses the .ipynb file. The command needs to be run from the directory containing the ipynb file.

I guess the first step would be to save the notebook to be sure that the file is up to date. I didn't find that in the examples nor in other parts of the documentation (for example here https://jupyterlab.readthedocs.io/en/stable/api/modules/notebook.notebookactions.html).

How can I do that?

Then, I think I need to obtain from the server extension 2 pieces of information:

  • The path of the directory where the notebook is saved
  • A dictionary containing the metadata of the notebook

Is it doable? I wasn't able to find this in the examples.

Additional context

See https://discourse.jupyter.org/t/jupyterlab-extension-to-add-a-button-to-save-the-notebook-and-launch-a-command/14844/3 and #202 (comment)

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉