notedown
notedown copied to clipboard
Support the Jupyter (IPython) R kernel
Project Jupyter now supports a R kernel (https://github.com/IRkernel/IRkernel) It would be nice to support this in translating Rmd to ipynb by removing the %%R magics in the cells and then adding the R specific metadata and language_info such as
"metadata": { "kernelspec": { "display_name": "R", "language": "", "name": "ir" }, "language_info": { "codemirror_mode": "r", "file_extension": ".r", "mimetype": "text/x-r-source", "name": "R", "pygments_lexer": "r", "version": "3.1.3" }
Agreed, this would be good. I'd like to maintain compatibility with the %%R
magic though.
Perhaps we could use the --rmagic
flag to toggle the behavior, i.e. use the R kernel with
notedown input.Rmd --knit
but use %%R
with
notedown input.Rmd --knit --rmagic
That sounds like a good plan. Thanks!
Don
On Sun, May 31, 2015 at 12:58 PM, aaren [email protected] wrote:
Agreed, this would be good. I'd like to maintain compatibility with the %%R magic though.
Perhaps we could use the --rmagic flag to toggle the behavior, i.e. use the R kernel with
notedown input.Rmd --knit
but use %%R with
notedown input.Rmd --knit --rmagic
— Reply to this email directly or view it on GitHub https://github.com/aaren/notedown/issues/24#issuecomment-107240313.
On a similar point, will it support Julia code embedded in markdown?
@sje30 if I implement this it will be for the general case. If there is a Jupyter kernel written for the language then it should work.
Todo list for this:
- [x] install R kernel on my machine for testing (http://irkernel.github.io/installation/)
- [ ] add a
--kernel
argument that defaults to python - [ ] set the language metadata when creating an internal notebook
- [ ] kernelspec
- [ ] language_info
- [ ] check whether this kernel spec is used when using
--run
- [ ] allow setting metadata in a markdown yaml header?
Great, let me know if you need help. There is a Julia kernel for Jupyter.
I'm probably not going to get around to this in the next couple of months unless I do some good procrastinating. Feel free to make a pull request in the meantime. The above list would be a good guideline.