Nothing
# Render the same source as a readable HTML article and a Times New Roman PDF.
# Usage: Rscript tools/render-study.R /path/to/IJSE /path/to/study-data /path/to/output
# Install this package after populating inst/extdata/study for package builds.
args <- commandArgs(trailingOnly = TRUE)
stopifnot(length(args) == 3L)
package_dir <- normalizePath(args[1L], mustWork = TRUE)
data_dir <- normalizePath(args[2L], mustWork = TRUE)
dir.create(args[3L], recursive = TRUE, showWarnings = FALSE)
output_dir <- normalizePath(args[3L], mustWork = TRUE)
input <- file.path(package_dir, "vignettes", "ijse-study.Rmd")
headers <- grep("^```\\{", readLines(input), value = TRUE)
if (any(!grepl("\\}$", headers))) {
stop("Every fenced chunk header must close on its opening line.")
}
rmarkdown::render(input,
output_format = rmarkdown::html_document(self_contained = TRUE, highlight = NULL,
css = file.path(package_dir, "vignettes", "ijse.css")),
output_file = "IJSE-vignette-study.html", output_dir = output_dir,
params = list(data_dir = data_dir), envir = new.env(), quiet = TRUE)
html <- paste(readLines(file.path(output_dir, "IJSE-vignette-study.html")), collapse = "\n")
images <- gregexpr("data:image/png;base64", html, fixed = TRUE)[[1L]]
if (sum(images > 0L) < 3L) stop("The rendered HTML must contain all three study figures.")
rmarkdown::render(input,
output_format = rmarkdown::pdf_document(latex_engine = "xelatex", keep_tex = TRUE,
highlight = NULL, fig_caption = TRUE),
output_file = "IJSE-vignette-study.pdf", output_dir = output_dir,
params = list(data_dir = data_dir), envir = new.env(), quiet = TRUE)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.