bs2skel <- function(path, ...) {
# ensure path exists
dir.create(path, recursive = TRUE, showWarnings = FALSE)
# generate header
header <- c(
"# This file was generated by a call to 'ptexamples::hello_world()'.",
"# The following inputs were received:",
""
)
# collect inputs
dots <- list(...)
text <- lapply(seq_along(dots), function(i) {
key <- names(dots)[[i]]
val <- dots[[i]]
paste0(key, ": ", val)
})
# collect into single text string
contents <- paste(
paste(header, collapse = "\n"),
paste(text, collapse = "\n"),
sep = "\n"
)
# write to index file
writeLines(contents, con = file.path(path, "INDEX"))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.