-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (27 loc) · 1.2 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
UID := $(shell id -u)
GID := $(shell id -g)
LANG := "en_CA.UTF-8"
LATEX_REF_DOC = --template /assets/basic.tex
PANDOC_CALL = docker run --rm \
--volume "`pwd`:/data" \
--volume "$(shell readlink -f ./assets)":/assets/ \
--user $(shell id -u):$(shell id -g) \
pandoc/ubuntu-latex
SLIDES_LIST := 2024-ECIS-slides
TEACHING_NOTES_LIST := $(patsubst teaching_notes/%.md,%,$(wildcard teaching_notes/[0-9][0-9]*.md))
# Define a rule to build all slides
slides: lecture_slides teaching_notes
lecture_slides: $(addprefix output/,$(addsuffix .html,$(SLIDES_LIST)))
# Define a rule to build all teaching notes
teaching_notes: $(addprefix output/teaching_notes/,$(addsuffix .html,$(TEACHING_NOTES_LIST)))
# Define a pattern rule for building a slide
output/%.html: %.md assets/theme.css
docker run --rm --init -v "$(PWD)":/home/marp/app/ -e LANG=${LANG} -e MARP_USER="${UID}:${GID}" marpteam/marp-cli $< --theme-set assets/theme.css --html --allow-local-files -o $@
# Define a pattern rule for building a teaching note
output/teaching_notes/%.html: teaching_notes/%.md assets/theme.css
mkdir -p output/teaching_notes && \
$(PANDOC_CALL) \
$< \
--filter pandoc-crossref \
--citeproc \
--output $@