roxygen2 icon indicating copy to clipboard operation
roxygen2 copied to clipboard

Ability to use `inherit` to import contents but not overwrite

Open alisonmosky opened this issue 2 years ago • 2 comments

I would like to be able to essentially import the details from another function into the current function I'm documenting.

What i'm hoping for is something like

`@details This function is a wrapper function for function_A. After retrieving the data from function_A, this function further wrangles the data.... Details for the logic flow of function_A are shown below:

`@inherit function_A details

This does not work. I either have to copy paste the details section from the other function or ONLY inherit the details from that function.

Is there any way around this? Maybe @inherit function_A details as @newsection so that you can inherit the contents but rename it?

alisonmosky avatar Jan 25 '24 17:01 alisonmosky

I need something similar too.

What I want is to @inherit other_function examples and add a few more lines of code there.

The following does not work:

#' @inherit other_function examples
#'
#' # Adding additional code at the end of examples inherited above
#' my_function(
#'   arg1 = "bla bla bla",
#'   arg2 = FALSE
#' )

yurovska avatar Oct 03 '24 14:10 yurovska

Same use case as @yurovska for me, would love to be able to inherit examples from another function docs and add more code as examples

sckott avatar Nov 04 '24 21:11 sckott