| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/utils.R |
| 3 |
\name{vest} |
| 4 |
\alias{vest} |
| 5 |
\title{Add CSS/JS assets to HTML output} |
| 6 |
\usage{ |
| 7 |
vest(feature = NULL, css = NULL, js = NULL) |
| 8 |
} |
| 9 |
\arguments{ |
| 10 |
\item{feature}{A character vector of features supported by CSS/JS, e.g., |
| 11 |
\code{c('article', 'callout')}. See the row names of \code{litedown:::assets} for all |
| 12 |
available features. Each feature will be mapped to CSS/JS.} |
| 13 |
|
| 14 |
\item{css, js}{Character vectors of CSS/JS assets.} |
| 15 |
} |
| 16 |
\value{ |
| 17 |
A vector of \verb{<link>} (CSS) or \verb{<script>} (JS) tags. |
| 18 |
} |
| 19 |
\description{ |
| 20 |
While CSS/JS assets can be set via the \code{css}/\code{js} keys under the \code{meta} field |
| 21 |
of the \code{html} output format in YAML, this function provides another way to |
| 22 |
add them, which can be called in a code chunk to dynamically add assets. |
| 23 |
} |
| 24 |
\examples{ |
| 25 |
litedown:::assets[, -1] |
| 26 |
# add features |
| 27 |
litedown::vest(c("copy-button", "tabsets")) |
| 28 |
# add css/js directly |
| 29 |
litedown::vest(css = "@tabsets", js = c("@tabsets", "@fold-details")) |
| 30 |
} |