comparison makeBookeTunePages.sh @ 588:afc031477784

Replace sed substitution with Python templating for HTML and LaTeX output.
author Jim Hague <jim.hague@acm.org>
date Wed, 02 Nov 2016 00:21:18 +0000
parents daa3b76bd11f
children 507d853433ef
comparison
equal deleted inserted replaced
587:1b79867b4f35 588:afc031477784
28 # Now, for each tune, make the tune graphic and add it, inside a 28 # Now, for each tune, make the tune graphic and add it, inside a
29 # centre section, so the document. Then add a TOC entry. 29 # centre section, so the document. Then add a TOC entry.
30 find $booke -name "*.abc" | sort | 30 find $booke -name "*.abc" | sort |
31 while read filename 31 while read filename
32 do 32 do
33 name=`basename $filename .abc` 33 $dir/abctemplate.py --latex --value "graphicsdir=$graphicsdir" --template $dir/dottes.tex.tune $filename >> $tunesoutput
34 title=`$dir/abcfield.py --field T --latex --display $filename` 34 $dir/abctemplate.py --latex --value "graphicsdir=$graphicsdir" --template $dir/dottes.tex.firstline-tune $filename >> $indexoutput
35 subtitle=`$dir/abcfield.py --index 2 --field T --latex --display $filename`
36 composer=`$dir/abcfield.py --field C --latex $filename`
37
38 changefile=`$dir/abcfield.py --field N --starts "Change:" $filename`
39 changename=""
40 changetitle=""
41 if [ -n "$changefile" ]; then
42 changename=`basename $changefile .abc`
43 changetitle=`$dir/abcfield.py --field T --latex --display $booke/$changefile`
44 fi
45
46 credit=`$dir/abcfield.py --field N --starts "Credit:" $filename`
47 echo -E "\showtune{$name}{$title}{$subtitle}{$composer}{$graphicsdir/$name}{$changename}{$changetitle}{$credit}" >> $tunesoutput
48
49 echo -E "\showfirstline{$name}{$title}{$graphicsdir/firstline-$name}" >> $indexoutput
50 done 35 done