vest: Add CSS/JS assets to HTML output

View source: R/utils.R

vestR Documentation

Add CSS/JS assets to HTML output

Description

While CSS/JS assets can be set via the css/js keys under the meta field of the html output format in YAML, this function provides another way to add them, which can be called in a code chunk to dynamically add assets.

Usage

vest(feature = NULL, css = NULL, js = NULL)

Arguments

feature

A character vector of features supported by CSS/JS, e.g., c('article', 'callout'). See the row names of litedown:::assets for all available features. Each feature will be mapped to CSS/JS.

css, js

Character vectors of CSS/JS assets.

Value

A vector of ⁠<link>⁠ (CSS) or ⁠<script>⁠ (JS) tags.

Examples

litedown:::assets[, -1]
# add features
litedown::vest(c("copy-button", "tabsets"))
# add css/js directly
litedown::vest(css = "@tabsets", js = c("@tabsets", "@fold-details"))

litedown documentation built on April 12, 2025, 1:34 a.m.