The GitHub repository for EdSurvey: A User's Guide
- Install Packages
install.packages(c("blogdown", "servr", "bookdown", "kableExtra", "downlit"))
- Add
.Rprofile
to your local repository to bring in theedsurveyHome
variable pointing to the data directory, as used in development of theEdSurvey
package. This book includesTIMSS
andECLS-K:2011
data in chapters 8 and 10, respectively, so contributions to those chapters require local data to reproduce. If you are unable to access this data locally, you can still contribute to other chapters by runningbookdown:::preview_chapter("chapter-name.Rmd")
. See the Locally hosting/compiling the just one chapter section of the readme.
To get started, open up the EdSurvey_A_Users_Guide.Rproj
file or set the EdSurvey_A_Users_Guide
pathway as your R working directory. Ensure your R sesssion includes the edsurveyHome
object that points to the data directory in your local environment (they should display in the top right Environments panel.) Load the necessary libraries:
library(servr)
library(blogdown)
library(bookdown)
library(kableExtra)
bookdown::serve_book()
Note that this will update all .Rmd
files in your local directory and should be used only if an update of the full book is desired. This will also track any changes to the Rmd
files and knitr them to html.
The server will listen to changes in the book root directory: whenever you modify any files in the book directory, serve_book() can detect the changes, recompile the Rmd files, and refresh the web browser automatically.
servr::httw(dir = "_book") # locally host the book location
bookdown:::preview_chapter("02-installation.Rmd") # Knit HTML of selected chapter - be sure to replace the name of the `Rmd` with your chapter
This will start a local server of the full book but that updates only as changes are made to a single Rmd
file. Note that other supplmentary files that any changes may affect, such as the References page, won't be updated by building a single chapter. More information about these functions are here: https://bookdown.org/yihui/bookdown/editing.html