format.sh 688 Bytes
Newer Older
Lars Wirzenius's avatar
Lars Wirzenius committed
1 2 3 4
#!/bin/sh

set -eu

5 6 7 8
cleanup()
{
    rm -rf "$tmp"
}
9 10 11

tmp="$(mktemp -d)"
trap cleanup EXIT
12 13 14 15

version="$(git describe)"
sed "s/^date: .*/date: $version/" vmdb2.mdwn > "$tmp/prelude.mdwn"

Lars Wirzenius's avatar
Lars Wirzenius committed
16 17 18 19 20 21 22
pandoc \
    --self-contained \
    --standalone \
    --css vmdb2.css \
    --toc \
    --number-sections \
    -o vmdb2.html \
23
    "$tmp/prelude.mdwn" vmdb/plugins/*.mdwn
Lars Wirzenius's avatar
Lars Wirzenius committed
24 25 26 27 28 29 30 31 32 33 34 35

pandoc \
    --toc \
    --number-sections \
    -Vdocumentclass=report \
    -Vgeometry:a4paper \
    -Vfontsize:12pt \
    -Vmainfont:FreeSerif \
    -Vsansfont:FreeSans \
    -Vmonofont:FreeMonoBold \
    '-Vgeometry:top=2cm, bottom=2.5cm, left=2cm, right=1cm' \
    -o vmdb2.pdf \
36
    "$tmp/prelude.mdwn" vmdb/plugins/*.mdwn