annotate makeWebGraphics.sh @ 650:9982077ac9b2

Update tune format files. In the main one, just remove a couple of now deprecated settings that did nothing anyway. For the web format, which is actually the format used to generate the downloadable PDFs, bring it into line with the main format but leave the margins at the default settings. Also remove the deprecated settings.
author Jim Hague <jim.hague@acm.org>
date Thu, 10 Nov 2016 00:47:55 +0000
parents b4eb1753c80f
children ce5c7214f9aa
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
608
b4eb1753c80f Up the resolution of the web graphics.
Jim Hague <jim.hague@acm.org>
parents: 536
diff changeset
28 convert -colors 256 -quality 90 -density 200 $graphicsdir/${name}.pdf $builddir/${tmpname}.png
b4eb1753c80f Up the resolution of the web graphics.
Jim Hague <jim.hague@acm.org>
parents: 536
diff changeset
29 convert -colors 256 -quality 90 -density 200 $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
536
c0130d1ee053 Fix typo in filename to delete.
Jim Hague <jim.hague@acm.org>
parents: 397
diff changeset
38 rm $builddir/${name}001.eps
43
d92717f8130c First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff changeset
39 done