Code Monkey home page Code Monkey logo

Comments (3)

mwouts avatar mwouts commented on May 22, 2024 2

Hello @jmcphers, it has been a while since we discussed this. In the meantime I have made significant progress on my project, and I officially announced it one month ago. As you can see, the project was very well received by the community of Jupyter users, as people were missing the text notebook functionality.

The project now includes a few other notebooks formats, and we can now represent notebooks as Python or R (or Julia, etc) scripts. Obviously this is somehow related to knit::spin's format.

The point I would like to discuss now with you is the following: while R Markdown can accept any language, (and is indeed a great format for Python code as well), the fact that the code options have to be coded in R make it

  • difficult to adopt by non R users
  • and difficult to parse in other languages than R (think of Python or even Javascript, which is used by many editors, like Hydrogen or VScode).

Among the formats for notebooks as scripts (documented here), we now have two formats that are almost language agnostic. For simplicity the cell metadata are represented using JSON in these formats.

Now my question: do you think it would be feasible to design a flavor of the R Markdown format with code options represented in a non R format (say, JSON)?

from jupytext.

jmcphers avatar jmcphers commented on May 22, 2024

Defining a shared notebook specification which serves the needs of users on both platforms while meeting the constraints laid out here is not impossible, but it's an ambitious undertaking!

Re: your last two bullet points, R Markdown notebooks can do this, too. If you save a notebook, a .nb.html file is generated. It's very Jupyter-like, a fully rendered HTML copy of the notebook, with outputs--and also embeds the original Rmd file. Using the .nb.html file to read outputs can give you the best of both worlds: version control on plain text, and a self-contained file with embedded outputs you can share or publish.

More on the R Notebook HTML format with embedded outputs here:

https://rmarkdown.rstudio.com/r_notebook_format.html

from jupytext.

mwouts avatar mwouts commented on May 22, 2024

Well, sure. A few more thoughts

  • R Markdown is by itself a great specification! What is missing is a standard way to translate Rmd chunk options into Jupyter cell metadata, which don't seem to be widely used.
  • Translating .Rmd to .ipynb works well with nbrmd. There are also a few alternative around: see https://github.com/aaren/notedown and https://github.com/grst/ipymd .
  • Getting a notebook to be fully executable with both Jupyter and RStudio works only to a certain extend. I expect it to work well if
    • notebook is 100% R
    • or 100% python, with no cell magics. Matplotlib plots are supported, but javascript plots are not yet working.

from jupytext.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.