3 # Extract table of contents from index.html and delete preface link.
11 print "<li><b>'"$TITLE"'</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 # Prepend "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 and add div section with class content for CSS.
32 sed '/<body/{n; r toc.tmp
33 a <div class="content">
35 sed '/^<\/body/i </div>' -i $FILE
39 # Originally this link was "My Homepage". Since it appears on translations of
40 # the guide, I changed it to my name so it doesn't have to be translated.
41 sed '/^<\/body/i </div><div class="footer"><a href="/~blynn/">Ben Lynn</a></div>' -i $BOOKDIR/*.html
43 cp $BOOKDIR/pr01.html
$BOOKDIR/index.html