diff makeWeb.sh @ 361:265539086836 build-default-159

Automated merge with ssh://hg.cryhavoc.org.uk/dottes
author Jim Hague <jim.hague@acm.org>
date Wed, 21 Aug 2013 10:32:59 +0100
parents b233893b4c51 01ded8741361
children 5628fcd6c692
line wrap: on
line diff
--- a/makeWeb.sh	Mon Aug 19 10:31:23 2013 +0100
+++ b/makeWeb.sh	Wed Aug 21 10:32:59 2013 +0100
@@ -24,6 +24,7 @@
 webdir=$dir/web/$1
 graphicsdir=$dir/graphics/$1
 output=index.html
+tunelist=tunelist.html
 booke=$1
 masterbooke=$2
 title=$booke
@@ -37,9 +38,6 @@
 if [ -r $bookedir/subtitle.txt ]; then
     subtitle=`cat $bookedir/subtitle.txt`
 fi
-if [ -r $bookedir/intro.txt ]; then
-    intro=`cat $bookedir/intro.txt`
-fi
 
 if [ -n "$instrument" ]; then
     title="${title} ($instrument)"
@@ -49,8 +47,20 @@
 mkdir -p $webdir
 
 sed -e "s/@BUILD@/$buildno/" -e "s/@SUBTITLE@/$subtitle/" \
-    -e "s/@TITLE@/$title/" -e "s/@INTRO@/$intro/" \
-    -e "s/@BOOK@/$booke/" dottes.html.header > $webdir/$output
+    -e "s/@TITLE@/$title/" -e "s/@BOOK@/$booke/" dottes.html > $webdir/$output
+
+# Mark output as executable so it is scanned for server-side includes.
+chmod +x $webdir/$output
+
+for item in intro
+do
+    rm -f $webdir/$item.html
+    if [ -r $booke/$item.txt ]; then
+        txt2tags --no-headers --target=html --outfile=$webdir/$item.html $booke/$item.txt
+    else
+        touch $webdir/$item.html
+    fi
+done
 
 # Copy in the book PDFs. Like the graphics, Midi etc. these are assumed
 # to be already generated.
@@ -105,7 +115,5 @@
             -e "s/@TUNE@/${name}/" dottes.html.tune > $webdir/$tunepage
 
         sed -e "s/@TITLE@/${title//&/\&}/" \
-            -e "s/@TUNE@/${name}/" dottes.html.tuneindex >> $webdir/$output
+            -e "s/@TUNE@/${name}/" dottes.html.tuneindex >> $webdir/$tunelist
     done
-
-cat dottes.html.footer >> $webdir/$output