header <- function(projNum, projName, au, purpose, short = TRUE, R = TRUE){
date <- Sys.Date()
lines <- list()
lines[[2]] <- "# This file was generated by a call to 'CTUtemplate::CTUtemplate()'."
lines[[3]] <- glue("Study:{projNum} {projName}")
lines[[4]] <- glue("Purpose: {purpose}", )
lines[[5]] <- glue("Author: {au}")
lines[[6]] <- glue("Date created: {date}")
lines[[7]] <- "Last update:"
if(!short){
lines[[8]] <- "Date of database export:"
lines[[9]] <- "Underlying SAP version:"
lines[[10]] <- "Underlying Study Protocol version:"
}
lines <- stringr::str_pad(lines, max(nchar(lines)), "right")
lines[[1]] <- stringr::str_pad("", max(nchar(lines)), pad = "*")
lines[[length(lines)+1]] <- lines[[1]]
if(R) {
lines <- paste("# /*", lines, "*/")
} else {
lines <- paste("/*", lines, "*/")
}
paste(paste(lines, collapse = "\n"), "\n\n\n")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.