-
Notifications
You must be signed in to change notification settings - Fork 5
/
GNUmakefile
48 lines (39 loc) · 1.77 KB
/
GNUmakefile
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
################################################################################
SOURCE = slides.md
################################################################################
DEVALOT_PANDOC_DIR = vendor/devalot-pandoc
DEVALOT_PANDOC_BIN = $(DEVALOT_PANDOC_DIR)/.cabal-sandbox/bin
DEVALOT_PANDOC = $(DEVALOT_PANDOC_BIN)/devalot-pandoc
PANDOC = $(DEVALOT_PANDOC_BIN)/pandoc
################################################################################
.PHONEY: all clean
################################################################################
all: $(DEVALOT_PANDOC) README.md README.html slides.html
$(MAKE) -C src
################################################################################
clean::
rm -f README.html slides.html
################################################################################
README.md: $(SOURCE)
$(PANDOC) -f markdown -t json $< | \
$(DEVALOT_PANDOC) | \
$(PANDOC) -f json -t markdown --atx-headers -o $@.tmp
sed -r 's|^</?div.*$$||' < $@.tmp > $@
rm $@.tmp
################################################################################
README.html: README.md
$(PANDOC) -f markdown -t html5 -s -o $@ $<
################################################################################
slides.html: $(SOURCE)
$(PANDOC) -f markdown -t json $< | \
$(DEVALOT_PANDOC) | \
$(PANDOC) -f json -t dzslides \
-s --self-contained -o $@
################################################################################
$(DEVALOT_PANDOC): $(DEVALOT_PANDOC_DIR)
cd $(DEVALOT_PANDOC_DIR) && \
cabal sandbox init && \
cabal install
################################################################################
$(DEVALOT_PANDOC_DIR):
git submodule update --init