-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·77 lines (54 loc) · 1.73 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
PROJECT_NAME = $(shell basename $(PWD))
DECKTAPE_CONTAINER=astefanutti/decktape:1.0.0
PDF_SIZE=1024x768
BASE_STYLE=simple
all: $(PROJECT_NAME).pdf
@echo
@echo "FINISHED!"
@echo
@echo "open 'index.html'"
@echo "open '$<'"
@echo
%.pdf: index.html lib/reveal.js
docker run --rm -v `pwd`:/pwd -w /pwd \
--env http_proxy=${http_proxy} --env https_proxy=${https_proxy} \
$(DECKTAPE_CONTAINER) \
reveal \
--size $(PDF_SIZE) \
$< $@
index.html: slides.md lib/ pandoc-utils/ assets/ Makefile
mkdir -p rendered
pandoc \
-f markdown \
-t html5 \
--template=pandoc-utils/template-revealjs.html \
--standalone \
--section-divs \
--variable theme=$(BASE_STYLE) \
--variable transition=slide \
--variable title=$(PROJECT_NAME) \
--lua-filter pandoc-utils/render-asciiart.lua \
-o $@ \
$<
lib: lib/reveal.js lib/ditaa.jar lib/plantuml.jar lib/asciinema
lib/reveal.js:
mkdir -p lib
git clone --depth 1 https://github.com/hakimel/reveal.js.git $@
lib/ditaa.jar:
mkdir -p lib
curl -L -o $@ https://github.com/stathissideris/ditaa/raw/master/service/web/lib/ditaa0_10.jar
lib/plantuml.jar:
mkdir -p lib
curl -L "https://sourceforge.net/projects/plantuml/files/plantuml.jar/download?use_mirror=10gbps-io" > $@
lib/asciinema:
mkdir -p $@
curl -L -o $@/asciinema-player.css https://github.com/asciinema/asciinema-player/releases/download/v2.5.0/asciinema-player.css
curl -L -o $@/asciinema-player.js https://github.com/asciinema/asciinema-player/releases/download/v2.5.0/asciinema-player.js
start-chrome:
open -a 'Google Chrome' --args -allow-file-access-from-files file://$(PWD)/index.html
clean:
rm -rf index.html *.pdf rendered
mrproper: clean
rm -rf lib
git clean -fxd
.PHONY: all clean mrproper start-chrome