Book bookdown: https://bookdown.org/yihui/bookdown/
Example books written with bookdown: https://bookdown.org/
bookdowninstall.packages("bookdown")In RStudio:
File > New Project > New Directory > Book project using bookdown
example-book2C:/gitbookThen click Build or execute
rmarkdown::render_site(encoding = 'UTF-8')
Each chapter is an R Markdown file (extension .Rmd) and
starts with the chapter title using the first-level heading
(# Chapter Title). By default, bookdown merges
all .Rmd files by the order of filenames.
index.Rmd will be treated as the first file when merging
all files.
index.Rmd contains the YAML header and the contents of
the homepage.
Files that start with _ are skipped.
This behavior can be overidden in the configuration file
_bookdown.yml. More details are given here https://bookdown.org/yihui/bookdown/usage.html
Output formats: https://bookdown.org/yihui/bookdown/output-formats.html
https://bookdown.org/yihui/bookdown/github.html
/docsSet the output directory of your book to be /docs by
adding output_dir: "docs" to the configuration file
_bookdown.yml.
_bookdown.yml
delete_merged_file: true
output_dir: "docs"
language:
ui:
chapter_name: "Chapter "In GitHub, create a repository with name
example-book
Copy SSH
git@github.com:Paula-Moraga/example-book.git
In RStudio,
File > New Project > Version Control > Git. Copy
repository URL.
git@github.com:Paula-Moraga/example-book.gitCopy contents example-book2 to
example-book.
Close RStudio and open example-book.Rproj
Build Book
In Terminal
git status
git add .
git commit -m "initial commit"
git push
In GitHub, go to Settings, Pages, select master, select
/docs, and click on Save.
Your site is ready to be published at http://www.paulamoraga.com/example-book/