forked from PsyTeachR/ads-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_render.R
25 lines (21 loc) · 833 Bytes
/
_render.R
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
# render only completed chapters ----
# edit _bookdown_v1.yml to add or remove chapters to rmd_files:
xfun::in_dir("book", bookdown::render_book(config_file = "_bookdown_v1.yml"))
browseURL("docs/index.html")
# run if anything in book/data changes ----
# zip the data files
zipfile <- "book/data/data"
if (file.exists(zipfile)) file.remove(zipfile)
f.zip <- list.files("book/data", full.names = TRUE)
zip(zipfile, c(f.zip), flags = "-j")
# copy data directory to docs
R.utils::copyDirectory(
from = "book/data",
to = "docs/data",
overwrite = TRUE,
recursive = TRUE)
#-------------------------------------------------------------------------
# render a draft book
# comment out chapters to render a subset
xfun::in_dir("book", bookdown::render_book(config_file = "_bookdown_draft.yml"))
browseURL("docs/draft/index.html")