bundle_resources: Automatically serve golem external resources

Description Usage Arguments Details Value

View source: R/bundle_resources.R

Description

This function is a wrapper around htmltools::htmlDependency that automatically bundles the CSS and JavaScript files in inst/app/www and which are created by golem::add_css_file() , golem::add_js_file() and golem::add_js_handler().

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
bundle_resources(
  path,
  app_title,
  name = "golem_resources",
  version = "0.0.1",
  meta = NULL,
  head = NULL,
  attachment = NULL,
  package = NULL,
  all_files = TRUE,
  app_builder = "golem"
)

Arguments

path

The path to the folder where the external files are located.

app_title

The title of the app, to be used as an application title.

name

Library name

version

Library version

meta

Named list of meta tags to insert into document head

head

Arbitrary lines of HTML to insert into the document head

attachment

Attachment(s) to include within the document head. See Details.

package

An R package name to indicate where to find the src directory when src is a relative path (see resolveDependencies).

all_files

Whether all files under the src directory are dependency files. If FALSE, only the files specified in script, stylesheet, and attachment are treated as dependency files.

app_builder

The name of the app builder to add as a meta tag. Turn to NULL if you don't want this meta tag to be included.

Details

This function also preload activate_js() which allows to use preconfigured JavaScript functions via invoke_js().

Value

an htmlDependency


golem documentation built on April 17, 2021, 9:06 a.m.