roc_eval_text: Generate Rd from text with evaluated inline code and code...

View source: R/roc_eval_functions.R

roc_eval_textR Documentation

Generate Rd from text with evaluated inline code and code blocks

Description

roc_eval_text is an upgraded version of roc_proc_text that evaluates inline and block code before generating Rd.

Usage

roc_eval_text(roclet, input)

Arguments

roclet

Name of roclet to use for processing.

input

Source string

Value

List with names as fun_name.Rd, where each element is the RoxyTopic for the corresponding function, same as the return of roc_proc_text.

Note

Change log:

  • 0.1.0 Xiurui Zhu - Initiate the function.

Author(s)

Xiurui Zhu

Examples

# Formulate a text version of a function with documentation
fun_text <- '
#\' \\code{iris} is a `r nrow(iris)`-row matrix.
#\'
#\' \\code{iris} matrix has
#\' ```{r results="hold"}
#\' ncol(iris)
#\' ```
#\' columns.
print_iris <- function() iris
'

# Parse the 'roxygen' comments to Rd documentation
roc_eval_text(roxygen2::rd_roclet(), fun_text)[[1L]]

roclang documentation built on May 31, 2023, 8:44 p.m.