-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
generate roxygen from R code? #645
Comments
And |
Right, it would return a string (or character vector to be joined with newlines). E.g. suppose we had for the above: roxygen_parameter <- function(default) {
paste("#' @param db The database to use. Defaults to", default)
} then, after pre-processing #' @eval roxygen_parameter(default = "RSQLite") we would just have #' @param db The database to use. Defaults to RSQLite. and then the rest of the roxygen machinery would run as-is. |
This will have to work like |
This has to be implemented at a lower-level (i.e. in the parser) than This will add recursion to the parsing system, but I think that will only cause problems if you do something crazy like You might argue that |
FWIW, I think E.g. someone who really wanted the template approach could probably do something like this: roxygen_parameter <- function(default) {
roxygen_template("man-roxygen/my-template.R", default)
} where |
It'd be nice if we could have something like
@evalRd
, but@evalRoxygen
, which takes the output of some R function and treats it as though it were part of the current Roxygen block. For example, suppose you were documenting the same function multiple times, but it took different default arguments in different functions. It'd be nice to be able to write:In this case,
roxygen_parameter()
is some function defined by the user in the package's namespace, and the output of that function is used to generate the documentation.The text was updated successfully, but these errors were encountered: