annotate makeWebGraphics.sh @ 360:01ded8741361

Use server-side includes (with Apache XBitHack setting) in web. This means that we can have one main web page, dottes.html, for each book and include the intro and tunelist to make the page. This removes the separate header and footer components. Perhaps we should use a template engine instead to generate the output. That means choosing one. And preferably one that isn't aimed only at HTML so we could use it for the printed books. More research required.
author Jim Hague <jim.hague@acm.org>
date Wed, 21 Aug 2013 10:32:50 +0100
parents b61c39beac5f
children 4cc820c7cf04
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 #
223
0ef955669a9a Make transposed tunes use the original audio.
Jim Hague <jim.hague@acm.org>
parents: 197
diff changeset
3 # Make graphics required for the website but not for the book.
43
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
4 # They go into web/<book>.
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
5 #
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 if [ $# != 1 ]; then
223
0ef955669a9a Make transposed tunes use the original audio.
Jim Hague <jim.hague@acm.org>
parents: 197
diff changeset
8 echo "Usage: makeWebGraphics.sh <book dir name>"
43
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
9 exit 1
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
10 fi
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
11
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
12 dir=`pwd`
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
13
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
14 booke=$dir/$1
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
15 builddir=$dir/web/$1
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
16 graphicsdir=$dir/graphics/$1
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
17
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
18 mkdir -p $builddir
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
19
223
0ef955669a9a Make transposed tunes use the original audio.
Jim Hague <jim.hague@acm.org>
parents: 197
diff changeset
20 # Now, for each tune, make the main tune and tune first line bitmaps.
0ef955669a9a Make transposed tunes use the original audio.
Jim Hague <jim.hague@acm.org>
parents: 197
diff changeset
21 # Do this to temp files and rename into place to make updates as
0ef955669a9a Make transposed tunes use the original audio.
Jim Hague <jim.hague@acm.org>
parents: 197
diff changeset
22 # atomic as possible.
43
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
23 find $booke -name "*.abc" | sort |
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
24 while read filename
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
25 do
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
26 name=`basename $filename .abc`
61
3464d5154f49 Fix temp file name to convert.
Jim Hague <jim.hague@acm.org>
parents: 48
diff changeset
27 tmpname=${name}.tmp
318
77372a0166fe Use PDFs as input sources for PNG generation.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
28 convert -density 96 $graphicsdir/${name}.pdf $builddir/${tmpname}.png
77372a0166fe Use PDFs as input sources for PNG generation.
Jim Hague <jim.hague@acm.org>
parents: 223
diff changeset
29 convert -density 96 $graphicsdir/firstline-${name}.pdf $builddir/firstline-${tmpname}.png
43
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
30
191
2fa3c89a0a8a Change web to use PNG rather than JPG.
Jim Hague <jim.hague@acm.org>
parents: 62
diff changeset
31 mv $builddir/${tmpname}.png $builddir/${name}.png
197
8f352063f277 Finish first version of newly tarted up website.
Jim Hague <jim.hague@acm.org>
parents: 191
diff changeset
32 mv $builddir/firstline-${tmpname}.png $builddir/firstline-${name}.png
321
b61c39beac5f Generate different tune PDF for web site download.
Jim Hague <jim.hague@acm.org>
parents: 318
diff changeset
33
b61c39beac5f Generate different tune PDF for web site download.
Jim Hague <jim.hague@acm.org>
parents: 318
diff changeset
34 # Make the web downloadable PDF with the tune title.
b61c39beac5f Generate different tune PDF for web site download.
Jim Hague <jim.hague@acm.org>
parents: 318
diff changeset
35 abcm2ps -E -F singletuneweb -O $builddir/$name.eps $filename
b61c39beac5f Generate different tune PDF for web site download.
Jim Hague <jim.hague@acm.org>
parents: 318
diff changeset
36 # And make the corresponding PDF.
b61c39beac5f Generate different tune PDF for web site download.
Jim Hague <jim.hague@acm.org>
parents: 318
diff changeset
37 epstopdf --outfile=$builddir/$name.pdf $builddir/${name}001.eps
43
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
38 done