-
Notifications
You must be signed in to change notification settings - Fork 392
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
Jupytext and Jupyterlab: cell mini-toolbars missing with Jupytext Notebook #990
Comments
Additional comments: if I open a markdown notebook from the file browser |
Hi @mwouts, Just attracting attention to this issue which is still up. Just as an additional Thanks in advance! |
Hi @mwouts, Bumping and adding one more piece of information: it's not only the cell toolbar that does not appear in Jupytext notebooks, but in fact any widget provided by an extension (e.g. the We studied this a bit further with @brichet. His explanations is that extensions Altogether, given that the Notebook viewer works well for jupytext notebooks with "Open With -> Notebook", is there a motivation nowadays for having a different notebook viewer type? Do you Thanks in advance! Cheers, PS: fun fact: "Jupytext Notebook" is internationalized to "Jupyter Notebook" in French which does not help with the confusion :-) |
Hey @nthiery , thank you for the ping - sorry I am running a bit behind these days! Yes I would also find it simpler if we could just have the There might be some interesting inputs about that in earlier issues/PR too. |
As @nthiery pointed out, extensions registered with If we dont use |
Thanks @mahendrapaipuri for the input! Saving the paired files is done by the context manager, which is independent of the editor. I think we need to figure out why in the first place we had to recur to another factory. If I remember correctly it's because the default notebook viewer checks that a document is a notebook not only using the document "type", but also its extension (which had to be ipynb at that point). Maybe we could consider a PR on the default viewer in jupyterlab to only use the document "type"? The issue where the new factory was developed is this one: #803., and the factory was developed by @fcollonval . |
the need for this dual factory thing is a mystery to me.. I wish the regular notebook factory could be used to open jupytext notebooks, just like the classic notebook was able to do -- I kind of got used to it, but yes if that thorn could be removed from our foot it would be just great... |
Ah ah, I had noticed this "double opening" behavior, but had not made the connection with the use Thanks @parmentelat for the connection :-) |
I fixed it - will be part of the next language packs release. Of note, the translation is done using the crowdin collaborative web service: https://crowdin.com/project/jupyterlab |
The main issue (related to the need of a factory) is due to the impossibility to add an existing file type (for example markdown file) to an existing factory (for example Notebook) because of the principle "don't mess up the code you don't own". But creating new file types allows to bind to existing factory and creating new factory allows to bind to existing file type. Hence the new factory allows to open markdown file as notebook. @brichet does your analysis take into account that we are tricking the toolbar factory to use the
|
@fcollonval Cheers for the info. Looking into the sources, it seems like extensions are registered by name, which I guess the factory name. I did look into the Do you have any elegant way in mind to solve this issue? |
Thanks @fcollonval for the feedback. By the way: if this can help resolve this question, I on my side would be totally fine |
on my side I am currently using exclusively *-nb.md and *-nb.py for jupytext notebooks |
I am not quite sure to understand this one; the very notion of a plugin is to let other people extend some core functionality; how is this different ? |
@mahendrapaipuri the proposed solution of defining a new file type based on a composed extension like
To explain my statement a bit more, a plugin is a foreign piece of Code owned by a third party that interacts with other code pieces it does not owned. The ownership is the key here as ownership allows the definition of the intent. However in the mentioned use case of using the notebook widget factory for the markdown file type that principle is not met by jupytext as it does not own neither of the two parts. |
I have configured my local jupyterlab so that markdown files are opened as Jupytext notebooks:
which works great and is since today used intensively by our 300 students. That
smoothed our migration from Jupyter to JupyterLab :-)
However I noticed that the notebook is missing the usual cell mini-toolbars:
Anyone else noticed this? Is there any difference between "Notebook" and "Jupytext notebook
beyond load/save, and maybe some additional menus?
My local setup:
The text was updated successfully, but these errors were encountered: