Skip to content

Instantly share code, notes, and snippets.

@beatrizmilz
Last active September 20, 2021 18:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beatrizmilz/d6969667833a88987d017b93d059ca7a to your computer and use it in GitHub Desktop.
Save beatrizmilz/d6969667833a88987d017b93d059ca7a to your computer and use it in GitHub Desktop.
#' Copy templates from packages
#'
#' @param path Character: a path where the files will be copied
#' @param pacote name of the package that contains the template
#' @param template name of the template: thesis, resume, poster-relaxed,
#' poster-jacobs, card ...
#' @return
#' @export
#'
#' @examples get_templates_packages("template/", "pagedreport", "windmill")
get_templates_packages <- function(path, pacote = "pagedown", template = "thesis") {
path_resources <- system.file("resources", package = pacote)
files_resources <-
fs::dir_ls(path_resources, recurse = TRUE, regexp = template)
fs::dir_create(path)
path_glue <- glue::glue("{path}{fs::path_file(files_resources)}")
fs::file_copy(files_resources, path_glue)
}
@beatrizmilz
Copy link
Author

Dica do @jtrecenti para experimentar : pagedown:::list_css()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment