yml_output() writes valid YAML for the output field of R Markdown YAML. yml_output() captures the actual output functions, such as pdf_document(), and translates them to YAML. This function accepts multiple output formats (separated by commas) and validates each by evaluating the function internally. The YAML fields in under output come from arguments in their respective R functions. If you wanted to see the available fields in pdf_document(), for instance, you would read the documentation for that function using ?pdf_document.

yml_output(.yml, ...)

Arguments

.yml

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

...

valid R code calling functions that return objects of class rmarkdown_output_format, such as the *_document() functions in rmarkdown.

Value

a yml object

Examples

# \donttest{
yml() %>%
  yml_output(html_document())
#> ---
#> date: '`r format(Sys.Date())`'
#> output: html_document
#> ---
#> 

yml() %>%
  yml_output(
    pdf_document(keep_tex = TRUE, includes = includes2(after_body = "footer.tex")),
    bookdown::html_document2()
  )
#> ---
#> date: '`r format(Sys.Date())`'
#> output:
#>   pdf_document:
#>     keep_tex: true
#>     includes:
#>       after_body: footer.tex
#>   bookdown::html_document2: default
#> ---
#> 
# }