jupyter-server / jupyter_ydoc

Jupyter document structures for collaborative editing using Yjs/pycrdt
https://jupyter-ydoc.readthedocs.io
BSD 3-Clause "New" or "Revised" License
28 stars 17 forks source link

Allow users to provide an external `ydoc` to `YDocument` #141

Closed trungleduc closed 1 year ago

trungleduc commented 1 year ago

Problem

The constructor of YDocument is empty since the internal YJS doc is created by the class. It would be useful if users can provide an existing ydoc to the YDocument constructor.

Proposed Solution

Update the YDocument constructor signature to allow overriding the ydoc property.

Additional context

welcome[bot] commented 1 year ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
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! :wave:
Welcome to the Jupyter community! :tada:

davidbrochart commented 1 year ago

This would also align with the Python side, where we can pass an existing YDoc.