-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmakefile
More file actions
58 lines (47 loc) · 1.12 KB
/
makefile
File metadata and controls
58 lines (47 loc) · 1.12 KB
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
# Makefile for Adam Altmejd's resume
#
# Requirements: pandoc, typst
# Fonts: EB Garamond, Lato, JetBrains Mono, Font Awesome 5
FONTPATH = fonts
## Source and output files
sources := cv.md cv_onepage.md
targets := cv.pdf cv_onepage.pdf cv.html
# Settings
CSL = cv.csl
BIB = publications.bib
TEMPLATE = cv.template.typ
PANDOC_FROM = markdown+smart+yaml_metadata_block+header_attributes+definition_lists
# Git metadata for footer
GIT_DATE := $(shell git log -1 --format=%cs HEAD 2>/dev/null)
all: $(targets)
%.html: %.md
pandoc \
--from $(PANDOC_FROM) \
--citeproc \
--bibliography=$(BIB) \
--csl=$(CSL) \
--to html5 \
--section-divs \
--output $@ $<
%.typ: %.md $(TEMPLATE) $(BIB) $(CSL)
pandoc \
--from $(PANDOC_FROM) \
--to typst \
--citeproc \
--bibliography=$(BIB) \
--csl=$(CSL) \
--template=$(TEMPLATE) \
--variable=git-date:"$(GIT_DATE)" \
--standalone \
--output $@ $<
%.pdf: %.typ
typst compile --font-path $(FONTPATH) $<
rm -f $<
.PHONY: git clean
git:
git add $(sources) $(targets)
git commit --allow-empty -m "CV makefile auto commit."
git push
clean:
rm -f $(targets)
rm -f *.typ