nteract icon indicating copy to clipboard operation
nteract copied to clipboard

Convert from R Markdown and Markdown to in-memory notebook

Open rgbkrk opened this issue 8 years ago • 9 comments

Either in commutable or a new package, provide a way to convert to our in memory model.

rgbkrk avatar Feb 16 '17 04:02 rgbkrk

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 12 '18 21:04 stale[bot]

This has come up again as I've been asked about supporting R Markdown in our jupyter extension.

rgbkrk avatar Apr 13 '18 17:04 rgbkrk

Just chiming in to say I think this would be a really worthwhile feature. RStudio is at a level of complexity now where those of us who teach R are on the hunt for simpler tools. There's a lot of teaching material out there in Rmd form.

MilesMcBain avatar Jun 22 '18 00:06 MilesMcBain

Hey @rgbkrk I would really love to try and help support this if I can--do you think this would be a 'first PR' kind of task? I would need some help/guidance (since I mostly do analysis work in R) but I'd really love to make the .Rmd file extension an executable in nteract 🙌

I've really loved this app for a long time now and think it would be really neat.

robertmitchellv avatar Jun 22 '18 16:06 robertmitchellv

Awesome! One approach could be to make reading from and writing to our in-memory format work well with rmarkdown. Then at least for now we can use the same UI and make sure to output to the right format.

That being said, I think we'd be missing a lot of knitr / code chunk options. Perhaps I'm overestimating that though?

One potential option -- if you'd like to go after this in person with folks we're holding the nteract global sprint at the end of July: https://github.com/nteract/global-sprint

rgbkrk avatar Jun 23 '18 22:06 rgbkrk

No, I think you're right about the knitr code chunk options--there are tons of ways these can be really useful. The tufte package is a good example of this with options for margin notes, full-width visualization, margin visualizations, etc. There's also the yaml headers that also contain very useful options for converting EDA to a bootstrap style HTML document with syntax highlighting and other options. These things are all wonderful, but they are only really needed during rendering, and there are R functions to do this outside of an IDE, so, I think there can be a workaround to get the best of both worlds (abstractly/generally; since I don't know how hard it would be to do this).

Is it possible to have rmarkdown supported (as you suggested above) where nteract knows to render rmarkdown as it would any notebook while ignoring most of the knitr options other than eval = F? Is it possible to have metadata associated with a code chunk so that nteract can operate from an Rmd file in a way that makes sense from the perspective that nteract was designed while also putting those pieces back together when finished? Sort of like abstracting the ipynb away from the user? Maybe like a .notebook.swp.ipynb while using the application that saves to .Rmd?1

I would love to come to Los Gatos but I don't think I'll be able to! I'll just be getting back from vacation and don't know if I'll have the option to take more time from work. I also feel like I'd be such a bad hackathon/sprint participant since I'm a -10x developer 😆

I'd need to be pointed in the right direction of how to start working on this and I would be working pretty slowly but in time I may have a good PR!


1: Please let me know if this makes sense or not--I'm hoping that I'm describing this in the right way.

robertmitchellv avatar Jun 27 '18 20:06 robertmitchellv

I like the option that @rgbkrk outlined of adding functionality in commutable to convert RMarkdown to our in-memory format.

@robertmitchellv I don't know much about the internals of the RMarkdown files but it should be possible to implement whatever customizations we want with respect to how an RMarkdown file is interpreted as long as it eventually maps with the in-memory format we store. I'm really intrigued and excited by the idea of nteract supporting multiple interactive document formats.

A god place to start would be to clean up the commutable package a little bit so the src directory contains a folder for jupyter and one for rmarkdown. Then it is down to determining how to map RMarkdown to the cells understood by markdown. The content of an RMarkdown can be converted to a singular Markdown cell. Code cells can be converted to code cells although as I understand it, outputs are not serialized in RMarkdown so we would have to account for that.

I understand this issue hasn't been active for a while but I was going through and triaging old things and was intrigued by the proposal here.

captainsafia avatar Apr 20 '19 02:04 captainsafia

This issue hasn't had any activity on it in the last 90 days. Unfortunately we don't get around to dealing with every issue that is opened. Instead of leaving issues open we're seeking to be transparent by closing issues that aren't being prioritized. If no other activity happens on this issue in one week, it will be closed. It's more than likely that just by me posting about this, the maintainers will take a closer look at these long forgotten issues to help evaluate what to do next. If you would like to see this issue get prioritized over others, there are multiple avenues 🗓:

  • Ask how you can help with this issue 👩🏿‍💻👨🏻‍💻
  • Help solve other issues the team is currently working on 👨🏾‍💻👩🏼‍💻
  • Donate to nteract so we can support developers to work on these features and bugs more regularly 💰🕐

Thank you!

stale[bot] avatar Feb 14 '20 02:02 stale[bot]

This issue hasn't had any activity on it in the last 90 days. Unfortunately we don't get around to dealing with every issue that is opened. Instead of leaving issues open we're seeking to be transparent by closing issues that aren't being prioritized. If no other activity happens on this issue in one week, it will be closed. It's more than likely that just by me posting about this, the maintainers will take a closer look at these long forgotten issues to help evaluate what to do next. If you would like to see this issue get prioritized over others, there are multiple avenues 🗓:

  • Ask how you can help with this issue 👩🏿‍💻👨🏻‍💻
  • Help solve other issues the team is currently working on 👨🏾‍💻👩🏼‍💻
  • Donate to nteract so we can support developers to work on these features and bugs more regularly 💰🕐

Thank you!

stale[bot] avatar Jan 09 '22 06:01 stale[bot]