-
Notifications
You must be signed in to change notification settings - Fork 15
/
build
executable file
·37 lines (29 loc) · 973 Bytes
/
build
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
#!/bin/bash
# this can only be done from a terminal; do not try to run it from cron or
# some other headless mechanism
die() { echo "$@"; exit 1; }
[ -f mkdocs.yml ] || die "are you sure you're in the right directory?"
[ "$1" = "clean" ] && rm -rf gen-docs
mkdir -p gen-docs
cd docs
# generate images
for f in `find . -name "*.gv"; find . -name "*.aa"`
do
new=${f/%aa/png}
new=${f/%gv/png}
[ -f ../gen-docs/$new ] && [ ../gen-docs/$new -nt $f ] && continue
echo -n >&2 $f...
../bin/mkdocs.pre-build.image-gen $f ../gen-docs/$new
echo >&2 "done"
done
# generate mkd with vim-syntax; this step is slow, but this is the simplest
# way to support gitolite syntax highlighting in arbitrary markdown.
for f in `find . -name "*.mkd"`
do
[ -f ../gen-docs/$f ] && [ ../gen-docs/$f -nt $f ] && continue
echo -n >&2 $f...
bin/mkdocs.pre-build.mkd-filter < $f > ../gen-docs/$f
echo >&2 "done"
done
# build site
~/.local/bin/mkdocs build