-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
38 lines (24 loc) · 867 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
35
36
37
PANDOC := pandoc -t revealjs --metadata pagetitle="..." -H dark.css -V width=\"100%\" -V height=\"90%\" -V transition=\"none\" --slide-level 1
SOURCE_MARKDOWN := $(wildcard *.md)
TARGET_MARKDOWN := $(SOURCE_MARKDOWN:%.md=%.md_2)
PANDOC_MARKDOWN := $(SOURCE_MARKDOWN:%.md=%.html)
AWK_FLAGS :=
PANDOC_FLAGS := -V revealjs-url=https://revealjs.com
.PHONY: html clean serve stop
all: $(PANDOC_MARKDOWN)
verbose: AWK_FLAGS += -v show_rules=1
verbose: all
local: PANDOC_FLAGS =
local: all
$(TARGET_MARKDOWN): %.md_2 : %.md $(SOURCE_MARKDOWN)
AWKPATH=. gawk -f converter.awk $(AWK_FLAGS) $< > $@
$(PANDOC_MARKDOWN): %.html : %.md_2 $(TARGET_MARKDOWN)
$(PANDOC) -s $< -o $@
html: $(PANDOC_MARKDOWN)
clean:
rm *.md_2; rm *.html
serve: server.PID all
server.PID:
python3 -m http.server & echo $$! > server.PID;
stop:
kill `cat server.PID` && rm server.PID