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

makeDependencyRelative

Make an absolute dependency relative


Description

Change a dependency's absolute path to be relative to one of its parent directories.

Usage

makeDependencyRelative(dependency, basepath, mustWork = TRUE)

Arguments

dependency

A single HTML dependency with an absolute path.

basepath

The path to the directory that dependency should be made relative to.

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.

Value

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

If baspath did not appear to be a parent directory of the dependency's directory, an error is raised (regardless of the value of mustWork).

See Also


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.