Retrieve the value block of a custom section tagged via roxygen2
vt_scrape_section.Rd
Looks for the value in a custom roxygen sections. Custom
sections are named using @section <NAME>:
, where colon is use to indicate
end of the name, and value starts on next line.
Examples
roxy_block1 <- c("@title Title1", "@param param1 definition",
"@section Last updated date:", "2021-01-01", "@importFrom utils sessionInfo",
"@export" )
vt_scrape_section("Last updated date:", roxy_block1)
#> [1] "2021-01-01"
roxy_block2 <- paste0("#' ", roxy_block1)
vt_scrape_section("Last updated date:", roxy_block2)
#> [1] "2021-01-01"