The goal of spring-2026 is to hold our stuff.
new_document <- function(name, type = "xaringan"){
dir <- paste0(Sys.Date(), "-", name)
if(!exists(dir)){dir.create(dir, recursive = F)}
extension = if(type == "xaringan"){".Rmd"}else{".qmd"}
filepath <- paste0(dir, "/", name, extension)
if(type == "xaringan"){template <- "0000-00-00-templates/xaringan_template.Rmd"}
if(type == "quarto"){template <- "0000-00-00-templates/quarto_template.qmd"}
if(!exists(filepath)){
readLines(template) |>
writeLines(filepath)
}
rstudioapi::documentOpen(filepath)
}
new_xaringan <- function(...){new_document(..., type = "xaringan")}
new_quarto <- function(...){new_document(..., type = "quarto")}
# new_xaringan(name = "data-viz-grammar-of-graphics")
new_quarto("more-data-viz")
-End-