add_dependency.Rd
Adds a dependency (external reference) to an R Markdown document.
add_dependency(name, version, file = NULL, path = NULL, packages = c("rmarkdown", "xaringan", "surprisinglytidy"), fullpath = NULL, attach = TRUE)
name | |
---|---|
version | |
file | Filename of script or stylesheet. |
path | Path within the package.
Ignored if |
packages | A vector of package names to search for the file.
Ignored if |
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. |
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.
# 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 ) # }