knitr::opts_knit$set(root.dir = here::here(""))

Build vignettes

for (rmd_vignette in dir(here::here("vignettes"), "Rmd$", full = TRUE)) {
    # directly use rmarkdon::render() won't work, maybe since it nor self-contained
    build <- function(x) {rmarkdown::render(x, output_dir = "../inst/doc")}
    callr::r_vanilla(build, list(rmd_vignette), .libPaths(), show = T)
} 

Afterward

# test() and document() is not needed since we haven't edited any source code

system("R CMD INSTALL --no-multiarch --with-keep.source .")
devtools::reload()  # now you can view the vignettes


dongzhuoer/minir documentation built on July 28, 2020, 7:23 a.m.