pandoc_available: Check pandoc availability and version

Description Usage Arguments Details Value Examples

View source: R/pandoc.R

Description

Determine whether pandoc is currently available on the system (optionally checking for a specific version or greater). Determine the specific version of pandoc available.

Usage

1
2
3

Arguments

version

Required version of pandoc

error

Whether to signal an error if pandoc with the required version is not found

Details

The system environment variable PATH as well as the version of pandoc shipped with RStudio (its location is set via the environment variable RSTUDIO_PANDOC by RStudio products like the RStudio IDE, RStudio Server, Shiny Server, and RStudio Connect, etc) are scanned for pandoc and the highest version available is used. Please do not modify the environment variable RSTUDIO_PANDOC unless you know what it means.

Value

pandoc_available returns a logical indicating whether the required version of pandoc is available. pandoc_version returns a numeric_version with the version of pandoc found.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
library(rmarkdown)

if (pandoc_available())
  cat("pandoc", as.character(pandoc_version()), "is available!\n")

if (pandoc_available("1.12.3"))
  cat("required version of pandoc is available!\n")

## End(Not run)

Example output

sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied

rmarkdown documentation built on Oct. 23, 2020, 8:03 p.m.