Closed cderv closed 4 years ago
There is now mention of knitr::purl
with 080653dacf35a9e402e6db3b7a06653f60206ec7
We can also mention hook_purl()
https://stackoverflow.com/questions/54796421/rmarkdown-knitrpurl-on-python-code-chunk
Might be an interesting extension
This is covered here https://bookdown.org/yihui/rmarkdown-cookbook/purl.html @yihui do you want to cover anything else on this ?
Otherwise, this can be closed.
knitr needs to support purl()
for other languages, but it is hard. I think this issue could be closed, even though knitr needs to be improved.
I always found that this is a hidden gem. I discovered it a long time ago in @yihui's blog post about a package with literate programming.
I would find it useful in the cookbook to talk about how to extract R code for a Rmd file using
knitr::purl
orknitr::knitr(..., tangle = TRUE)
, with the use of the chunk optionpurl = FALSE
to exclude some chunks.It could also be mentioned in the hook part because there is an
hook_purl()
hook. See help fileI think it is a powerful option worth mentionning.
Related knitr example