jupyter-book / mystmd

Command line tools for working with MyST Markdown.
https://mystmd.org/guide
MIT License
220 stars 65 forks source link

Jupytext notebook support #1245

Closed choldgraf closed 4 months ago

choldgraf commented 6 months ago

Currently, we only support text-based notebooks via the {code-cell} directive and {eval} role. Jupyter Book v1 supports any file format that Jupytext supports, which is a wide variety of text-based notebook formats.

I don't see any mention of Jupytext support in the docs, so assume that it isn't supported right now.

Suggestion

We should either:

agoose77 commented 6 months ago

This is a great issue Chris, thanks!

parmentelat commented 6 months ago

this issue resonates particularly strongly with me as I only write jupytext notebooks, given how git-unfriendly the ipynb format can turn out to be :)

hence I'd clearly advocate option 1 / full support as far as possible; this being said fyi, md:myst and py:percent would already account for a substantial coverage of my current courseware, the remaining being javascript and bash; but that's just me I guess :)

one other thing that has been discussed in other places was, it could be nice to be able to define a naming scheme that can tell notebooks from regular documents in my case for example, over time I have gone for *-nb.py or similar (which is helpful for humans too:), it would be nice to be able to configure just that when initializing the book; maybe something like

jupytext_patterns:
  - *-nb.py
  - *-nb.md

somewhere in myst.yml

agoose77 commented 4 months ago

I've circled back to this after a meeting with Chris. I propose that we drop non-MyST notebook support for our MVP. Adding support for jupytext will involve either using something like pyodide to "get it for free", or more likely manually implementing support for each file format in MyST.

For now, there is a Python tool that can convert between flavours, and most people shouldn't need a choice; MyST-flavour notebooks (MyST Markdown files) are supported out of the box, and provide a clear way to do things.

I'm closing this, but anyone in disagreement can re-open.

parmentelat commented 2 months ago

can you please elaborate a bit ? I am not sure what Mininal Viable Product entails in your mind does that mean jupytext support will not happen at all, or it's just postponed ? if the latter, I suggest the issue remains open