-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (24 loc) · 950 Bytes
/
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: init bookdown-epub bookdown-html bookdown-pdf cleanup
# Move pictures into repository root
init:
Rscript -e "dir.create('Pictures')"
Rscript -e "file.copy('Protocol/Pictures/', '.', recursive=T)"
Rscript -e "file.copy('Diagrams/Pictures/', '.', recursive=T)"
# Remove pictures from repository root
cleanup:
Rscript -e "unlink('Pictures', recursive = TRUE)"
epub: init bookdown-epub cleanup
html: init bookdown-html cleanup
pdf: init bookdown-pdf cleanup
# Generate EPUB document
bookdown-epub:
Rscript -e "bookdown::render_book('ReadMe.md', 'bookdown::epub_book')"
# Generate (GitBook) HTML document
bookdown-html:
Rscript -e "bookdown::render_book('ReadMe.md', 'bookdown::gitbook')"
Rscript -e "file.rename('Bookdown/Documentation.html', 'Bookdown/index.html')"
# Generate PDF
bookdown-pdf:
Rscript -e "bookdown::render_book('ReadMe.md', 'bookdown::pdf_book')"
clean: cleanup
Rscript -e "unlink('Bookdown', recursive = TRUE)"