We need to modularise some of our lab documents so that standard pieces of text can be kept in one place (a library of test methods), and which we can pull in as necessary (test method descriptions, boiler plate terms and conditions etc).
I have had a look at bookdown but it seems over-complex for what we need to do. I know that I could use the m4 macro processor to pull in multiple .Rmd files using a Makefile, but our staff are used to using rstudio to build their documents.
i.e., I can do this in the top level document:
changequote([', ]')
undivert([../../Library/testmethod1summary.Rmd])
and use the Makefile to preprocess the top-level file and include all subsequent files. I've done something like this with pandoc previously:
%.pdf: %.md
m4 $< > _tmp.md
pandoc _tmp.md -o $@
Is there any way to add the m4 program into the rstudio build pipeline so that you can use the usual rstudio knitR commands (SHIFT-CTRL-K or SHIFT-CTRL-B) ?
Pete