Closed mpadge closed 3 years ago
roxygen blocks have to be in code chunks. The question is how best to parse them? The minimal-lines-of-code approach would be:
roxygen
knitr::purl ("README.Rmd", output = "temp.R") # or whatever roxygen2::parse_file ("temp.R", env = NULL)
BUT that only gives the line numbers of the chunk-only contents put into "temp.R". Those would still need to be matched back on to the original .Rmd file anyway, so it's probably easier and better to simply write a direct parser to do the job.
"temp.R"
.Rmd
roxygen
blocks have to be in code chunks. The question is how best to parse them? The minimal-lines-of-code approach would be:BUT that only gives the line numbers of the chunk-only contents put into
"temp.R"
. Those would still need to be matched back on to the original.Rmd
file anyway, so it's probably easier and better to simply write a direct parser to do the job.