-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbookdown.Rmd
56 lines (39 loc) · 2.54 KB
/
bookdown.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
title: "Bookdown"
output:
html_document:
toc: true
include:
after_body: footer.html
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
The bookdown package makes it easy to create books with R Markdown and RStudio. These can be easily published online and in various formats: HTML, PDF, ePub, and Kindle. Read about bookdown and see hundreds of online books written with it at [bookdown.org](https://bookdown.org/).
Once you are ready to write your own book, read the [online documentation](https://bookdown.org/yihui/bookdown/).
Examples:
* The [bookdown.org](https://bookdown.org/) website has hundreds of examples.
* We have a time-series book using it: [Applied Time-Series Analysis](https://nwfsc-timeseries.github.io/atsa-labs/)
## Download the template
Download a zip file of the [bookdown-demo](https://github.com/RVerse-Tutorials/bookdown-demo) repository. You can use the 'download zip file' button on the GitHub repository or you can navigate to your 'RWorkflow' folder in RStudio and click 'More' in the Files panel and select 'Set as working directory'. Then issue these commands.
```
library(RWorkflowsetup)
download.repo("bookdown-demo")
```
*INCOIS participants: You will find a copy of the repository in the RWorkflow directory that you copied from the thumb drive.*
This is a copy of the [original bookdown-demo](https://github.com/rstudio/bookdown-demo) by Yihui Xie, the creator of the bookdown package, with a few changes so it works immediately with GitHub.
## Build the book
1. Open RStudio
2. Click the project button in top right and select 'New Project'.
3. Click 'Existing Directory' and choose your 'bookdown-demo' folder.
4. Click the Build tab and click 'Build book'
Your book should appear.
## Post and online version of your book via GitHub
You can host your book many places. To do so on GitHub, do the following.
1. Make your bookdown-demo folder into a repository.
- Open GitHub Desktop, click 'File > New Repository'
- Type `bookdown-demo` as the name and `<yourbasedir>\RWorkflow` as the local path. This assumes that the bookdown-demo folder is in the RWorkflow directory. If not, replace the path with the directory where you put the bookdown-demo folder.
2. Publish the bookdown-demo folder to GitHub. Click the Publish button in GitHub Desktop.
3. Open the repository on GitHub.
- Click Settings, and scroll down to `GitHub Pages`. Change the source to `master branch/docs` folder and click save.
4. Your book should appear at `https://<yourname>.github.io/bookdown-demo/` in a few minutes.