mkscripts.sh
The generator for scripts' html previews.
01:
02:
03: mkdir -p html
04: cat > html/index.html << EOF
05: <ul>
06: EOF
07: for script in $(basename -a src/*)
08: do
09: cat > html/$script.html <<HEADER
10: <h1> $script </h1>
11: $(grep -Eo '[@]desc .*' src/$script|cut -d' ' -f2-|lowdown)
12: <div><a href="../src/$script"> [raw] </a></div>
13: <hr/>
14: HEADER
15: cat >> html/index.html << EOF
16: <li> <a href="$script.html">$script</a> — $(grep -Eo '[@]desc .*' src/$script|cut -d' ' -f2-|lowdown) </li>
17: EOF
18:
19: source-highlight -t 4 --line-number-ref -f xhtml -i src/$script >> html/$script.html
20: done
21:
22: cat >> html/index.html << EOF
23: </ul>
24: EOF
25: