view makeWeb.sh @ 122:295ba8275ab4

Make output larger where possible. This is done by a) reducing the page margins b) compressing the heading and removing all but Notes: fields. The latter produced vertically smaller tune PDFs that will scale wider. In the process, modify abctitle.py to extract the first of any header field, and move formatting for a single tune into a .fmt file.
author Jim Hague <jim.hague@laicatc.com>
date Sat, 21 Apr 2012 19:47:30 +0100
parents a63e39fc3410
children c88c74d27d68
line wrap: on
line source

#!/bin/bash
#
# Build the website. The common items and the web items are assumed
# to be already built.
#

if [ $# != 1 ]; then
    echo "Usage: makeWeb.sh <book dir name>"
    exit 1
fi

dir=`pwd`

booke=$dir/$1
webdir=$dir/web/$1
graphicsdir=$dir/graphics/$1
output=index.html

buildno=`cat buildno.txt`
subtitle=
intro=
if [ -r $booke/subtitle.txt ]; then
    subtitle=`cat $booke/subtitle.txt`
fi
if [ -r $booke/intro.txt ]; then
    intro=`cat $booke/intro.txt`
fi

mkdir -p $webdir

sed -e "s/@BUILD@/$buildno/" -e "s/@SUBTITLE@/$subtitle/" \
    -e "s/@INTRO@/$intro/" -e "s/@BOOK@/$1/" dottes.html.header > $webdir/$output

cp $1.pdf $1-booklet.pdf $webdir

# Now, for each tune, make the tune graphic and sound.
find $booke -name "*.abc" | sort |
    while read filename
    do
        title=`$dir/abcfield.py --field T --html $filename`
        name=`basename $filename .abc`

        # Copy tune PDF from common graphics.
        cp $graphicsdir/${name}.pdf $webdir

        # And copy the ABC.
        cp $filename $webdir

        echo "<tr>" >> $webdir/$output
        echo "<td>${title}</td>" >> $webdir/$output
        echo "<td><a href=\"${name}.jpg\">JPG</a></td>" >> $webdir/$output
        echo "<td><a href=\"${name}.pdf\">PDF</a></td>" >> $webdir/$output
        echo "<td><a href=\"${name}.mid\">MIDI</a></td>" >> $webdir/$output
        echo "<td><a href=\"${name}.mp3\">MP3</a></td>" >> $webdir/$output
        echo "<td><a href=\"${name}.abc\">ABC</a></td>" >> $webdir/$output
        echo "</tr>" >> $webdir/$output
    done

cat dottes.html.footer >> $webdir/$output