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

Register arbritrary kernel languages with docRegistry #1188

Merged
merged 1 commit into from
Dec 3, 2023

Conversation

mahendrapaipuri
Copy link
Contributor

Fixes #1164

Now users can configure default Viewers for docManager to open them as Notebooks. By default text notebooks will always open as file with editor factory.

@parmentelat @mwouts Could you please test the patch and see if it is the desired behaviour? Current implementation will open markdown, myst, Rmd and qmd formats as notebooks by default. Is it intended? I m asking because this was the behaviour in 1.15.x and I have not changed it. I guess you would like the markdown variants open as text files by default and able to change them as notebooks by overriding default viewers. If so, let me know, I will make necessary changes.

@mwouts What is the reason of choosing format as md:myst for MyST? I have noticed that creating a MyST text notebook creates the file with .md extension. Is it not supposed to be created with .myst extension? If so, we need to change the format to myst.

Cheers!!

* By default text notebooks will always open with editor factory

* By configuring defaultViwerOverrides, users can open them as notebooks

Signed-off-by: mahendrapaipuri <mahendra.paipuri@gmail.com>
Copy link

github-actions bot commented Dec 3, 2023

Thank you for making this pull request.

Did you know? You can try it on Binder: Binder:lab or Binder:notebook.

Also, the version of Jupytext developed in this PR can be installed with pip:

pip install git+https://github.com/mahendrapaipuri/jupytext.git@viewer_for_generic_languages

(this requires nodejs, see more at Developing Jupytext)

Copy link

codecov bot commented Dec 3, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7223622) 97.73% compared to head (8866366) 97.73%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1188   +/-   ##
=======================================
  Coverage   97.73%   97.73%           
=======================================
  Files          29       29           
  Lines        4456     4456           
=======================================
  Hits         4355     4355           
  Misses        101      101           
Flag Coverage Δ
external 75.05% <ø> (-0.12%) ⬇️
functional 88.56% <ø> (ø)
integration 77.31% <ø> (ø)
unit 66.56% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mwouts
Copy link
Owner

mwouts commented Dec 3, 2023

Thanks @mahendrapaipuri ! Just tested and it works like a charm. Now I have the 'bash' type for documents (screenshot below) and adding it to the Jupytext viewer let me open it as a notebook with a single click.

I think most MyST users prefer to use .md as the file extension, because it's mostly Markdown, and this way you can get it rendered as such on GitHub, etc.

Current implementation will open markdown, myst, Rmd and qmd formats as notebooks by default. Is it intended? I m asking because this was the behaviour in 1.15.x and I have not changed it.

I think this is specific to Binder (which we configure in this way). Let me have a look.

image

@mwouts
Copy link
Owner

mwouts commented Dec 3, 2023

Current implementation will open markdown, myst, Rmd and qmd formats as notebooks by default. Is it intended? I m asking because this was the behaviour in 1.15.x and I have not changed it. I guess you would like the markdown variants open as text files by default and able to change them as notebooks by overriding default viewers

Well you're right! Well I'd say that we let this as such (nobody complained about this, plus the notebook editor does look very similar to the markdown viewer for markdown files). Thanks for pointing this out

@mwouts mwouts merged commit 3ece66e into mwouts:main Dec 3, 2023
31 checks passed
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

Successfully merging this pull request may close these issues.

jupytext-config and foreign kernels / extensions
2 participants