Mercurial > dottes
comparison 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 |
comparison
equal
deleted
inserted
replaced
357:9aa6a0f09b19 | 361:265539086836 |
---|---|
22 | 22 |
23 bookedir=$dir/$1 | 23 bookedir=$dir/$1 |
24 webdir=$dir/web/$1 | 24 webdir=$dir/web/$1 |
25 graphicsdir=$dir/graphics/$1 | 25 graphicsdir=$dir/graphics/$1 |
26 output=index.html | 26 output=index.html |
27 tunelist=tunelist.html | |
27 booke=$1 | 28 booke=$1 |
28 masterbooke=$2 | 29 masterbooke=$2 |
29 title=$booke | 30 title=$booke |
30 instrument=$3 | 31 instrument=$3 |
31 | 32 |
35 subtitle= | 36 subtitle= |
36 intro= | 37 intro= |
37 if [ -r $bookedir/subtitle.txt ]; then | 38 if [ -r $bookedir/subtitle.txt ]; then |
38 subtitle=`cat $bookedir/subtitle.txt` | 39 subtitle=`cat $bookedir/subtitle.txt` |
39 fi | 40 fi |
40 if [ -r $bookedir/intro.txt ]; then | |
41 intro=`cat $bookedir/intro.txt` | |
42 fi | |
43 | 41 |
44 if [ -n "$instrument" ]; then | 42 if [ -n "$instrument" ]; then |
45 title="${title} ($instrument)" | 43 title="${title} ($instrument)" |
46 subtitle="${subtitle} ($instrument)" | 44 subtitle="${subtitle} ($instrument)" |
47 fi | 45 fi |
48 | 46 |
49 mkdir -p $webdir | 47 mkdir -p $webdir |
50 | 48 |
51 sed -e "s/@BUILD@/$buildno/" -e "s/@SUBTITLE@/$subtitle/" \ | 49 sed -e "s/@BUILD@/$buildno/" -e "s/@SUBTITLE@/$subtitle/" \ |
52 -e "s/@TITLE@/$title/" -e "s/@INTRO@/$intro/" \ | 50 -e "s/@TITLE@/$title/" -e "s/@BOOK@/$booke/" dottes.html > $webdir/$output |
53 -e "s/@BOOK@/$booke/" dottes.html.header > $webdir/$output | 51 |
52 # Mark output as executable so it is scanned for server-side includes. | |
53 chmod +x $webdir/$output | |
54 | |
55 for item in intro | |
56 do | |
57 rm -f $webdir/$item.html | |
58 if [ -r $booke/$item.txt ]; then | |
59 txt2tags --no-headers --target=html --outfile=$webdir/$item.html $booke/$item.txt | |
60 else | |
61 touch $webdir/$item.html | |
62 fi | |
63 done | |
54 | 64 |
55 # Copy in the book PDFs. Like the graphics, Midi etc. these are assumed | 65 # Copy in the book PDFs. Like the graphics, Midi etc. these are assumed |
56 # to be already generated. | 66 # to be already generated. |
57 cp $1-*.pdf $webdir | 67 cp $1-*.pdf $webdir |
58 | 68 |
103 -e "s/@CREDITVISIBILITY@/${creditvisibility}/" \ | 113 -e "s/@CREDITVISIBILITY@/${creditvisibility}/" \ |
104 -e "s/@LASTCHANGED@/${lastchanged}/" \ | 114 -e "s/@LASTCHANGED@/${lastchanged}/" \ |
105 -e "s/@TUNE@/${name}/" dottes.html.tune > $webdir/$tunepage | 115 -e "s/@TUNE@/${name}/" dottes.html.tune > $webdir/$tunepage |
106 | 116 |
107 sed -e "s/@TITLE@/${title//&/\&}/" \ | 117 sed -e "s/@TITLE@/${title//&/\&}/" \ |
108 -e "s/@TUNE@/${name}/" dottes.html.tuneindex >> $webdir/$output | 118 -e "s/@TUNE@/${name}/" dottes.html.tuneindex >> $webdir/$tunelist |
109 done | 119 done |
110 | |
111 cat dottes.html.footer >> $webdir/$output |