Skip to content

SpaDES.docs 0.3.0

Choose a tag to compare

@achubaty achubaty released this 18 Sep 16:12
· 19 commits to main since this release
d8abaf2

Six new exported functions, promoted out of the manuals that were carrying near-identical copies of them, and a warning for the one failure mode that was silent.

The manuals' shared build code, promoted

fireSenseManual and LandR-Manual had near-identical build scripts -- their install.R files were byte-identical apart from comment wording. Four of these encode a defect that actually broke a build, so the fix now lives in one place with a test rather than as a comment copied between repositories.

  • collapseModuleBibs() merges the modules' references_*.bib files into the single bibliography bookdown wants, skipping files with no entries. A module that cites nothing yet ships a comments-only .bib, and RefManageR::ReadBib() fails on it -- enough to take down a whole manual over one placeholder.
  • installModulePkgs() installs the packages a manual's modules declare, or with install = FALSE resolves the list without installing. It assigns the list before installing rather than piping it, because Require::Install() calls substitute() on its first parameter, so a piped expression asks the installer for a package literally called packages.
  • stagePagesFiles() writes .nojekyll, and optionally CNAME, into the rendered book directory. A deploy publishes the contents of that directory, so these never reach the site if written to the repository root.
  • archiveManualPDF() copies a rendered PDF to a versioned name, and does nothing when no PDF was produced. It also refuses an empty version, since Sys.getenv() of an unset variable is "" and would archive <name>-v.pdf over the previous build.
  • manualPaths() resolves a manual's root, rendered book, citations and figures directories from _bookdown.yml. It errors rather than guessing when output_dir is unset, because guessing renders the book somewhere the deploy does not look.
  • writePkgBib() and downloadCSL() cover the remaining boilerplate.

RefManageR, rprojroot and SpaDES.core are Suggests, guarded at runtime, so none becomes a hard dependency.

prepManualRmds()

Now warns in both directions. It already warned when _bookdown.yml listed a chapter that was not prepared; the reverse was dropped silently, so a prepared-but-unlisted chapter was written, built cleanly, and was simply absent from the book. That barely mattered while every manual took its modules from git submodules, and stops being safe once a manual takes its module list from somewhere else.

Documentation

The vignette is now two, split by how a manual treats its modules:

  • Building a project manual -- pins them, so the manual agrees with the results it describes (LandWeb).
  • Building a continuously updated manual -- tracks them, so a documentation fix reaches the published site on its own (fireSenseManual, LandR-Manual).

Both worked examples use the functions above.

Also

Re-documented with roxygen2 8.1.0, in its own commit: no .Rd changes, and the NAMESPACE directives are identical before and after.