[R-pkg-devel] handling documentation build tools

Boylan, Ross Ro@@@Boy|@n @end|ng |rom uc@|@edu
Tue May 21 23:01:35 CEST 2024


I have some documentation that requires external tools to build.  I would like to build the automatically, with requiring either users or repositories to have the tools.  What's the best way to accomplish that.

Specifically one document is written using the LyX word processor, so the "source" is msep.lyx.  To convert that into something useful, a pdf, one must run lyx, which in turn requires latex.

I'm looking for recommendations about how to approach this.

A purely manual approach would be to place msep.lyx in .Rbuildignore and manually regenerate the pdf if I edit the file.

This has 2 drawbacks: first, it does not guarantee that the pdf is consistent with the current source; second, if I want to generate plain text or html versions of the document as well, the manual approach gets more tedious and error prone.

Currently I use pkgbuild::build's option to run bootstrap.R to run the lyx->pdf conversion automatically with each build.  The script is pretty specific to my build environment, and I think if I uploaded the package CRAN would end up trying to run bootstrap.R, which would fail.

Maybe the script should go in tools/? But then it won't run automatically.  Maybe the script in tools goes in .Rbuildignore and the bootstrap.R script simply checks if the tools/ script exists and runs it if present.

Suggestions?

I'm also unsure what directory msep.lyx should go in, though that's a secondary issue.  Currently it's in inst/doc, which led to problems with the build system sometimes wiping it out.  I've solved that problem.

Thanks.
Ross

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list