File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,14 @@ knitr::opts_chunk$set(
1616 comment = "#>",
1717 eval = as.logical(Sys.getenv("CPP11_EVAL", "false"))
1818)
19+ knitr::knit_hooks$set(strip_roxygen = function(before, options, envir) {
20+ if (before) {
21+ code <- options$code
22+ code <- gsub("/\\* roxygen start.*?roxygen end \\*/", "", code, perl = TRUE)
23+ options$code <- code
24+ options
25+ }
26+ })
1927library(cpp11)
2028```
2129
@@ -354,7 +362,7 @@ This is easy to do in RMarkdown by using `{cpp11}` instead of `{r}` at the begin
354362It is possible to use ` roxygen2 ` to document your C++ functions. Here is an
355363example of how to do this:
356364
357- ``` {cpp11, eval = FALSE }
365+ ``` {cpp11, strip_roxygen = TRUE }
358366/* roxygen start
359367@title Mean of a numeric vector
360368@param x A numeric vector
You can’t perform that action at this time.
0 commit comments