add_dependency: Add a dependency

Description Usage Arguments Details Examples

View source: R/sassy.R

Description

Adds a dependency (external reference) to an R Markdown document.

Usage

1
2
3
add_dependency(name, version, file = NULL, path = NULL,
  packages = c("rmarkdown", "xaringan", "surprisinglytidy"),
  fullpath = NULL, attach = TRUE)

Arguments

name

See htmltools::htmlDependency.

version

See htmltools::htmlDependency.

file

Filename of script or stylesheet.

path

Path within the package. Ignored if fullpath is specified.

packages

A vector of package names to search for the file. Ignored if fullpath is specified.

fullpath

Full path (relative or absolute) of file (all but filename).

attach

If TRUE, attaches the dependency. If FALSE, returns the htmlDependency object to be attached.

Details

Inspired by this guy. Must specify file (for package system files) or fullpath. path is optional, to specify a path for a package system file.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
add_dependency(
  "testy-css",
  packageVersion("surprisinglytidy"),
  file = "testy.css",
  path = "rmd/h/css"
)
add_dependency(
  "foo",
  "0.0.1",
  fullpath = "./bar.js" # same folder as .Rmd file
)

## End(Not run)

BenjaminWolfe/surprisinglytidy documentation built on Nov. 22, 2019, 11:37 a.m.