diff makeWeb.sh @ 223:0ef955669a9a

Make transposed tunes use the original audio. The aim of MIDI and MP3 is to allow the user to hear what a tune sounds like. For transposed bookes, I think this should be reused from the main booke page, because hearing it at the transposed pitch isn't a major help. And in fact given the way cello transposition is done, the sound won't be transposed anyway. And Jane hasn't complained. This will speed up building the bookes by removing audio generation, the slowest process, from the transposed bookes.
author Jim Hague <jim.hague@acm.org>
date Fri, 22 Feb 2013 01:09:37 +0000
parents a8a46fd79d5c
children 1e4443d58177
line wrap: on
line diff
--- a/makeWeb.sh	Fri Feb 22 00:33:00 2013 +0000
+++ b/makeWeb.sh	Fri Feb 22 01:09:37 2013 +0000
@@ -4,8 +4,8 @@
 # to be already built.
 #
 
-if [ $# -lt 1 -o $# -gt 2 ]; then
-    echo "Usage: makeWeb.sh <book dir name> [<instrument name>]"
+if [ $# -lt 2 -o $# -gt 3 ]; then
+    echo "Usage: makeWeb.sh <book dir name> <master book dir name> [<instrument name>]"
     exit 1
 fi
 
@@ -15,8 +15,10 @@
 webdir=$dir/web/$1
 graphicsdir=$dir/graphics/$1
 output=index.html
-title=$1
 booke=$1
+masterbooke=$2
+title=$booke
+instrument=$3
 
 buildno=`cat buildno.txt`
 subtitle=
@@ -28,10 +30,10 @@
     intro=`cat $bookedir/intro.txt`
 fi
 
-if [ -n "$2" ]; then
+if [ -n "$instrument" ]; then
     # Remove any transposition tag from title.
-    title="${title/-*/} ($2)"
-    subtitle="${subtitle} ($2)"
+    title="${title} ($instrument)"
+    subtitle="${subtitle} ($instrument)"
 fi
 
 mkdir -p $webdir
@@ -64,7 +66,10 @@
         # Generate the tune web page.
         tunepage=${name}.html
 
+        # If the title contains HTML character entities, escape
+        # initial '&' in the title - it means things to sed.
         sed -e "s/@TITLE@/${title//&/\&}/" \
+            -e "s/@MASTERBOOKE@/${masterbooke}/" \
             -e "s/@TUNE@/${name}/" dottes.html.tune > $webdir/$tunepage
 
         sed -e "s/@TITLE@/${title//&/\&}/" \