box::use(glue[glue])
.on_load <- function(ns) {
box::use(cli[cli_h1, cli_div])
module_name <- box::name()
cli_div(theme = list(span.emph = list(color = "orange")))
cli_h1(
'Loading module "{.emph {module_name}}"'
)
use_here_directory()
}
# Set directory, then load modules without
# relative path
# i.e. box::use(. / a / module)
# vs. box::use(a / module)
use_here_directory <- function() {
box::use(cli[cli_h1, cli_alert_info, cli_alert_success, cli_alert_danger])
box::use(here[here])
options(box.path = here())
if(!is.null(getOption('box.path'))) {
cli_alert_success(
glue("Box directory set to here() directory: {getOption('box.path')}")
)
cli_alert_info("Load local modules with the relative path './'")
} else {
cli_alert_danger("Failure to set box.path")
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.