summaryrefslogtreecommitdiffstats
path: root/docs/make.sh
blob: da3cacc63bc1643d717ea20268a13a27dd58976e (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
#! /bin/bash
PAGES=(features netcfg netcfg-profiles)

make_page() {
    echo '<html><body>'
    grep -v '^%' $1 | markdown -x def_list -x headerid /dev/stdin
    echo '</body></html>'
}

# HTML page generation
for page in ${PAGES[@]}; do
    rm -f ${page}.html
    if which pandoc &>/dev/null; then
        pandoc -s --toc -w html --email-obfuscation=javascript -c header.css -o ${page}.html $page.txt
    else
        make_page $page.txt > ${page}.html
    fi
done

# Generate manpages
if which pandoc &>/dev/null; then
    pandoc -s -w man -o netcfg.8 netcfg.txt
    pandoc -s -w man -o netcfg-profiles.5 netcfg-profiles.txt
fi

# vim: set ts=4 sw=4 et tw=0: