vatlab / sos-notebook

Multi-language Jupyter Notebook
http://vatlab.github.io/SoS
BSD 3-Clause "New" or "Revised" License
176 stars 17 forks source link

A .rmd to sos notebook converter #197

Closed BoPeng closed 5 years ago

BoPeng commented 5 years ago

It would be helpful to write a good .rmd to .ipynb converter that can convert most Rmarkdown reports to SoS notebooks. Generally, we need to

  1. parse markdown and insert markdown to either pure markdown cell or markdown code cell
  2. convert code to code cell
  3. pay attention to meta data and other features of Rmarkdown

This will help users convert existing projects done by Rstudio to Jupyter notebook for sharing and/or archive purposes.

gaow commented 5 years ago

This will help users convert existing projects done by Rstudio to Jupyter notebook for sharing and/or archive purposes.

Okay I was looking for the motivations of this request. I can see one nice user case, for example, with this mechanism people can easily render Rmd file to a Jupyter Hub server for users to interactively play with them. You can imaging asking for example the bioconductor community to share their Rmd files by depositing it to a notebook server (that we provide) where they get converted to notebooks like those on our live server, and users can play with them. The authors themselves will still work on the Rmd source files if they need to edit them.

It would be even nicer if somehow users can contribute by editing Rmd files -- ie, some backwards conversion? Currently people can edit SoS notebooks on the server and use !create-pr to contribute. This is a neat mechanism. But it is hard to do with Rmd source material.

Again, possibly some other literate programming platforms (that we exchanged info offline) is perhaps a neater solution: eg, on the left panel people edit Rmd files, and see the results rendered on the right panel.

BoPeng commented 5 years ago

Note that we already have a .rmd to .ipynb converter, but it is very basic and not well tested. We should create a reasonably complex .rmd document (e.g. with options to code blocks and with inline expressions), decide how to convert each piece to Jupyter notebook, implement the converter, test each feature separately, and document it properly.

BoPeng commented 5 years ago

Separated to sos-rmarkdown module.