4 awk -v pat="$1" -v rep="$(sed 's:\\:\\\\:g' $2)" '{gsub(pat,rep);gsub(pat,"\\&");print}'
9 <link rel="stylesheet" type="text/css" href="doc.css">
10 <meta charset="UTF-8">
13 GENERATED-MARKDOWN-HERE
18 t=$(git log -n 1 --format=%ct $x)
19 [[ -n "$t" ]] || t=$(stat -c %Y $x)
20 d=$(LANG= date -d @$t +"%d %B %Y")
21 sed -i "s/^\( Date: *\).*/\1$d/" $x
23 markdown -f toc,autolink $x > $h.toc.no
24 markdown -Tf toc,autolink $x > $h.toc.yes
25 head --bytes=-$(stat -c %s $h.toc.no) $h.toc.yes > $h.toc
27 subst GENERATED-MARKDOWN-HERE $h.toc.no |
28 subst TABLE-OF-CONTENT-HERE $h.toc > $h