-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
34 lines (25 loc) · 958 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
34
REVEALJS_URL=https://github.com/hakimel/reveal.js/archive/3.6.0.tar.gz
DITAA_URL=https://github.com/stathissideris/ditaa/releases/download/v0.11.0/ditaa-0.11.0-standalone.jar
DIAGRAMS=$(shell ls diagrams/*.txt)
PLOTS=$(shell ls plots/*.R)
SCREENSHOTS=$(shell ls screenshots/*.png)
all: reveal.js index.html
ditaa.jar:
curl -L -o $@ $(DITAA_URL)
reveal.js:
mkdir -p reveal.js
curl -L $(REVEALJS_URL) | tar --strip-components=1 -xz -C reveal.js
diagrams/%.svg: diagrams/%.txt ditaa.jar
java -jar ditaa.jar $< $@ -T --svg
plots/%.png: plots/%.R
Rscript -e "png('$@');source('$<');dev.off()"
index.html: slides.md $(DIAGRAMS:.txt=.svg) $(PLOTS) $(PLOTS:.R=.png) $(SCREENSHOTS)
pandoc -V theme=simple -V progress=true -V history=true -t revealjs -s -o $@ $<
clean:
rm -f index.html ditaa.jar
rm -f diagrams/*.svg
rm -f plots/*.svg
rm -rf reveal.js
dev:
bash -c "while :; do make; if [[ $$? == 0 ]]; then sleep 1; fi; done"
.PHONY: clean dev