check_pandoc: Check the existence of pandoc

View source: R/check_pandoc.R

check_pandocR Documentation

Check the existence of pandoc

Description

This function adds context to rmarkdown::pandoc_available() and provides an error message directing the user to download the latest version of pandoc or RStudio Desktop.

Usage

check_pandoc(quiet = TRUE, pv = "2.11", rv = "1.4")

Arguments

quiet

if TRUE, no message will be emitted, otherwise the pandoc version and path will be sent as a message (stderr) to the screen.

pv

the minimum pandoc version

rv

the minimum rstudio version (if available)

Examples

# NOTE: this is an internal function, so there is no guarantee that the usage
# will remain the same across time. This is merely for demonstration purposes
# only.

# Check for pandoc ----------------------
asNamespace("sandpaper")$check_pandoc(quiet = FALSE)

# Message emitted when pandoc cannot be found --------
try(asNamespace("sandpaper")$check_pandoc(quiet = FALSE, pv = "999"))

zkamvar/sandpaper documentation built on April 21, 2024, 1:17 a.m.