ropensci-review-tools / srr

Software Review Roclets
https://docs.ropensci.org/srr/
Other
4 stars 2 forks source link

Implement and document .Rmd parsing #3

Closed mpadge closed 3 years ago

mpadge commented 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:

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.