scaffold_module: Create Shiny module boilerplate code

Description Usage Arguments Details Examples

Description

Creates the boilerplate code for a Shiny module

Usage

1
scaffold_module(app_dir, template, module_config, overwrite = FALSE)

Arguments

app_dir

Path to root directory of the Shiny app

template

Template to use for the module. Use list_mod_templates to list available module templates.

module_config

Configuration of the module in the form of a list, e.g. list(id = "overview", name = "Overview Module")

overwrite

Logical indicating whether existing module files should be overwritten. Default is FALSE.

Details

The function creates a directory in <APP_ROOT>/modules/<MODULE_ID> in which seperate files ui.R, server.R, global.R, utils.R and help.R are created. The files contain boilerplate code to setup the module along with some basic examples to describe the usage of the module. To include the module, the module's global.R must be sourced in the app's main global.R and the module's UI and server functions need to be called in the app's main ui.R and server.R files.

Examples

1
2
3
4
5
module_conf <- list(
  id = "overview",
  name = "Overview"
)
scaffold_module("app", "blankpage", module_conf)

nz-stefan/shinyscaffold documentation built on May 9, 2019, 10 p.m.