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

Jupytext could be more selective re. which files are notebook #340

Open
mwouts opened this issue Oct 12, 2019 · 2 comments
Open

Jupytext could be more selective re. which files are notebook #340

mwouts opened this issue Oct 12, 2019 · 2 comments
Milestone

Comments

@mwouts
Copy link
Owner

mwouts commented Oct 12, 2019

Currently the Jupytext contents manager classifies as a notebook every file that has a Jupytext extension. This is probably a bit too inclusive, cf. #224, #183.

It would be nice to have a function that can tell whether a file is a notebook (e.g. it has some 'jupyter' metadata in the YAML header). We have seen uses cases for this in Jupyter Book (@choldgraf ) and in Voila (@SylvainCorlay).

Once we have this function, we could change the default behavior in the contents manager and only classify as notebooks the files that do have this jupyter metadata (plus maybe percent and Sphinx scripts, and R Markdown files?)

This is also related to #271: once Jupytext is a bit more selective about which files are notebook, we could consider open all these files are notebooks by default in Jupyter Lab.

@mwouts mwouts added this to the 2.0.0 milestone Oct 12, 2019
@choldgraf
Copy link
Contributor

what if it just supported anything that exists in a jupyter: YAML frontmatter. E.g. if people defined other variables, or if it was simply jupyter: true then Jupytext would assume it should parse the document as a Jupyter notebook. And if not, maybe just dump the whole markdown contents into a single markdown cell. This behavior would not happen if jupyter: false or if there was no jupyter: YAML frontmatter.

@timothymillar
Copy link

@mwouts personally the main thing that attracted me to jupytext was the ability to edit a script as a notebook without having to add additional metadata.

My interpretation of #224 and #183 is that they are issues with changing the default open behavior for non .ipynb files rather than issues with which files can be opened as notebooks.

I think the current integration in jupyterlab is the ideal solution (left click opens based file extension with the option to right click --> open as notebook), though I would prefer that the icons displayed were still based on the file extension.

An alternative solution would be to leave the default click to open behavior in the classic interface but add an 'open as notebook' button to the top bar (though I'm note sure how feasible this is)

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

No branches or pull requests

3 participants