jupyterlab / jupyter-collaboration

A Jupyter Server Extension Providing Support for Y Documents
https://jupyterlab-realtime-collaboration.readthedocs.io/en/latest/
Other
169 stars 31 forks source link

An API to create a document room if it does not exist? #328

Open krassowski opened 4 months ago

krassowski commented 4 months ago

Problem

Currently it is possible for other extensions to get the document (or it's copy - by default) if there is a collaborative session for it. However, it is not currently possible to create the document room when it does not exist. This would be useful to allow server-side execution for notebooks which are not currently open (e.g. user clicks from context menu in the file browser on the notebook and chooses to execute it).

Proposed Solution

Add a new public API for creating the notebook. This could be as simple as a new argument to the existing get_document, a boolean create which would default to false.

Additional context

https://github.com/jupyterlab/jupyter-collaboration/blob/bcc36e1a451aaa5dbfbe020db72070149bd934bd/projects/jupyter-server-ydoc/jupyter_server_ydoc/app.py#L136-L145