-
Notifications
You must be signed in to change notification settings - Fork 175
/
Makefile
33 lines (24 loc) · 1.11 KB
/
Makefile
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
# All .Rmd files except those that start with "_"
RMD_FILES=$(filter-out $(wildcard _*.Rmd),$(wildcard *.Rmd))
# Drop index.Rmd from RMD_FILES
CHAPTER_RMD_FILES=$(filter-out index.Rmd,$(RMD_FILES))
.PHONY: html pdf chapters_md semiclean clean cleaner
html:
Rscript --no-init-file -e 'bookdown::render_book("index.Rmd", output_format = "bookdown::gitbook"); warnings()'
pdf:
Rscript --no-init-file -e 'bookdown::render_book("index.Rmd", output_format = "bookdown::pdf_book"); warnings()'
html_artifacts:
Rscript --no-init-file -e 'bookdown::render_book("index.Rmd", output_format = "bookdown::gitbook", clean = FALSE); warnings()'
pdf_artifacts:
Rscript --no-init-file -e 'bookdown::render_book("index.Rmd", output_format = "bookdown::pdf_book", clean = FALSE); warnings()'
# Knit individual chapters and put resulting .md files in chapters_md/
chapters_md: $(CHAPTER_RMD_FILES)
tools/build_chapters.R $(CHAPTER_RMD_FILES)
semiclean:
rm -f "R-Graphics-Cookbook-2e.Rmd"
clean:
rm -f "R-Graphics-Cookbook-2e.Rmd"
Rscript -e "bookdown::clean_book(TRUE)"
rm -rf chapters_md/ _book/
cleaner: clean
rm -rf _bookdown_files/