mwouts / jupytext

Jupyter Notebooks as Markdown Documents, Julia, Python or R scripts
https://jupytext.readthedocs.io
MIT License
6.6k stars 386 forks source link

jupytext-config and foreign kernels / extensions #1164

Closed parmentelat closed 10 months ago

parmentelat commented 10 months ago

now that #1163 is giving us an ability to easily create exotic formats like bash or javascript notebooks, I notice that I cannot open them by double-clicking, because I don't know the string to use in jupytext-config

specifically I have tried jupytext-config set-default-viewer bash sh javascript js

meaning that I now have

$ jupytext-config list-default-viewer
python: Jupytext Notebook
markdown: Jupytext Notebook
myst: Jupytext Notebook
r-markdown: Jupytext Notebook
quarto: Jupytext Notebook
julia: Jupytext Notebook
r: Jupytext Notebook
bash: Jupytext Notebook
sh: Jupytext Notebook
javascript: Jupytext Notebook
js: Jupytext Notebook

but to no avail in either case...

mahendrapaipuri commented 10 months ago

When you say "open them by double-clicking", you mean you were trying to open them as text notebooks? If so, I can without any issues.

js_text_nb

And I dont have any special jupytext config.

parmentelat commented 10 months ago

since these documents are notebooks, I would like a double-click in the file browser to open them .. as notebooks, and not as text files

so for .md and .py files, this is possible using

jupytext-config set-default-viewer

which by default defines "Jupyter Notebook" as the default factory for viewing a predefined set of file types

it is possible, like I do in the OP, to add other file types, that will also be bound to "Jupyter Notebook" as the default viewer except that I don't know how to describe the "right" filetype for these 2 cases (js and bash), and I expect the issue would be the same for any foreign kernel indeed...

mwouts commented 10 months ago

Hey @parmentelat , that's a good question. I am afraid I don't know the answer. Given that the setting UI says that the available file types are

text notebook directory markdown PDF python json julia csv tsv r
yaml svg tiff jpeg gif png bmp webp html vega5 vega-lite5 vega-lite4
vega-lite3 plotly jupyterlab-workspace myst r-markdown quarto

I did try text and notebook but that did not help in opening a .sh notebook as a notebook with a single click.

image

parmentelat commented 10 months ago

hi @mwouts thanks for your input something I'll try to ask to the jlab gurus if I get a chance ;-)