jupytext
jupytext copied to clipboard
Support jmd and Script Format of Weave.jl
I wonder if there could be support for converting and pairing for jmd and Script format of Weave.jl. Note that the latter is also used in Pweave and Knitr.
Hi @matrix-ranger, thanks for this nice question!
At the moment there is no support for the weave.jl formats. From what I can see from the links above, the jmd format is quite similar to the Rmd format (which is supported). Is a jmd file renamed to Rmd a valid R-Markdown file? If so yes maybe we could do something for that one :smile:
Regarding the julia script format, again it looks similar to the R spin scripts, which are supported. If someone with experience of weave confirms the identify we could indeed try to extend that format to Julia as well.
Finally, I'd be curious to know your reasons for preferring the Weave formats over the MyST Markdown (md:myst), the plain Markdown (md) or the jl:light or jl:percent formats that already exist in Jupytext? Do we agree that converting existing text notebooks to ipynb and then to these formats is technically feasible (and the other way around)?
Yes indeed. jmd and Rmd have almost the same formats and renaming works. So do julia scripts and R spin scripts. But I can't find the support for R spin scripts. I can't see it in the menu options of Jupytext in Jupyter Notebook.
Actually I like percent format more. It is clearer and more comfortable but AFAIK you can't directly add options for code cells in that format (hope I am wrong on this). I think it is also a limitation for Jupyter notebooks. I haven't tried MyST as I thought it was designed for rST users. Rmd/jmd seems to be the only one that can specify options per code cell other than the script format I mentioned so I usually write in Rmd and use knitr or rename and use weave.jl to get tex and then pdf. Meanwhile I use ipynb for presentation or saving intermediate results.
In general converting back and forth is feasible, but there are some limitations. Converting to ipynb from Rmd loses the cell options and when you convert back the options written previously are no longer there. (I find no solution for that. Maybe I will open up a new issue.). The other way around would lose the running outputs. (Thanks to Jupytext, we can pair them now).
Another thing to mention is that jmd supports more syntax than Rmd like you don't need to wrap the cell header in {} and you can use ; instead of , there. If you write in Rmd and rename to jmd, it would normally work. But the other way around is not guaranteed.
Good to know! Then it would be very helpful if you could provide a sample .jmd file with all the cell headers that you'd like to see supported. Thanks
may I suggest adding support for specific cell headers on request?