-
Notifications
You must be signed in to change notification settings - Fork 394
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
paired md:myst format also works as MyST Markdown #1315
base: main
Are you sure you want to change the base?
Conversation
Thank you for making this pull request. Did you know? You can try it on Binder: Also, the version of Jupytext developed in this PR can be installed with
(this requires |
Codecov ReportAttention: Patch coverage is
❌ Your patch check has failed because the patch coverage (5.26%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.
Additional details and impacted files
☔ View full report in Codecov by Sentry. |
To note, this will break all existing myst formatted notebooks, if you want to do this then there should be a flag for specifying you want the curvenote implementation of myst, as opposed to the current sphinx one |
Thanks for taking a look and responding, @chrisjsewell. I don't see it yet however, in case you are able to elaborate. My understanding of "md:myst" output is that it's not meant for use directly with the myst cli. It's the paired ipynb format that myst can use. The two yaml blocks in the "md:myst" format is not standard. If I'm wrong here, I'd agree with abandoning this PR.
Do you mean fundamentally, or as drafted? As drafted, I agree. There's no mechanism yet to recognize that a .md file with two yaml blocks needs to be updated to a single yaml block format. (Or by notebooks above do you mean the paired .ipynb file? That would not make sense to me, because those are not meant to be modified.)
If both implementations follow the markdown spec described at https://mystmd.org/, then I don't understand this need. What would be the difference between the "md:myst" and a "md:curvenote" formats written by jupytext? |
Hi, I've not add much time to look into this but I agree with @itcarroll that having two consecutive yaml headers in the same document is not great. I also agree with @chrisjsewell that we don't want to break existing notebooks nor cause massive diffs when users transition to a new version of Jupytext. @itcarroll I assume that the "curvenote" format directly has the MyST fields in the yaml front header? @chrisjsewell do you think we could simply concatenate the two yaml headers, and use the explicit list of MyST fields to map the MyST fields back to the first Markdown cell when converting back to a Jupyter notebook? From what I see the |
Provides #1314.
Modifies the
src/jupytext/myst.nb
conversion functions to combine (fornotebook_to_myst
) and separate (formyst_to_notebook
) the notebook metadata and MyST frontmatter. Notebook metadata includes fields likejupytext
andlanguage_info
, while MyST frontmatter has all these fields. Note thatjupyter
is a "project only" field for MyST, so there should be no namespace conflict.This PR is draft:
kernelspec
metadata out of the introducedjupyter
namespace in the markdown YAML block