To use an R Markdown file as a vignette, you need to specify an output format appropriate for inclusion in a package (for example, the lightweight html_vignette() output function included in rmarkdown) and to specify the vignette field, which specifies the title, engine, and encoding type of the vignette. See also usethis::use_vignette() for setting up a package vignette.

yml_vignette(.yml, title, engine = "knitr::rmarkdown", encoding = "UTF-8")

Arguments

.yml

a yml object created by yml(), as_yml(), or returned by a yml_*() function

title

The title of the vignette

engine

The rendering engine for the vignette ("knitr::rmarkdown" by default)

encoding

The character encoding for the document ("UTF-8" by default).

Value

a yml object

Examples


yml() %>%
  yml_output(html_vignette()) %>%
  yml_vignette("An introduction to R Markdown")
#> ---
#> date: '`r format(Sys.Date())`'
#> output: html_vignette
#> vignette: "%\\VignetteIndexEntry{An introduction to R Markdown} \n    %\\VignetteEngine{knitr::rmarkdown}
#>   \n    %\\VignetteEncoding{UTF-8})"
#> ---
#>