| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/utils-vignettes.R |
| 3 |
\name{vignette_engines} |
| 4 |
\alias{vignette_engines} |
| 5 |
\title{Package vignette engines} |
| 6 |
\description{ |
| 7 |
Since R 3.0.0, package vignettes can use non-Sweave engines, and \pkg{knitr} |
| 8 |
has provided a few engines to compile vignettes via \code{\link{knit}()} with |
| 9 |
different templates. See \url{https://yihui.org/knitr/demo/vignette/} for |
| 10 |
more information. |
| 11 |
} |
| 12 |
\note{ |
| 13 |
If you use the \code{knitr::rmarkdown} engine, please make sure that |
| 14 |
you put \pkg{rmarkdown} in the \samp{Suggests} field of your |
| 15 |
\file{DESCRIPTION} file. Also make sure \command{pandoc} is available |
| 16 |
during \command{R CMD build}. If you build your package from RStudio, this |
| 17 |
is normally not a problem. If you build the package outside RStudio, run |
| 18 |
\code{rmarkdown::find_pandoc()} in an R session to check if Pandoc can be |
| 19 |
found. |
| 20 |
|
| 21 |
When the \pkg{rmarkdown} package is not installed or not available, or |
| 22 |
\command{pandoc} cannot be found, the \code{knitr::rmarkdown} engine will |
| 23 |
fall back to the \code{knitr::knitr} engine, which uses R Markdown v1 based |
| 24 |
on the \pkg{markdown} package. |
| 25 |
} |
| 26 |
\examples{ |
| 27 |
library(knitr) |
| 28 |
vig_list = tools::vignetteEngine(package = "knitr") |
| 29 |
str(vig_list) |
| 30 |
vig_list[["knitr::knitr"]][c("weave", "tangle")] |
| 31 |
vig_list[["knitr::knitr_notangle"]][c("weave", "tangle")] |
| 32 |
vig_list[["knitr::docco_classic"]][c("weave", "tangle")] |
| 33 |
} |