-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
27 lines (19 loc) · 1.26 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
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 := $(patsubst slides/%.md,%,$(wildcard slides/[0-9][0-9]*.md))
# Define a rule to build all slides
slides: lecture_slides lecture_slides_pdfs
lecture_slides: $(addprefix output/,$(addsuffix .html,$(SLIDES_LIST)))
lecture_slides_pdfs: $(addprefix output/,$(addsuffix .pdf,$(SLIDES_LIST)))
# Define a pattern rule for building a slide
output/%.html: slides/%.md assets/template/theme.css
docker run --rm --init -v "$(PWD)":/home/marp/app/ -e LANG=${LANG} -e MARP_USER="${UID}:${GID}" marpteam/marp-cli:v3.4.0 $< --theme-set assets/template/theme.css --html --allow-local-files -o $@
output/%.pdf: slides/%.md assets/template/theme.css
docker run --rm --init -v "$(shell pwd)":/home/marp/app/ -v "$(shell pwd)/assets":/home/marp/app/assets -v "$(shell pwd)/assets":/home/marp/app/assets -e LANG=$(LANG) -e MARP_USER=$(shell id -u):$(shell id -g) marpteam/marp-cli:v3.4.0 /home/marp/app/$< --theme-set /home/marp/app/assets/template/theme.css --pdf --allow-local-files -o /home/marp/app/$@