Learn R Programming

htmltools (version 0.2.4)

htmlDependency: Define an HTML dependency

Description

Define an HTML dependency (i.e. CSS and/or JavaScript bundled in a directory). HTML dependencies make it possible to use libraries like jQuery, Bootstrap, and d3 in a more composable and portable way than simply using script, link, and style tags.

Usage

htmlDependency(name, version, src, meta = NULL, script = NULL,
  stylesheet = NULL, head = NULL)

Arguments

name
Library name
version
Library version
src
Unnamed single-element character vector indicating the full path of the library directory. Alternatively, a named character string with one or more elements, indicating different places to find the library; see Details.
meta
Named list of meta tags to insert into document head
script
Script(s) to include within the document head (should be specified relative to the path parameter).
stylesheet
Stylesheet(s) to include within the document (should be specified relative to the path parameter).
head
Arbitrary lines of HTML to insert into the document head

Value

Details

Each dependency can be located on the filesystem, at a relative or absolute URL, or both. The location types are indicated using the names of the src character vector: file for filesystem directory, href for URL. For example, a dependency that was both on disk and at a URL might use src = c(file=filepath, href=url).

See Also

Use attachDependencies to associate a list of dependencies with the HTML it belongs with.