-
Notifications
You must be signed in to change notification settings - Fork 386
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
Open linked .md
files as notebooks in Jupyter Lab
#271
Comments
Recall that the Open as notebook menu was added at jupyterlab/jupyterlab#5247 |
@choldgraf , @betatim, I have a related question regarding mybinder: is it possible to state in the URL that I want to open a specific |
Ideally, this could be handled by the Jupytext extension. In that case no Jupyterlab core code would have to be altered and additionally, it could be a Jupytext configurable. Though, I'm not familiar enough with jupyterlab to know if it is feasible for an extension to manipulate the way a file is handled. Maybe @jasongrout can comment on this. |
@mwouts yep - instead of |
I agree. I think that I'd like to add more notebook types in the registry. And probably add them before the non-notebook types... But I have no idea if an extension can do that... @choldgraf , my question was related to the 'widget' that is used to open the file. When I go to https://mybinder.org/v2/gh/mwouts/PythonDataScienceHandbook/jupytext_no_ipynb?urlpath=lab/tree/notebooks/Index.md it uses the 'Editor' widget. I would like to tell Jupyter Lab to use the 'Notebook' widget. But I see that already with a local Jupyter Lab I don't know how to do that from the url... |
ah good question - that one is beyond my knowledge of JupyterLab, I'm not much of an expert there :-/ |
@jasongrout, I am giving a try to the user settings in Jupyter Lab, they really seem to be what I am looking for - but unfortunately I don't see what they change in practise. For instance, in the experience below, I set the user settings to this:
With that, I would have expected that clicking on a link to another md file would open that file in the Editor, rather than in the Markdown Previewer. But the opposite happens. Do you have an idea of what I got wrong? Thanks! |
I just checked as well, and indeed in 1.2.4, at least, that setting will control what happens when you double-click on the file (try changing it to "markdown preview" and double-clicking on a markdown file in the file browser). However it seems to not be used when clicking on a link to open a file. This looks like a bug to me. CC @ian-r-rose, who (IIRC) wrote that defaultViewer override functionality. |
I tracked down the problem and opened an issue: jupyterlab/jupyterlab#7776 |
Awesome. Thank you so much @jasongrout |
Hey all - did this issue get resolved? I am working on building in more Jupytext integrations in Jupyter Book, and I'd like to be able to create Binder links that automatically open the file as a notebook rather than a markdown file. @mwouts any chance this is possible yet? |
Hello @choldgraf , I am not aware of any progress here, sorry. Furthermore, I am not very familiar with TypeScript yet, and this makes it a bit harder for me to work on this kind of issue... As discussed above, I think there are two possible approaches: either we try and see how to fix the viewer settings at jupyterlab/jupyterlab#7776, or we find a way to do that in the Jupytext extension for JupyterLab. |
Makes sense - in the meantime I will try and get around this with some documentation in the new jupyter book docs (beta.jupyterbook.org)...I don't think it will be too clunky for folks, especially if they're willing to have both an |
It also happens with other extensions, like |
Is {
"defaultViewers": {
"markdown": "Notebook"
}
} supposed to work now (for double-clicking from the file menu)? For me it doesn't seem to on jlab 3.1.4 and jupytext 1.10.3, even despite |
Since Binder now uses JupyterLab by default, this got a bit more annoying. I really like jupytext so I'll stick to the classic Notebook interface for the time being. |
Hi everyone, thanks to @fcollonval 's work on this we can now open text notebooks with a single click in Jupyter Lab. Please install Note that links to |
* Add a mention of default_setting_overrides.json + links to .md files * Require jupyterlab>=4.0.0a16 on Binder (#271) * Use original case for .md anchors
In You can try this yourself at https://mybinder.org/v2/gh/mwouts/jupytext/main?urlpath=lab/tree/README.md |
I'm on version |
Hello @paulrougieux , well
|
For the record: opening linked jupytext markdown files as notebooks now not |
At #263 we converted all the notebooks from the Python Data Science Handbooks to their Jupytext Markdown representation, with a
.md
extension. These files can still be opened as notebooks in Jupyter Lab, and the user can run them.However, if we follow the links to the other notebooks, these links open as Markdown files. Opening them as notebooks would be more convenient in this context.
Maybe all text files with a YAML header should open as a notebook by default? @jasongrout, @grst, what do you think?
The text was updated successfully, but these errors were encountered: