secure_rmd: Render and secure R Markdown document

View source: R/secure_rmd.R

secure_rmdR Documentation

Render and secure R Markdown document

Description

secure_rmd() can be used to render (or run) and secure many types of R Markdown documents. Rendering is handled either by rmarkdown::render or, if using shiny, a shiny app is constructed, and the then the output is secured with polished authentication.

Usage

secure_rmd(
  rmd_file_path,
  polished_config_args = list(),
  sign_in_page_args = list(),
  sign_out_button = NULL
)

Arguments

rmd_file_path

the path the to .Rmd file.

polished_config_args

arguments to be passed to polished_config. (NOTE: Values passed in this list will override YAML header values if both provided).

sign_in_page_args

a named list() to customize the Sign In page UI. Valid names are color, company_name, logo, & background_image. (NOTE: Values passed in this list will override YAML header values if both provided).

sign_out_button

A shiny::actionButton or shiny::actionLink with inputId = "sign_out". If this argument is left as NULL, secure_rmd will attempt to add in an appropriate sign out button/link depending on the output format of your .Rmd document. Set this argument to list() to not include a sign out button.

Value

a Shiny app object

Examples


## Not run: 

secure_rmd(system.file("examples/rmds/flexdashboard.Rmd", package = "polished"))
secure_rmd(
  system.file("examples/rmds/flexdashboard.Rmd", package = "polished"),
  polished_config_args = list(
    # any values in this list will override values in YAML header
    app_name = "different_name"
  ),
  sign_in_page_args = list(
    color = "#FF5700"
  )
)
secure_rmd(system.file("examples/rmds/flexdashboard_shiny.Rmd", package = "polished"))
secure_rmd(system.file("examples/rmds/html_document.Rmd", package = "polished"))
secure_rmd(system.file("examples/rmds/pdf_document.Rmd", package = "polished"))
io_file_path <- system.file(
  "examples/rmds/ioslides/ioslides_presentation.Rmd",
  package = "polished"
)
secure_rmd(io_file_path)

## End(Not run)

polished documentation built on Feb. 16, 2023, 8:02 p.m.