R/new_page.R

Defines functions new_page

Documented in new_page

# Generated by fusen: do not edit by hand

#' Add page
#'
#' Module template for golem
#'
#' @return Used for side effect
#' @inheritParams golem::module_template
#' @export
#'
#' @examples
#' if (requireNamespace("golem") & interactive()) {
#'   golem::add_module(name = "home", module_template = brochure::new_page)
#' }
new_page <- function(name, path, export, ...) {
  tmplt <- readLines(
    system.file(
      "golem/mod_home.R",
      package = "brochure"
    )
  )
  tmplt <- gsub(
    "home",
    name,
    tmplt
  )
  tmplt <- gsub(
    "/",
    sprintf("/%s", name),
    tmplt
  )
  write(tmplt, path)
}
ColinFay/brochure documentation built on March 30, 2022, 5:02 a.m.