summaryrefslogtreecommitdiff
path: root/default.html.do
blob: da9d0b20be6923a5af6a666ecf8caceee2c69422 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
redo-ifchange $2.md build/tex-filter.hs build/template.html5

texfilter() {
		runhaskell -package-conf=$(find .cabal-sandbox -maxdepth 1 -iname '*.conf.d' | head -n 1)  build/tex-filter.hs $@ 2>/dev/null
}

CSS=/style.css

pandoc -t json $2.md | texfilter "$(pwd)" \
    | while read -r x; do
		      [[ -z "${x}" ]] && continue
          echo $x/image.svg
					echo $x/image.svg >&2
      done \
    | xargs -d '\n' redo-ifchange

pandoc -S -f markdown -t json $2.md \
        | texfilter "$(pwd)" \
        | pandoc --template=build/template.html5 --base-header-level=3 --standalone --email-obfuscation=none -f json -t html5 -c $CSS >$3 2>/dev/null