R/utils.R

Defines functions find_resource find_file

find_file <- function(template, file) {
  template <- system.file("rmarkdown", "templates", template, file,
                          package = "kazdoc")
  if (template == "") {
    stop("Couldn't find template file ", template, "/", file, call. = FALSE)
  }

  template
}

find_resource <- function(template, file) {
  find_file(template, file.path("resources", file))
}
muuankarski/kazdoc documentation built on May 23, 2017, 9:23 a.m.