Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
krassowski opened this issue Jul 18, 2024 · 0 comments
Open

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

krassowski opened this issue Jul 18, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@krassowski
Copy link
Member

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

async def get_document(
self: YDocExtension,
*,
path: str | None = None,
content_type: str | None = None,
file_format: Literal["json", "text"] | None = None,
room_id: str | None = None,
copy: bool = True,
) -> YBaseDoc | None:
"""Get a view of the shared model for the matching document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant