rawvignette
Precompiled vignettes and articles for R packages
Overview
rawvignette is a small R package that streamlines the precompiled-vignette workflow, for package authors whose documentation needs to do computationally intensive work. Vignettes with long run times, API calls, or large datasets cause problems when a package is built remotely by CRAN, GitHub Actions, or pkgdown, and the usual workarounds (eval = FALSE chunks, hand-cached .rds files, hidden precompute chunks) all have drawbacks. Precomputing the vignette locally is often the cleanest solution, but existing approaches involve some setup friction, and the widely used .Rmd.orig convention strips the source file of IDE support.
rawvignette splits rendering into two stages. The real source lives as an ordinary .Rmd in vignettes-raw/, where you can run and iterate on it like any other R Markdown document. Running precompile_raw_vignettes() executes it locally and writes a staged .Rmd, with outputs already inlined, to vignettes/; that’s all R CMD check, CRAN, and pkgdown ever see. The package handles scaffolding via use_raw_vignette() (much like usethis::use_vignette()), along with figure routing, .Rbuildignore management, and freshness checks, and it supports both shipped vignettes and web-only pkgdown articles.
Resources
rawvignette is available on GitHub and can be installed with:
pak::pak("matthewkling/rawvignette")