-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathbuild-site
More file actions
executable file
·50 lines (37 loc) · 1.05 KB
/
build-site
File metadata and controls
executable file
·50 lines (37 loc) · 1.05 KB
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
#!/usr/bin/env bash
: ${DEPLOY_DIR:=deploy}
: ${ONLY_BUILD_FILES_THAT_CHANGED:=f}
build_src_pages () {
for md in src/*.md; do
html=${md##*/}
html="${DEPLOY_DIR}/${html/%.md/.html}"
if [[ $ONLY_BUILD_FILES_THAT_CHANGED = "t" ]]; then
[[ $html -ot $md ]] || continue
fi
echo "Converting $md to $html"
cat src/template_pre.html > "$html"
pandoc --from=markdown+footnotes "$md" >> "$html"
cat src/template_post.html >> "$html"
done
}
build_man_pages () {
test -d labwc || git clone --branch master --depth 1 https://github.com/labwc/labwc labwc
for scd in labwc/docs/*.scd; do
html=${scd##*/}
html="${DEPLOY_DIR}/${html/%.scd/.html}"
if [[ $ONLY_BUILD_FILES_THAT_CHANGED = "t" ]]; then
[[ $html -ot $scd ]] || continue
fi
echo "Converting $scd to $html"
sed 's/sans-serif;/monospace;/' src/template_pre.html > "$html"
scdoc < "$scd" | pandoc --from man >> "$html"
cat src/template_post.html >> "$html"
./man_post_processing.py "$html"
done
}
main () {
mkdir -p "$DEPLOY_DIR"
build_src_pages
build_man_pages
}
main "$@"