roxygen2
roxygen2 copied to clipboard
context-aware @evalRd?
We've got an Rd helper that takes the name of the attached function as an argument:
https://github.com/r-lib/lintr/blob/ab5ab94b0ef33c7c66f270b4dd2b4b10cea53840/R/class_equals_linter.R#L10-L13
essentially
#' @evalRd rd_tags("class_equals_linter")
class_equals_linter <- function() {
}
This works well, but the problem I've noticed is when we sometimes rename the function, it's easy to forget to update the name twice.
This could be avoided if @evalRd
was context aware. I'm thinking like .onLoad
/ .onAttach
get the package/lib name along, the @evalRd
execution could "receive" some metadata as well.
I'm not sure the right API for this (maybe it needs to be a new @
token?) but it would save us some inconvenience.
Relate to to #1243. We could probably add some new equivalent to roxy_meta_get()
that provided information about the current block.
Great! feel free to close if you think this is fully subsumed by that issue (it may or may not be)