knitr::opts_chunk$set(dev = "ragg_png", fig.retina = 2) library(mpsTemplates) set.seed(101)
Use this as a template for single page bookdown sites hosted on github.
Setup github actions to knit on push and rendered docs get pushed to the gh-pages
branch:
## Assumes that the project is created with git initiated and github is setup ## Need to initiate renv and push the lockfile to main branch before building. ## update this as packages are added usethis::pr_init("use renv") renv::snapshot() gert::git_add(".") gert::git_commit("add renv lockfile") usethis::pr_push() ## browser should open to create pull request usethis::pr_finish() ## cleanup ## do this once usethis::pr_init("use bookdown") usethis::use_github_action("bookdown") gert::git_add(".") gert::git_commit("add bookdown github action files") usethis::pr_push() ## browser should open to create pull request usethis::pr_finish() ## cleanup
To preview the book:
bookdown::render_book("document.Rmd")
blah blah [@rcore].
\begin{equation} \left(\prod_{i=1}^{n}y_i\right)^{\frac{1}{n}} = \exp\left[\frac{1}{n}\sum_{i=1}^n\log{y_i}\right], \quad \textrm{when} \quad y_1, y_2, ..., y_n > 0 (#eq:gmean) \end{equation}
Cross reference equations by using \@ref(eq:gmean")
see Equation \@ref(eq:gmean).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.