forked from labwc/labwc.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-site
executable file
·40 lines (30 loc) · 847 Bytes
/
build-site
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
#!/usr/bin/env bash
: ${DEPLOY_DIR:=deploy}
build_src_pages () {
for md in src/*.md; do
html=${md##*/}
html="${DEPLOY_DIR}/${html/%.md/.html}"
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}"
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 "$@"