-
Notifications
You must be signed in to change notification settings - Fork 206
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
implement integrated jupytext support for cocalc-jupyter #4715
Comments
One comment says "Myst-MD notebooks work well with Sphinx and allow cross references and citations,", where Myst-MD is one of the Jupytext options. With CoCalc it would be natural to have a modified frontend that supports and renders extra Myst-MD references and citations (it would just be a different frame type). |
Hi I used to use .ipynb like everyone else when there was no other choice; howeer when given the chance I went for text-based format only - i.e. not paired with ipynb at all - because it solved so many irritating issued in one stone: easier diffs; easier editions with a text editor for massive replacements or other cleanups; and getting of the outputs that I never want to keep - an opinionated choice, agreed at that point I've had a rather hesitating period as to which format I would use I think it's ok if not every single myst-specific trick is supported, i.e. if some second-order niceties won't render too well; using such features for crucial parts would seem a little premature imho as of now at least what I do expect though would be the ability to drop my master notebooks into cocalc as-is, without the need for transcoding first; so what I miss most is not so much the menu that you outline in the first post; instead it would be to have cocalc find out that a given .py or .md file is actually a notebook, and open it as such on its own; all this of course is just my take on this, hope this helps though |
I have been playing a bit with JupyterBook (actually, just using Sphinx with the MyST extensions) and think that MyST is a very reasonable option. For example, it might be nice to include MyST support for regular Markdown files which could then be quite easily turned into other forms of documentation. |
I've done some myst-related investigation and made a ticket here about steps toward iteratively supporting myst: #5948 |
In the meantime, are there a "on save" or "on refresh" hooks we could use to run jupytext whenever CoCalc saves or refreshes a notebook? |
No, but if there were can you remind me how you might want to configure them? When I asked phind.com (so GPT-4) it suggests that the only way to do this in Jupyter now is via writing a custom extension: https://www.phind.com/search?cache=c76fba51-8385-4427-8108-e40c05a70121 so maybe there is no standard way. Have you considered using the unix |
Jupytext adds a menu like this:
So we would add a similar menu and on the backend we would add an extra hook that runs jupytext after saving to ipynb (and when loading as well).
There's an interesting discussion about notebook formats here, and my takeaway is that the best thing for cocalc to do is just make it as easy as possible for people to use jupytext. Another ticket motivated by that discussion would be to use nbdime (and/or jupytext?) to improve the diff view of our TimeTravel viewer for Jupyter notebooks.
The text was updated successfully, but these errors were encountered: