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

Pass uri to Notebook Serializer functions. #125872

Closed
tanhakabir opened this issue Jun 9, 2021 · 3 comments
Closed

Pass uri to Notebook Serializer functions. #125872

tanhakabir opened this issue Jun 9, 2021 · 3 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) notebook

Comments

@tanhakabir
Copy link
Contributor

tanhakabir commented Jun 9, 2021

While I was working on helping make https://github.com/TylerLeonhardt/shell-runner-notebooks a polyglot shell runner, I realized that it's not possible to deserialize the source of the notebook depending on the file name.

In the extension there is one serializer to take .ps1 files into a Notebook by changing the file to be .Notebook.ps1. The underlying file stays the same but the markdown and scripts are parsed out into NotebookData.

The same thing happens for .sh files. But these two don't share the same parsing into NotebookData.

Finally there's a third type of serializer for just Notebook files where the underlying source is standard notebook json.

While these seem like they should be 3 different serializers considering how different they are, the root problem is that you can't register a controller to multiple kinds of serializers, aka viewtypes. But I don't think we should allow controllers to register to many viewtypes, that seems weird.

Right now the extension uses 3 different controllers and 3 different serializers, which is weird for a user who'd expect only one consistent Notebook.

@tanhakabir tanhakabir changed the title Pass uri or filename to Notebook Serializer functions. Pass uri to Notebook Serializer functions. Jun 9, 2021
@jrieken
Copy link
Member

jrieken commented Jun 10, 2021

/duplicate of #125757

@github-actions github-actions bot locked and limited conversation to collaborators Jul 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) notebook
Projects
None yet
Development

No branches or pull requests

3 participants
@jrieken @tanhakabir and others