3 # extract table of contents from index.html
4 # and delete preface link
11 print "<li><b>Git Magic</b></li>"
13 while (!match($0, "</div>")) {
14 gsub("pr01.html", "index.html")
21 ' < $BOOKDIR/index.html
> toc.tmp
23 # for every file except the index...
24 for FILE
in $BOOKDIR/*.html
26 if [ $FILE != "$BOOKDIR/index.html" ]
28 # add "Git Magic - " to titles of all pages
29 sed '/<title>/ s/<title>/&Git Magic - /' -i $FILE
30 sed 's/pr01\.html/index.html/g' -i $FILE
31 # paste ToC into beginning
32 # and add div section with class content for CSS
33 sed '/<body/{n; r toc.tmp
34 a <div class="content">
36 sed '/^<\/body/i </div>' -i $FILE
40 sed '/^<\/body/i </div><div class="footer"><a href="/~blynn/">My Homepage</a></div>' -i $BOOKDIR/*.html
42 cp $BOOKDIR/pr01.html
$BOOKDIR/index.html