Workflow
If I wanted you to understand it, I would have explained it better.
-- Johan Cruijff
This may be of some interest to some. I use the Rgitbook
package in R
together with gitbook-cli
, and the (old) Gitbook.app that uses gitbook-1.0.3.
All files are in the BRAS
directory. I edit Rmd files in Sublime Text, then run buildGitbook()
from an R
running in BRAS
, then use openGitbook()
to see the HTML in a browser.
The Rmd files follow the conventions of knitr
. Thus buildGitbook()
as a first step knits all updated Rmd files to md files, creating caches and executing R
code and generating figures and output when necessary. As a second step it knits the md to HTML and puts them in the right place in the gitbook hierarchy by calling gitbook-cli
.
Then I upload the book to GitbookIO using Gitbook.app
. Note that uploading means another
md to HTML conversions on the server side.
The toolchain is a bit shaky because both Rgitbook
and Gitbook.app
are no longer actively maintained. It would be great if Rstudio
could deal with the whole build sequence and have a book repository similar to its repository for compiled Rmd files.
The major problem at the moment is that none of the tools can efficiently convert formulas to png files, and my book is full of formulas. MathJax does a great job generating a website for the book, but so far png conversion does not work for me.