3 # Extract table of contents from index.html and delete preface link.
17 print "<li><b>'"$TITLE"'</b></li>"
19 while (!match($0, "</div>")) {
20 gsub("pr01.html", "index.html")
27 ' < $BOOKDIR/index.html
> toc.tmp
29 # For every file except the index...
30 for FILE
in $BOOKDIR/*.html
32 if [ $FILE != "$BOOKDIR/index.html" ]
34 # Prepend "Git Magic - " to titles of all pages.
35 sed '/<title>/ s/<title>/&'"$TITLE"' - /' -i $FILE
36 sed 's/pr01\.html/index.html/g' -i $FILE
37 # Paste ToC into beginning and add div section with class content for CSS.
38 sed '/<body/{n; r toc.tmp
39 a <div class="content">
41 sed '/^<\/body/i </div>' -i $FILE
45 # Originally this link was "My Homepage". Since it appears on translations of
46 # the guide, I changed it to my name so it doesn't have to be translated.
47 sed '/^<\/body/i </div><div class="footer"><a href="/~blynn/">Ben Lynn</a></div>' -i $BOOKDIR/*.html
49 cp $BOOKDIR/pr01.html
$BOOKDIR/index.html