Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

copyDependencyToDir

Copy an HTML dependency to a directory


Description

Copies an HTML dependency to a subdirectory of the given directory. The subdirectory name will be name-version (for example, "outputDir/jquery-1.11.0"). You may set options(htmltools.dir.version = FALSE) to suppress the version number in the subdirectory name.

Usage

copyDependencyToDir(dependency, outputDir, mustWork = TRUE)

Arguments

dependency

A single HTML dependency object.

outputDir

The directory in which a subdirectory should be created for this dependency.

mustWork

If TRUE and dependency does not point to a directory on disk (but rather a URL location), an error is raised. If FALSE then non-disk dependencies are returned without modification.

Details

In order for disk-based dependencies to work with static HTML files, it's generally necessary to copy them to either the directory of the referencing HTML file, or to a subdirectory of that directory. This function makes it easier to perform that copy.

Value

The dependency with its src value updated to the new location's absolute path.

See Also

makeDependencyRelative can be used with the returned value to make the path relative to a specific directory.


htmltools

Tools for HTML

v0.5.1.1
GPL (>= 2)
Authors
Joe Cheng [aut], Carson Sievert [aut, cre] (<https://orcid.org/0000-0002-4958-2844>), Winston Chang [aut], Yihui Xie [aut], Jeff Allen [aut], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.