--- title: "Package Documentation" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Package Documentation} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) ``` Many times in documentation there is a lot to say, but you do not want to overwhelm the user. To solve this we can use folding blocks in the documentation (which are then rendered into pkgdown website automatically) To enable this feature add `Roxygen: list(markdown = TRUE)` to the DESCRIPTION file before rendering the roxygen2 You can use this feature by wrapping documentation with the macros ``` \foldstart{[SUMMARY TEXT]} #' DOCUMENTATION #' ... #' DOCUMENTATION \foldend ``` The `SUMMARY_TEXT` is optional, where the folded block will have a header of __your text__. The default will display __details__. These folded blocks can be inserted anywhere in the documentation, eg `@description`, `@param`, `@details`, `@return`, ....