grunwaldlab / Reproducible-science-in-R

This site provides information on conducting reproducible science using the R language.
http://grunwaldlab.github.io/Reproducible-science-in-R/
13 stars 8 forks source link

utilize knitr hooks to show rmarkdown chunks? #1

Closed zkamvar closed 8 years ago

zkamvar commented 8 years ago

From this gist: https://gist.github.com/jennybc/8add4496cbef43324c59 To this post: https://ramnathv.github.io/posts/verbatim-chunks-knitr/

zachary-foster commented 8 years ago

Good idea, but I do not think that the strategy used in the links above will work. It can show a chunk and its output, but it does not show the result of rendering markdown code. The fundamental problem is that we want show rendered markdown as well as R chunks, whereas the examples you cite only reproduce the chunk syntax when displaying the source code; they cannot display markdown. What is really needed is a knitr language engine for RMarkdown, so that you can write Rmarkdown within a chunk. I expect that this is not implemented since this would require recursive rendering, because there could be chunks nested within chunks. Plus, the syntax would be a mess.

If the goal is to have the example RMarkdown be part of the tutorial RMarkdown, rather than an argument to a function in a chunk, then we need a way to delineate the two. Although, this could be done with HTML tags and a lot of copying and pasting, I do not see a way of doing it in a way that we could easily apply changes to whole documents. As far as I can see, the only way to do this is to use a function, and the only way to include a function is in an R chunk.

However, if the overall goal is to get rid of iframes, then I think that can be done in other ways.

zachary-foster commented 8 years ago

This was resolved in our meeting today. Closing...