forked from bitroniq/ten-seconds-cv
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
37 lines (28 loc) · 1001 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
SHELL = /bin/sh
FILE0 = main
TEX_TEMPLATE = $(FILE0).template.tex
TEX = $(FILE0).raw.tex
PDF = $(FILE0).pdf
COVER = cover.png
RAW_PDF = $(FILE0).raw.pdf
all: pdf
pdf:
mkdir -p build/pdf/
cp latex/* build/pdf/
cp data.md build/pdf/
wget --output-document=build/pdf/img.jpg $$(yq e '.image' data.md | grep https)
python3 heatmap.py
mv heatmap.eps build/pdf/
cd build/pdf/; \
pandoc data.md --pdf-engine xelatex --template sidebar.template.tex -o sidebar.tex ; \
pandoc data.md --pdf-engine xelatex --template $(TEX_TEMPLATE) -o $(TEX) ; \
xelatex -shell-escape -output-driver="xdvipdfmx -z 0" $(TEX) ; \
echo "Compresing PDF..."; \
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.5 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -dPrinted=false -sOutputFile=$(PDF) $(RAW_PDF); \
gs -sDEVICE=png16m -sOutputFile=cover.png -r144 $(RAW_PDF);
cp build/pdf/$(PDF) ./rendered.pdf
cp build/pdf/$(COVER) ./cover.png
clean-pdf:
rm -rf build/pdf/
clean:
rm -rf build/