Regenerate the Quarto sources without rendering

Source: R/build.R

Rewrites every file qrtdown generates – index.qmd, the function reference pages, and the article, news, and citation pages – from the current ⁠man/*.Rd⁠, README, and NEWS.md, without invoking Quarto.

Usage

regenerate(pkg = ".", quiet = FALSE)

Arguments

pkg

Path to the package root directory

quiet

Suppress progress messages

Value

Invisibly returns pkg

Details

build_site() calls this before rendering, and it is wired into the generated ⁠_quarto.yml⁠ as a Quarto pre-render script. That second use is what keeps ⁠quarto render⁠ and ⁠quarto preview⁠ honest: Quarto’s file watcher only watches .qmd files, but qrtdown’s real sources are ⁠man/.Rd⁠ and ⁠R/.R⁠, so without this hook a devtools::document() never reaches the preview.

Files are only rewritten when their content changes, so repeated calls do not invalidate Quarto’s freeze cache or retrigger a running preview.

Note that Quarto runs pre-render in a fresh R session, which loads the installed qrtdown rather than a devtools::load_all() working copy. When developing qrtdown itself, prefer build_site() or reinstall between runs. Set prerender: false in ⁠_qrtdown.yml⁠ to omit the hook.