As user dvt mentioned, this is built using bookdown[1], an R library (with the help of Pandoc). You can see that the example chapter of this book looks exactly like the bookdown output[2]. The bookdown PDF explains in detail how to use Rmd+RStudio+R+Pandoc+Markdown to publish this.
[1]: https://bookdown.org/yihui/bookdown/ [2]: https://bookdown.org/yihui/bookdown/bookdown.pdf