blob: 728ab57ce52f6e4488552728c260901777705ce1 (
plain)
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
|
#!/bin/bash
inputs="forgefed forgefed-vocabulary"
git_branch=`git rev-parse --abbrev-ref HEAD`
git_commit_id=`git rev-parse HEAD`
git_commit_id_short=`git rev-parse --short HEAD`
now=`date --utc +%Y-%m-%d`
dirty () {
git diff-index --quiet HEAD --
}
render () {
dir="$1"
file="$2"
if [ "$3" == "true" ]; then
toc="--table-of-contents"
else
toc=""
fi
dirty
if [ $? -eq 0 ]; then
gitdirty=""
else
gitdirty="--variable gitdirty"
fi
pandoc $dir/$file.md \
--from markdown \
--to html \
--template html/template.html \
$toc \
$gitdirty \
--variable "gitbranch:$git_branch" \
--variable "gitcommitid:$git_commit_id" \
--variable "gitcommitidshort:$git_commit_id_short" \
--variable "date:$now" \
--number-sections \
--output html/$file.html
}
render html index "false"
for file in $inputs; do
render specification $file "true"
done
|