Allow creating figures with an attached notebook
Allow creating figures with an attached notebook that…
-
when executed with the play button will run all its cells. -
attaches output from them to figure objects, that can be then picked into the containing figure element. -
can be edited in a separate window using the regular Jupyter / JupyterLab interface. -
can be saved back as .ipynb upon edits being made (can you access the notebook with a service worker that intercepts the save calls by any chance? If not, may need to add some custom proxying logic for the purpose in our system to allow capturing Jupyter side made requests to save to the notebook server, since I cannot see any webhook delivery mechanism or similar being there).
This is how you can upload an .ipynb to a notebook server:
-
Ensure that the Jupyter notebook server for the user (JupyterHub user = Manuscripts project) is running by [making a POST call for the project's / user's notebook server] (https://jupyterhub.readthedocs.io/en/stable/_static/rest-api/index.html#operation--users--name--server-post).
-
POST or PUT to the …/api/contents of the notebook server (in this case the toy user "manuscripts-geezer").
curl \
-H "Authorization: Token <token>" \
-H "Content-Type: application/json" \
-X PUT \
https://jupyterhub-dev.manuscripts.io/user/<user name>/api/contents/foobar.ipynb \
-d @foobar.ipynb
Example .ipynb attached for reference.