I use bookdown with the gitbook ouput to build a book. The .Rmd files used to build this book are in turn auto-generated from other source files in the followin
.Rmd