14 Bookdown
The bookdown package allows you to creates a html book from various Rmarkdown files.
14.1 Set-up
Create a new folder that will contain your book.
Create an R Project file (.Rproj) for this folder (File > New Project…).
Create an index.Rmd with a YAML header like the example below. This is the first page of the book.
---
title: "Bookdown Example"
author: "Joe Bloggs"
date: "`r Sys.Date()`"
site: bookdown::bookdown_site
output: bookdown::gitbook
documentclass: book
description: "This is a simple bookdown tutorial"
---
# Bookdown ExampleFor each chapter/section you need a separate .Rmd file. By convention these should start with the section nummber, eg. 01-Chapter-A, 02-Chapter-B, and use ‘-’ instead of a space.
14.2 Create the book
When all the Rmd files have ready, click on the Build tab (in the top right window) and click Build Book.
This will create a subfolder (_book) that contains the html (and other) files for your book. The html will mirror the .Rmd file names.
To view you book open the index.html file in a browser.