HTMLPlugin: HTML Application

Description Usage Arguments Functions Super classes Methods

Description

This application's primary purpose is to serve HTML to its users as a front-end application.

Usage

1
autoreload_assets(interval = 1L, libs = "assets")

Arguments

interval

(int) number of seconds between checks

libs

(pth) path to libs folder

Functions

Super classes

webtools::Configurable -> webtools::Plugin -> HTMLPlugin

Methods

Public methods

Inherited methods

Method new()

Create a new HTMLApp

Usage
HTMLPlugin$new(
  html = pkg_user("html"),
  libs = "assets",
  lang = "en",
  autoreload = getOption("webtools.autoreload", FALSE),
  interval = getOption("webtools.autoreload.interval", 1L)
)
Arguments
html

(pth) filesystem directory HTML will be rendered

libs

(pth) path relative to the html for dependencies

lang

(str) string indicating the language. defaults to en

autoreload

(flg) for development, refreshes the page when the server reinstantiates itself

interval

(int) seconds between interval checks

...

(arg) arguments passed to App superclass


Method on_attach()

Attach an HTMLCapability

Usage
HTMLPlugin$on_attach(app)
Arguments
app

(App) app isntance to attach capability to


Method router()

HTML route for {htmltools} tags

Then handler function must return objects of class shiny.tag.list or shiny.tag. At the end of the process, the HTML tags are rendered and static CSS/JS assets placed in the root /assets path.

Some special configuration:

Usage
HTMLPlugin$router(path, handler, ..., lang = NULL, fragment = FALSE)
Arguments
path

(str) endpoint

handler

(fun) handler; must have arguments request, response, keys, ... and set the body to html tags

...

(arg) passed to super$router()

lang

(str) string indicating the language. defaults to en

fragment

(flg) whether to return a full page or fragment


Method clone()

The objects of this class are cloneable with this method.

Usage
HTMLPlugin$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


tjpalanca/webtools documentation built on Dec. 23, 2021, 11 a.m.