forked from 13rac1/talk-git2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (43 loc) · 1.32 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
GRAPHDIR := graphs
# Dot files to create graph png images
GRAPHFILES := $(shell find $(GRAPHDIR) -type f -name "*.dot")
IMAGEFILES := $(patsubst graphs/%.dot, images/graphs/%.png, $(GRAPHFILES))
.PHONY: clean publish
all: reveal.js/index.html images/graphs index.html $(IMAGEFILES)
# Make output directory
images/graphs:
mkdir -p images/graphs
# Make the index.html from index.md.
# --incremental makes lists into revealjs fragments
index.html: index.md
pandoc -t revealjs --template=pandoc-templates/default.revealjs \
--standalone --section-divs --variable theme="league" \
--variable transition="convex" --incremental \
--no-highlight --variable hlss=zenburn \
--css=css/custom.css \
index.md -o index.html
#dot graphs/example.dot -Tpng -o images/example.png
images/graphs/%.png: graphs/%.dot
dot $< -Tpng -o $@
# RevealJS setup
reveal.js/index.html:
wget https://github.com/hakimel/reveal.js/archive/3.1.0.tar.gz
tar zxf 3.1.0.tar.gz
mv reveal.js-3.1.0 reveal.js
rm 3.1.0.tar.gz
# Force update the gh-pages branch with the current output.
# WARNING: Calls "make all"
publish:
git checkout master
git branch -D gh-pages
git checkout -b gh-pages
make all
git rm .gitignore
git add .
git commit -m "Publish"
git push origin gh-pages -f
git checkout master
make all
clean:
rm index.html $(IMAGEFILES)
rmdir images/graphs