Publish a manual's archived releases alongside the site
Source:R/publishing.R
publishManualArchive.RdA manual that is released keeps a PDF of each release. Those PDFs belong in version control rather than only on the published branch: that branch is rebuilt by every deploy, and an old PDF cannot be regenerated from current sources. This copies them into the rendered book directory so they deploy with the site, and writes an index page listing them.
Usage
publishManualArchive(
archiveDir = file.path("archive", "pdf"),
docsDir,
manualName,
subdir = "archive"
)Details
The index is built from the files actually present, not from a list kept by
hand, so it cannot drift. Versions are read from the file names, which are
what archiveManualPDF() writes: <prefix>-v<version>.pdf. Anything not
matching that shape is copied but left out of the ordering.