View source: R/extract_roxygen2.R
| extract_roxygen2 | R Documentation | 
This function takes a character vector containing the lines of a function definition and returns a character string containing only the lines belonging to the roxygen2 documentation (lines starting with "#'").
extract_roxygen2(func_def)
func_def | 
 A character vector containing the lines of a function definition  | 
A character string containing the roxygen2 documentation lines
func_def <- c(
  "#' Extracts object from a response list",
  "#'",
  "#' @export",
  "object <- function(response) {",
  "  if (!is.list(response)) {",
  "    stop('Invalid response format. Expected list object.')",
  "  }",
  "}")
roxygen2_docu <- extract_roxygen2(func_def)
print(roxygen2_docu)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.