Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#' 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

beatrizmilz commented Jul 26, 2021

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