with_pandoc_version {pandoc} | R Documentation |
Execute any code with a specific Pandoc version
Description
This function allows to run any R code by changing the active pandoc version to use without modifying the R session state.
Usage
with_pandoc_version(
version,
code,
rmarkdown = getOption("pandoc.activate_rmarkdown", TRUE)
)
local_pandoc_version(
version,
rmarkdown = getOption("pandoc.activate_rmarkdown", TRUE),
.local_envir = parent.frame()
)
Arguments
version |
This can be either:
|
code |
Code to execute with the temporary active Pandoc version. |
rmarkdown |
if |
.local_envir |
The environment to use for scoping. |
Details
This is inspired from withr package.
Value
The results of the evaluation of the code
argument.
Examples
# Run with pandoc without activating the version for rmarkdown::render()
with_pandoc_version("system",
pandoc_bin(),
rmarkdown = FALSE
)
with_pandoc_version("2.11.4", rmarkdown::find_pandoc(), rmarkdown = TRUE)
local({
local_pandoc_version("2.11.4")
pandoc::pandoc_locate()
rmarkdown::find_pandoc()
})
rmarkdown::find_pandoc()
[Package pandoc version 0.2.0 Index]