| Title: | Create Simple 'Shiny' Applications as Packages |
|---|---|
| Description: | Code generator for robust dependency-free 'Shiny' applications in the form of packages. It includes numerous convenience functions to create modules, include utility functions to create common 'Bootstrap' elements, setup a project from the ground-up, and much more. |
| Authors: | John Coene [aut, cre], Opifex [cph] |
| Maintainer: | John Coene <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 1.0.0 |
| Built: | 2026-05-22 18:50:08 UTC |
| Source: | https://github.com/cran/leprechaun |
Add the app.R required to run on RStudio Connect,
RStudio server, and shinyapps.io.
add_app_file()add_app_file()
Invisibly returns a boolean indicating whether the operation was successful.
## Not run: add_app_file()## Not run: add_app_file()
Add boilerplate for a module.
add_module(name)add_module(name)
name |
Name of the module. This is used to dynamically create the names of the functions and file. |
Called for side-effects, invisibly returns
NULL.
## Not run: add_module("module_name")## Not run: add_module("module_name")
Gets the default Bootstrap version based on the Shiny version installed. Shiny > 1.6 uses version 5 while earlier version use Bootstrap 4.
bootstrap_version()bootstrap_version()
An integer denoting the Bootstrap version.
bootstrap_version()bootstrap_version()
Runs the various scripts that were created with
setup functions.
build()build()
Invisibly returns a boolean indicating whether the operation was successful.
## Not run: build()## Not run: build()
Roclet to run build() when documenting.
Meant to be used in DESCRIPTION, e.g.:
Roxygen: list(markdown = TRUE, roclets = c("namespace", "collate", "rd", "leprechaun::build_roclet"))
build_roclet()build_roclet()
An object of class roclet as expected
by roxygen2.
Create assets function and file assets.R.
create_assets(quiet = FALSE)create_assets(quiet = FALSE)
quiet |
Whether to print messages to the console. |
Invisibly returns NULL, called for
side-effects.
## Not run: create_assets()## Not run: create_assets()
Create input handlers functions and file inputs-handlers.R.
create_input_handlers(quiet = FALSE)create_input_handlers(quiet = FALSE)
quiet |
Whether to print messages to the console. |
## Not run: create_input_handlers()## Not run: create_input_handlers()
Create zzz.R file containing .onLoad function.
create_onload(quiet = FALSE)create_onload(quiet = FALSE)
quiet |
Whether to print messages to the console. |
## Not run: create_onload()## Not run: create_onload()
Create utils.R file containing helper functions.
create_utils(quiet = FALSE)create_utils(quiet = FALSE)
quiet |
Whether to print messages to the console. |
## Not run: create_utils()## Not run: create_utils()
Scaffolds a leprechaun project. This must be run from within a package and should only be run once per project.
scaffold( ui = c("navbarPage", "fluidPage"), bs_version = bootstrap_version(), overwrite = FALSE )scaffold( ui = c("navbarPage", "fluidPage"), bs_version = bootstrap_version(), overwrite = FALSE )
ui |
Type of UI to use. |
bs_version |
Bootstrap version to use. If shiny > 1.6 is installed defaults to version 5, otherwise version 4. |
overwrite |
Whether to force overwrite all files. This is not recommended, make sure you have save and/or committed and checked that the files that will be overwritten can be before proceeding with this option. |
Invisibly return NULL, called for side-effects.
## Not run: scaffold()## Not run: scaffold()
Run a check on the project, prints useful messages.
sitrep()sitrep()
Invisibly returns a boolean indicating whether the operation was successful.
## Not run: sitrep()## Not run: sitrep()
Update the scaffolded code to a new version of leprechaun.
update_scaffold(force = !interactive())update_scaffold(force = !interactive())
force |
Force update, ignore safety checks. |
This reads the content of the .leprechaun lock file
and updates it too.
Invisibly returns a boolean indicating whether the scaffold was updated.
## Not run: update_scaffold()## Not run: update_scaffold()
Setup a configuration file and helper functions.
use_config(quiet = FALSE)use_config(quiet = FALSE)
quiet |
Whether to print messages. |
Invisibly returns a boolean indicating whether the operation was successful.
Add utility functions to create and serve session-specific endpoints.
use_endpoints_utils(overwrite = FALSE, quiet = FALSE)use_endpoints_utils(overwrite = FALSE, quiet = FALSE)
overwrite |
Whether to overwrite existing files. |
quiet |
Whether to print messages. |
Invisibly returns a boolean indicating whether the operation was successful.
Add htmltools utility functions, e.g.: shorthands to create columns.
use_html_utils(overwrite = FALSE, quiet = FALSE)use_html_utils(overwrite = FALSE, quiet = FALSE)
overwrite |
Whether to overwrite existing files. |
quiet |
Whether to print messages. |
Invisibly returns a boolean indicating whether the operation was successful.
Add utility JavaScript function, e.g.: to hide or show element in the DOM.
use_js_utils(overwrite = FALSE, quiet = FALSE)use_js_utils(overwrite = FALSE, quiet = FALSE)
overwrite |
Whether to overwrite existing files. |
quiet |
Whether to print messages. |
Invisibly returns a boolean indicating whether the operation was successful.
This requires use_packer. Also, it will require using build.
## Not run: use_js_utils()## Not run: use_js_utils()
Setup a packer script to easily bundle the JavaScipt.
use_packer(quiet = FALSE)use_packer(quiet = FALSE)
quiet |
Whether to print messages. |
Invisibly returns a boolean indicating whether the operation was successful.
This requires a scaffold of packer already in place. Also, this will require using build.