annotate makeWeb.sh @ 500:8e835e4de9fe build-default-212

Automated merge with ssh://hg.cryhavoc.org.uk/dottes
author Jim Hague <jim.hague@acm.org>
date Thu, 19 Jun 2014 21:36:31 +0100
parents 626fc1c02ce6
children 4cc739fe13ab
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
43
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
1 #!/bin/bash
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
2 #
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
3 # Build the website. The common items and the web items are assumed
484
4fab69a1027d Add MusicXML conversion to tune pages.
Jim Hague <jim.hague@acm.org>
parents: 474
diff changeset
4 # to be already built. This generates the MusicXML and the page HTML
4fab69a1027d Add MusicXML conversion to tune pages.
Jim Hague <jim.hague@acm.org>
parents: 474
diff changeset
5 # and shuffles other files ino the right place.
43
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
6 #
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
7
238
8bea9fdeba40 Revert tracing change than slipped into the archive.
Jim Hague <jim.hague@laicatc.com>
parents: 237
diff changeset
8 #set -x
229
1e4443d58177 Modify Change tune handling.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
9
1e4443d58177 Modify Change tune handling.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
10 # Restore titles like 'Exploding Potato, The' to the
1e4443d58177 Modify Change tune handling.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
11 # expected 'The Exploding Potato'.
1e4443d58177 Modify Change tune handling.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
12 fixtitle()
1e4443d58177 Modify Change tune handling.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
13 {
1e4443d58177 Modify Change tune handling.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
14 retval=`echo "$1" | sed -e "s/\(.*\), *\(.*\)/\2 \1/"`
1e4443d58177 Modify Change tune handling.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
15 }
1e4443d58177 Modify Change tune handling.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
16
400
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
17 # Format a key in ABC (G, Gmin, etc.) in standard presentation format.
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
18 fixkey()
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
19 {
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
20 letter=${1:0:1}
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
21 accidental=${1:1:1}
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
22 if [ "$accidental" != "#" -a "$accidental" != "b" ]; then
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
23 accidental=""
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
24 mode=${1:1:3}
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
25 else
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
26 mode=${1:2:3}
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
27 fi
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
28 mode=${mode,,}
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
29 mode=${mode/ //g}
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
30 if [ "$mode" = "m" -o "$mode" = "min" ]; then
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
31 mode="Minor"
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
32 elif [ "$mode" = "mix" ]; then
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
33 mode="Mixolydian"
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
34 elif [ "$mode" = "dor" ]; then
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
35 mode="Dorian"
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
36 elif [ "$mode" = "phr" ]; then
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
37 mode="Phrygian"
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
38 elif [ "$mode" = "lyd" ]; then
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
39 mode="Lydian"
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
40 elif [ "$mode" = "loc" ]; then
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
41 mode="Locrian"
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
42 else
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
43 mode="Major"
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
44 fi
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
45 retval="${letter}${accidental} ${mode}"
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
46 }
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
47
223
0ef955669a9a Make transposed tunes use the original audio.
Jim Hague <jim.hague@acm.org>
parents: 217
diff changeset
48 if [ $# -lt 2 -o $# -gt 3 ]; then
0ef955669a9a Make transposed tunes use the original audio.
Jim Hague <jim.hague@acm.org>
parents: 217
diff changeset
49 echo "Usage: makeWeb.sh <book dir name> <master book dir name> [<instrument name>]"
43
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
50 exit 1
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
51 fi
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
52
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
53 dir=`pwd`
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
54
197
8f352063f277 Finish first version of newly tarted up website.
Jim Hague <jim.hague@acm.org>
parents: 191
diff changeset
55 bookedir=$dir/$1
43
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
56 webdir=$dir/web/$1
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
57 graphicsdir=$dir/graphics/$1
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
58 output=index.html
360
01ded8741361 Use server-side includes (with Apache XBitHack setting) in web.
Jim Hague <jim.hague@acm.org>
parents: 359
diff changeset
59 tunelist=tunelist.html
197
8f352063f277 Finish first version of newly tarted up website.
Jim Hague <jim.hague@acm.org>
parents: 191
diff changeset
60 booke=$1
223
0ef955669a9a Make transposed tunes use the original audio.
Jim Hague <jim.hague@acm.org>
parents: 217
diff changeset
61 masterbooke=$2
0ef955669a9a Make transposed tunes use the original audio.
Jim Hague <jim.hague@acm.org>
parents: 217
diff changeset
62 title=$booke
0ef955669a9a Make transposed tunes use the original audio.
Jim Hague <jim.hague@acm.org>
parents: 217
diff changeset
63 instrument=$3
484
4fab69a1027d Add MusicXML conversion to tune pages.
Jim Hague <jim.hague@acm.org>
parents: 474
diff changeset
64 abc2xml=$dir/abc2xml/abc2xml.py
43
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
65
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
66 buildno=`cat buildno.txt`
309
07e9fa311c6f % added to buildno.txt needs to be removed for web.
Jim Hague <jim.hague@acm.org>
parents: 238
diff changeset
67 # Remove trailing % added for Latex purposes.
07e9fa311c6f % added to buildno.txt needs to be removed for web.
Jim Hague <jim.hague@acm.org>
parents: 238
diff changeset
68 buildno=${buildno%%%}
43
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
69 subtitle=
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
70 intro=
197
8f352063f277 Finish first version of newly tarted up website.
Jim Hague <jim.hague@acm.org>
parents: 191
diff changeset
71 if [ -r $bookedir/subtitle.txt ]; then
8f352063f277 Finish first version of newly tarted up website.
Jim Hague <jim.hague@acm.org>
parents: 191
diff changeset
72 subtitle=`cat $bookedir/subtitle.txt`
43
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
73 fi
197
8f352063f277 Finish first version of newly tarted up website.
Jim Hague <jim.hague@acm.org>
parents: 191
diff changeset
74
223
0ef955669a9a Make transposed tunes use the original audio.
Jim Hague <jim.hague@acm.org>
parents: 217
diff changeset
75 if [ -n "$instrument" ]; then
0ef955669a9a Make transposed tunes use the original audio.
Jim Hague <jim.hague@acm.org>
parents: 217
diff changeset
76 title="${title} ($instrument)"
0ef955669a9a Make transposed tunes use the original audio.
Jim Hague <jim.hague@acm.org>
parents: 217
diff changeset
77 subtitle="${subtitle} ($instrument)"
43
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
78 fi
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
79
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
80 mkdir -p $webdir
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
81
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
82 sed -e "s/@BUILD@/$buildno/" -e "s/@SUBTITLE@/$subtitle/" \
360
01ded8741361 Use server-side includes (with Apache XBitHack setting) in web.
Jim Hague <jim.hague@acm.org>
parents: 359
diff changeset
83 -e "s/@TITLE@/$title/" -e "s/@BOOK@/$booke/" dottes.html > $webdir/$output
01ded8741361 Use server-side includes (with Apache XBitHack setting) in web.
Jim Hague <jim.hague@acm.org>
parents: 359
diff changeset
84
01ded8741361 Use server-side includes (with Apache XBitHack setting) in web.
Jim Hague <jim.hague@acm.org>
parents: 359
diff changeset
85 for item in intro
01ded8741361 Use server-side includes (with Apache XBitHack setting) in web.
Jim Hague <jim.hague@acm.org>
parents: 359
diff changeset
86 do
01ded8741361 Use server-side includes (with Apache XBitHack setting) in web.
Jim Hague <jim.hague@acm.org>
parents: 359
diff changeset
87 rm -f $webdir/$item.html
01ded8741361 Use server-side includes (with Apache XBitHack setting) in web.
Jim Hague <jim.hague@acm.org>
parents: 359
diff changeset
88 if [ -r $booke/$item.txt ]; then
01ded8741361 Use server-side includes (with Apache XBitHack setting) in web.
Jim Hague <jim.hague@acm.org>
parents: 359
diff changeset
89 txt2tags --no-headers --target=html --outfile=$webdir/$item.html $booke/$item.txt
01ded8741361 Use server-side includes (with Apache XBitHack setting) in web.
Jim Hague <jim.hague@acm.org>
parents: 359
diff changeset
90 else
01ded8741361 Use server-side includes (with Apache XBitHack setting) in web.
Jim Hague <jim.hague@acm.org>
parents: 359
diff changeset
91 touch $webdir/$item.html
01ded8741361 Use server-side includes (with Apache XBitHack setting) in web.
Jim Hague <jim.hague@acm.org>
parents: 359
diff changeset
92 fi
01ded8741361 Use server-side includes (with Apache XBitHack setting) in web.
Jim Hague <jim.hague@acm.org>
parents: 359
diff changeset
93 done
43
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
94
197
8f352063f277 Finish first version of newly tarted up website.
Jim Hague <jim.hague@acm.org>
parents: 191
diff changeset
95 # Copy in the book PDFs. Like the graphics, Midi etc. these are assumed
8f352063f277 Finish first version of newly tarted up website.
Jim Hague <jim.hague@acm.org>
parents: 191
diff changeset
96 # to be already generated.
199
b8d18ccdc6e4 Fix up typo from last commit of this file.
Jim Hague <jim.hague@acm.org>
parents: 197
diff changeset
97 cp $1-*.pdf $webdir
45
689026e2de0c Web. Add download links for book.
Jim Hague <jim.hague@laicatc.com>
parents: 43
diff changeset
98
382
04bd083eed29 Ratchet up the IE8 attempt.
Jim Hague <jim.hague@acm.org>
parents: 366
diff changeset
99 # Now, for each tune, make the tune page.
400
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
100 rm -f $webdir/$tunelist
197
8f352063f277 Finish first version of newly tarted up website.
Jim Hague <jim.hague@acm.org>
parents: 191
diff changeset
101 find $bookedir -name "*.abc" | sort |
43
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
102 while read filename
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
103 do
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
104 name=`basename $filename .abc`
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
105
484
4fab69a1027d Add MusicXML conversion to tune pages.
Jim Hague <jim.hague@acm.org>
parents: 474
diff changeset
106 # Extract items to substitute in the web page.
229
1e4443d58177 Modify Change tune handling.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
107 title=`$dir/abcfield.py --field T --html $filename`
1e4443d58177 Modify Change tune handling.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
108 fixtitle "$title"
1e4443d58177 Modify Change tune handling.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
109 title=$retval
319
cbe9c10b5a3e Render tune title, subtitle and composer in Latex/HTML and not in the image.
Jim Hague <jim.hague@acm.org>
parents: 309
diff changeset
110 subtitle=`$dir/abcfield.py --index 2 --field T --latex $filename`
474
1fa67fce807f Handle trailing ", The" in subtitles as well as titles.
Jim Hague <jim.hague@acm.org>
parents: 402
diff changeset
111 fixtitle "$subtitle"
1fa67fce807f Handle trailing ", The" in subtitles as well as titles.
Jim Hague <jim.hague@acm.org>
parents: 402
diff changeset
112 subtitle=$retval
319
cbe9c10b5a3e Render tune title, subtitle and composer in Latex/HTML and not in the image.
Jim Hague <jim.hague@acm.org>
parents: 309
diff changeset
113 composer=`$dir/abcfield.py --field C --latex $filename`
326
27f29e8aafea Add --contains flag to abcfield.py.
Jim Hague <jim.hague@acm.org>
parents: 321
diff changeset
114 changefile=`$dir/abcfield.py --field N --contains "Change:" $filename | sed -e "s/Change: *//"`
229
1e4443d58177 Modify Change tune handling.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
115 changetitle=""
1e4443d58177 Modify Change tune handling.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
116 changevisibility="no"
1e4443d58177 Modify Change tune handling.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
117 if [ -n "$changefile" ]; then
1e4443d58177 Modify Change tune handling.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
118 changetitle=`$dir/abcfield.py --field T --html $bookedir/$changefile`
1e4443d58177 Modify Change tune handling.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
119 changevisibility="yes"
1e4443d58177 Modify Change tune handling.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
120
1e4443d58177 Modify Change tune handling.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
121 fixtitle "$changetitle"
1e4443d58177 Modify Change tune handling.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
122 changetitle=$retval
1e4443d58177 Modify Change tune handling.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
123 fi
326
27f29e8aafea Add --contains flag to abcfield.py.
Jim Hague <jim.hague@acm.org>
parents: 321
diff changeset
124 credit=`$dir/abcfield.py --field N --contains "Credit:" $filename | sed -e "s/Credit: *//"`
27f29e8aafea Add --contains flag to abcfield.py.
Jim Hague <jim.hague@acm.org>
parents: 321
diff changeset
125 creditvisibility="no"
27f29e8aafea Add --contains flag to abcfield.py.
Jim Hague <jim.hague@acm.org>
parents: 321
diff changeset
126 if [ -n "$credit" ]; then
27f29e8aafea Add --contains flag to abcfield.py.
Jim Hague <jim.hague@acm.org>
parents: 321
diff changeset
127 creditvisibility="yes"
27f29e8aafea Add --contains flag to abcfield.py.
Jim Hague <jim.hague@acm.org>
parents: 321
diff changeset
128 fi
355
b233893b4c51 Add date of last change to bottom of web tune page.
Jim Hague <jim.hague@acm.org>
parents: 326
diff changeset
129 lastchanged=`hg log --limit 1 --template "{date|shortdate}" $filename`
400
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
130 key=`$dir/abcfield.py --field K $filename`
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
131 fixkey $key
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
132 key=$retval
212
9502f4883006 When listing titles for web, straighten out ones of the form 'Something, The'.
Jim Hague <jim.hague@laicatc.com>
parents: 202
diff changeset
133
321
b61c39beac5f Generate different tune PDF for web site download.
Jim Hague <jim.hague@acm.org>
parents: 319
diff changeset
134 # Copy the ABC into the web.
43
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
135 cp $filename $webdir
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
136
484
4fab69a1027d Add MusicXML conversion to tune pages.
Jim Hague <jim.hague@acm.org>
parents: 474
diff changeset
137 # Generate MusicXML into the web.
4fab69a1027d Add MusicXML conversion to tune pages.
Jim Hague <jim.hague@acm.org>
parents: 474
diff changeset
138 python $abc2xml $filename > ${webdir}/${name}.xml
4fab69a1027d Add MusicXML conversion to tune pages.
Jim Hague <jim.hague@acm.org>
parents: 474
diff changeset
139
400
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
140 # If we are not the master booke, link the mp3s in from the
382
04bd083eed29 Ratchet up the IE8 attempt.
Jim Hague <jim.hague@acm.org>
parents: 366
diff changeset
141 # master page in a desperate attempt to make IE8 work.
384
ce5dccdd45bd Comment on soft link creation. Jenkins archive will dereference them.
Jim Hague <jim.hague@acm.org>
parents: 382
diff changeset
142 # The Jenkins archive will dereference the soft link, it seems,
ce5dccdd45bd Comment on soft link creation. Jenkins archive will dereference them.
Jim Hague <jim.hague@acm.org>
parents: 382
diff changeset
143 # but I guess I can live with copies of the MP3 for now.
382
04bd083eed29 Ratchet up the IE8 attempt.
Jim Hague <jim.hague@acm.org>
parents: 366
diff changeset
144 if [ "$booke" != "$masterbooke" ]; then
386
e09ff88ab469 Pigwidgeon doesn't have -r in ln. So do it another way.
Jim Hague <jim.hague@acm.org>
parents: 384
diff changeset
145 pushd ${webdir} > /dev/null
402
f7dbde7c9661 Fix command error linking MP3s into transposed directory.
Jim Hague <jim.hague@acm.org>
parents: 400
diff changeset
146 ln -f -s ../${masterbooke}/*${name}.mp3 .
386
e09ff88ab469 Pigwidgeon doesn't have -r in ln. So do it another way.
Jim Hague <jim.hague@acm.org>
parents: 384
diff changeset
147 popd > /dev/null
382
04bd083eed29 Ratchet up the IE8 attempt.
Jim Hague <jim.hague@acm.org>
parents: 366
diff changeset
148 fi
04bd083eed29 Ratchet up the IE8 attempt.
Jim Hague <jim.hague@acm.org>
parents: 366
diff changeset
149
197
8f352063f277 Finish first version of newly tarted up website.
Jim Hague <jim.hague@acm.org>
parents: 191
diff changeset
150 # Generate the tune web page.
8f352063f277 Finish first version of newly tarted up website.
Jim Hague <jim.hague@acm.org>
parents: 191
diff changeset
151 tunepage=${name}.html
400
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
152 learnerpage=learner-${name}.html
197
8f352063f277 Finish first version of newly tarted up website.
Jim Hague <jim.hague@acm.org>
parents: 191
diff changeset
153
223
0ef955669a9a Make transposed tunes use the original audio.
Jim Hague <jim.hague@acm.org>
parents: 217
diff changeset
154 # If the title contains HTML character entities, escape
0ef955669a9a Make transposed tunes use the original audio.
Jim Hague <jim.hague@acm.org>
parents: 217
diff changeset
155 # initial '&' in the title - it means things to sed.
202
540511b14c73 Handle '&' appearing in HTML output from tune titles.
Jim Hague <jim.hague@acm.org>
parents: 199
diff changeset
156 sed -e "s/@TITLE@/${title//&/\&}/" \
319
cbe9c10b5a3e Render tune title, subtitle and composer in Latex/HTML and not in the image.
Jim Hague <jim.hague@acm.org>
parents: 309
diff changeset
157 -e "s/@SUBTITLE@/${subtitle}/" \
cbe9c10b5a3e Render tune title, subtitle and composer in Latex/HTML and not in the image.
Jim Hague <jim.hague@acm.org>
parents: 309
diff changeset
158 -e "s/@COMPOSER@/${composer}/" \
400
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
159 -e "s/@KEY@/${key}/" \
223
0ef955669a9a Make transposed tunes use the original audio.
Jim Hague <jim.hague@acm.org>
parents: 217
diff changeset
160 -e "s/@MASTERBOOKE@/${masterbooke}/" \
229
1e4443d58177 Modify Change tune handling.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
161 -e "s/@CHANGETITLE@/${changetitle//&/\&}/" \
1e4443d58177 Modify Change tune handling.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
162 -e "s/@CHANGETUNE@/${changefile/.abc/.html}/" \
1e4443d58177 Modify Change tune handling.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
163 -e "s/@CHANGEVISIBILITY@/${changevisibility}/" \
326
27f29e8aafea Add --contains flag to abcfield.py.
Jim Hague <jim.hague@acm.org>
parents: 321
diff changeset
164 -e "s/@CREDIT@/${credit}/" \
27f29e8aafea Add --contains flag to abcfield.py.
Jim Hague <jim.hague@acm.org>
parents: 321
diff changeset
165 -e "s/@CREDITVISIBILITY@/${creditvisibility}/" \
355
b233893b4c51 Add date of last change to bottom of web tune page.
Jim Hague <jim.hague@acm.org>
parents: 326
diff changeset
166 -e "s/@LASTCHANGED@/${lastchanged}/" \
197
8f352063f277 Finish first version of newly tarted up website.
Jim Hague <jim.hague@acm.org>
parents: 191
diff changeset
167 -e "s/@TUNE@/${name}/" dottes.html.tune > $webdir/$tunepage
8f352063f277 Finish first version of newly tarted up website.
Jim Hague <jim.hague@acm.org>
parents: 191
diff changeset
168
202
540511b14c73 Handle '&' appearing in HTML output from tune titles.
Jim Hague <jim.hague@acm.org>
parents: 199
diff changeset
169 sed -e "s/@TITLE@/${title//&/\&}/" \
400
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
170 -e "s/@SUBTITLE@/${subtitle}/" \
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
171 -e "s/@COMPOSER@/${composer}/" \
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
172 -e "s/@KEY@/${key}/" \
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
173 -e "s/@MASTERBOOKE@/${masterbooke}/" \
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
174 -e "s/@CHANGETITLE@/${changetitle//&/\&}/" \
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
175 -e "s/@CHANGETUNE@/${changefile/.abc/.html}/" \
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
176 -e "s/@CHANGEVISIBILITY@/${changevisibility}/" \
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
177 -e "s/@CREDIT@/${credit}/" \
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
178 -e "s/@CREDITVISIBILITY@/${creditvisibility}/" \
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
179 -e "s/@LASTCHANGED@/${lastchanged}/" \
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
180 -e "s/@TUNE@/${name}/" dottes.html.learnertune > $webdir/$learnerpage
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
181
f1c4abe4fc75 First go at adding the tune learner page.
Jim Hague <jim.hague@acm.org>
parents: 386
diff changeset
182 sed -e "s/@TITLE@/${title//&/\&}/" \
360
01ded8741361 Use server-side includes (with Apache XBitHack setting) in web.
Jim Hague <jim.hague@acm.org>
parents: 359
diff changeset
183 -e "s/@TUNE@/${name}/" dottes.html.tuneindex >> $webdir/$tunelist
43
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
184 done