R/demo.R

Defines functions demo

Documented in demo

#' Creates a demo folder for illustrating the usage of the package
#'
#' @param jekyll  Set up in jekyll format (as opposed to `docs`)? (default: FALSE)
#'
#' @examples
#' \dontrun{
#' demo()
#' }
#'
#' @export

demo <- function(jekyll=FALSE) {
  if (dir.exists('html-demo')) stop(paste0('Exiting; directory "html-demo" already exists.'), call.=FALSE)
  path <- system.file(package="html")
  file.copy(paste0(path, "/html-demo"), '.', recursive=TRUE)
  if (jekyll) {
    dir.create('html-demo/web')
  } else {
    dir.create('html-demo/docs')
  }
}
pbreheny/html documentation built on April 17, 2025, 11:36 p.m.