-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
40 lines (32 loc) · 1.06 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
38
39
40
NAME=infrastructure-agnostic-hypertext
TEXT=$(NAME).md
BIB=bibliography.bib
# required executables
WCITE=./node_modules/wcite/bin/wcite
PWCITE=./node_modules/wcite/bin/pwcite
PANDOC=pandoc
all: html pdf
html: html/index.html
pdf: $(NAME).pdf
svg: $(patsubst %.tikz,%.svg,$(wildcard *.tikz))
wikidata:
$(WCITE) wcite.json update
$(NAME).tex: metadata.yaml latex.yaml $(TEXT) $(BIB)
pandoc --template template.tex --natbib --bibliography $(BIB) \
-s -o $@ metadata.yaml latex.yaml $(TEXT)
$(BIB): wcite.json
$(WCITE) wcite.yaml -f bibtex > $(BIB)
$(NAME).pdf: $(NAME).tex
@echo pdflatex $@
pdflatex $< && bibtex $(basename $<) && pdflatex $< && pdflatex $<
html/index.html: metadata.yaml interactions.yaml $(TEXT) wcite.yaml wcite.json svg
mkdir -p html
$(PANDOC) -s -t json \
wcite.yaml metadata.yaml interactions.yaml html.yaml $(TEXT) references.html \
| ./adjust-for-html.jq | \
$(PANDOC) -f json -F $(PWCITE) -F pandoc-citeproc --section-divs \
--template template.html -o $@
.SUFFIXES: .tikz .svg
.tikz.svg:
./tikz2svg.sh $<
mkdir -p html && cp *.svg html