HTML Page as a String

Description

Create a full HTML page as a string, for servers that send strings rather than tags, such as plumber2, ambiorix, or nanonext. The page loads the stylesheet and the scripts your components need.

Usage

bc_page(
  ...,
  title = NULL,
  assets = "/basecoat/",
  style = NULL,
  theme = NULL,
  head = NULL,
  lang = "en"
)

Arguments

Argument Description
... Page content.
title String. The page title.
assets String. The URL the bundled Basecoat files are served from. Defaults to "/basecoat/".
style String or NULL. A style pack, as in bc_deps().
theme String or NULL. Path to a CSS file of your own. It loads after the style pack, so its tokens take precedence.
head Tag or NULL. Extra content for the page head, such as the htmx script.
lang String. The page language. Defaults to "en".

Value

A single string.

Details

Serve system.file("basecoat", package = "basecoat") at the assets URL.

The theme file is written into the page, so you do not need to serve it.

See Also

bc_deps(), bc_page_sidebar(), bc_page_navbar()

Examples

cat(substr(bc_page(bc_button("Save"), title = "Demo"), 1, 80))
#> <!doctype html>
#> <html lang="en">
#> <head>
#> <meta charset="utf-8">
#> <title>Demo</titl

theme <- system.file("examples", "tweakcn-theme.css", package = "basecoat")
page <- bc_page(bc_button("Save"), theme = theme)