Mercurial > dottes
changeset 229:1e4443d58177
Modify Change tune handling.
Change all change notes to reference the filename of the tune to change to.
Modify web and document generators to pull the change note out of the abc
and generate an appropiate bit of content. This is now, in both cases,
a hyperlink.
In the process, remove the tune-specific .tex facility. It wasn't being
used.
I could really do with a proper templating system, and using some sort
of templating in the LaTeX generation.
author | Jim Hague <jim.hague@acm.org> |
---|---|
date | Sat, 23 Feb 2013 13:10:58 +0000 |
parents | 129f92df03b5 |
children | 4800e1f12632 |
files | Session/ALaModeDeFrance.abc Session/BonnyKate.abc Session/CaptainRock.abc Session/ElizabethClare.abc Session/ExplodingPotato.abc Session/GrandfathersTune.abc Session/HarpersFrolick.abc Session/JustAsTheTideWasFlowing.abc Session/KingOfTheFairies.abc Session/Laride6.abc Session/MazurkaDeLapleau.abc Session/PlaneTree.abc Session/RoguesMarch.abc Session/SheriffsRide.abc Session/WillsWay.abc Session/WinsterGallop.abc dottes.html.tune makeBookeA4.sh makeBookeA5.sh makeWeb.sh singletune.fmt web/css/dottes.css |
diffstat | 22 files changed, 111 insertions(+), 37 deletions(-) [+] |
line wrap: on
line diff
--- a/Session/ALaModeDeFrance.abc Sat Feb 23 11:38:35 2013 +0000 +++ b/Session/ALaModeDeFrance.abc Sat Feb 23 13:10:58 2013 +0000 @@ -1,7 +1,7 @@ X: 1 T: A La Mode de France T: Nonesuch -N: Change: Rufty Tufty +N: Change: RuftyTufty.abc M: C L: 1/4 K: Gmaj
--- a/Session/BonnyKate.abc Sat Feb 23 11:38:35 2013 +0000 +++ b/Session/BonnyKate.abc Sat Feb 23 13:10:58 2013 +0000 @@ -1,7 +1,7 @@ X: 1 T: Bonny Kate M: C -N: Change: Harper's Frolick +N: Change: HarpersFrolick.abc L: 1/4 K: G d e f | "G" g>f g>f | "G" g d d B | "C" c/d/ e d>c |\
--- a/Session/CaptainRock.abc Sat Feb 23 11:38:35 2013 +0000 +++ b/Session/CaptainRock.abc Sat Feb 23 13:10:58 2013 +0000 @@ -1,6 +1,6 @@ X: 1 T: Captain Rock's Farewell -N: Change: Orange in Bloom +N: Change: OrangeInBloom.abc M: 3/4 L: 1/4 K: Gmaj
--- a/Session/ElizabethClare.abc Sat Feb 23 11:38:35 2013 +0000 +++ b/Session/ElizabethClare.abc Sat Feb 23 13:10:58 2013 +0000 @@ -1,7 +1,7 @@ X: 1 T: Elizabeth Clare C: Chris Wood -N: Change: Michael Turner's Waltz +N: Change: MichaelTurnersWaltz.abc M: 3/4 L: 1/8 R: waltz @@ -14,4 +14,3 @@ "C" c2 cd c2 | "G" B2 Bc B2 | "Am" A2 G2 E2 | "D" D2>D2 GA | "G" B2 Bc B2 | "D" A2 AB A2 | "C" G2 E2 GE |\ "G" D2>D2 GA | "G" B2 d2 e2 | d2 c2 B2 | "D" A2 G2 F2 | "G" G3 :| -
--- a/Session/ExplodingPotato.abc Sat Feb 23 11:38:35 2013 +0000 +++ b/Session/ExplodingPotato.abc Sat Feb 23 13:10:58 2013 +0000 @@ -1,7 +1,7 @@ X: 1 T: Exploding Potato, The C: Ed Pritchard -N: Change: The Extension Reel +N: Change: ExtensionReel.abc M: C L: 1/4 K: Gmaj
--- a/Session/GrandfathersTune.abc Sat Feb 23 11:38:35 2013 +0000 +++ b/Session/GrandfathersTune.abc Sat Feb 23 13:10:58 2013 +0000 @@ -1,7 +1,7 @@ X:1 T:Grandfather's Tune S:Nick Barber -N:Change: The Sloe +N:Change: Sloe.abc R:Reel M:4/4 Q:160
--- a/Session/HarpersFrolick.abc Sat Feb 23 11:38:35 2013 +0000 +++ b/Session/HarpersFrolick.abc Sat Feb 23 13:10:58 2013 +0000 @@ -2,7 +2,7 @@ T:Harper's Frolick S:Nick Barber R:Polka -N:Change: Three Around Three +N:Change: ThreeAroundThree.abc M:4/4 L:1/4 Q:160
--- a/Session/JustAsTheTideWasFlowing.abc Sat Feb 23 11:38:35 2013 +0000 +++ b/Session/JustAsTheTideWasFlowing.abc Sat Feb 23 13:10:58 2013 +0000 @@ -1,7 +1,7 @@ X:1 T:Just as the tide was flowing S:Nick Barber -N:Change: Rochdale Coconut Dance +N:Change: RochdaleCoconutDance.abc L:1/4 Q:160 M:C @@ -16,4 +16,3 @@ "G" d B B/A/G/A/ | "Em" B/A/G/F/ "C" E "D" D | "G" G G "C" E "D" D | "G" G G "D" A G/A/ |\ "G" B B "D" c/B/A/G/ | "C" E "D" F "G" G :| -
--- a/Session/KingOfTheFairies.abc Sat Feb 23 11:38:35 2013 +0000 +++ b/Session/KingOfTheFairies.abc Sat Feb 23 13:10:58 2013 +0000 @@ -3,7 +3,7 @@ M: 4/4 L: 1/8 R: Hornpipe -N: Change: Lanigan's Ball +N: Change: LanigansBall.abc K: Em B,2 |\ |: "Em" (ED)uEvF (GF)vGuA | B2B2 G3 A | B2E2 (EF)GE | "D" (FG)FE D3 B,2 |
--- a/Session/Laride6.abc Sat Feb 23 11:38:35 2013 +0000 +++ b/Session/Laride6.abc Sat Feb 23 13:10:58 2013 +0000 @@ -2,7 +2,7 @@ T:Laride 6 M:2/2 L:1/4 -N: Change: Bear Dance +N: Change: BearDance.abc O:France A:Bretagne K:G
--- a/Session/MazurkaDeLapleau.abc Sat Feb 23 11:38:35 2013 +0000 +++ b/Session/MazurkaDeLapleau.abc Sat Feb 23 13:10:58 2013 +0000 @@ -1,6 +1,6 @@ X: 6 T:Mazurka de Lapleau -N: Change: Mazurka d'Avignon +N: Change: MazurkaAvignon.abc M:3/4 L:1/8 K:G
--- a/Session/PlaneTree.abc Sat Feb 23 11:38:35 2013 +0000 +++ b/Session/PlaneTree.abc Sat Feb 23 13:10:58 2013 +0000 @@ -2,7 +2,7 @@ T: Plane Tree, The C: Undine Hornby S: Nick Barber -N: Change: Herbert the Sherbert +N: Change: HerbertTheSherbert.abc M: 6/8 L: 1/8 R: jig
--- a/Session/RoguesMarch.abc Sat Feb 23 11:38:35 2013 +0000 +++ b/Session/RoguesMarch.abc Sat Feb 23 13:10:58 2013 +0000 @@ -3,10 +3,9 @@ M: 6/8 L: 1/4 K: Gmaj -N: Change: Captain Lanoe's Quick March +N: Change: CaptainLanoesQuickMarch.abc "G" B B/ B/c/d/ | "C" e e<e | "D" d/d/d/ d e/ | "D" d c/ B A/ | "G" B B/ B/c/d/ | "C" e e<e | "D" d/e/f/ "G" g/d/B/ | "D" A3/2 "G" G3/2 :| "Em" g3/2 "D" f3/2 | "C" e3/2 "D" d3/2 |\ "Em" g3/2 "D" f3/2 | "C" e3/2 "D" d c/ | "G" B B/ B/c/d/ | "C" e e<e | "D" d/e/f/ "G" g/d/B/ | "D" A3/2 "G" G3/2 :| -
--- a/Session/SheriffsRide.abc Sat Feb 23 11:38:35 2013 +0000 +++ b/Session/SheriffsRide.abc Sat Feb 23 13:10:58 2013 +0000 @@ -1,6 +1,6 @@ X:397 T:Sheriff's Ride, The -N: Change: Bear Dance +N: Change: BearDance.abc M:4/4 L:1/8 K:Emin
--- a/Session/WillsWay.abc Sat Feb 23 11:38:35 2013 +0000 +++ b/Session/WillsWay.abc Sat Feb 23 13:10:58 2013 +0000 @@ -1,7 +1,7 @@ X: 1 T: Will's Way C: Trad. -N: Change: Three Around Three +N: Change: ThreeAroundThree.abc M: 4/4 L: 1/8 Q: 140
--- a/Session/WinsterGallop.abc Sat Feb 23 11:38:35 2013 +0000 +++ b/Session/WinsterGallop.abc Sat Feb 23 13:10:58 2013 +0000 @@ -1,7 +1,7 @@ X: 1 T: Winster Gallop, The M: C -N: Change: Salmon Tails +N: Change: SalmonTails.abc L: 1/4 Q: 240 R: polka
--- a/dottes.html.tune Sat Feb 23 11:38:35 2013 +0000 +++ b/dottes.html.tune Sat Feb 23 13:10:58 2013 +0000 @@ -20,7 +20,12 @@ </a> <div class="grid_12 dottes-body"> + <h1>@TITLE@</h1> <img class="dottes-png" src="@TUNE@.png" alt="@TITLE@ dots"> + <div class="dottes-change-@CHANGEVISIBILITY@"> + Change: <a class="dottes-change-link" + href="@CHANGETUNE@">@CHANGETITLE@</a> + </div> <ul class="tune-data-list"> <li><a class="dottes-link-tune dottes-pdf" href="@TUNE@.pdf">PDF</a></li>
--- a/makeBookeA4.sh Sat Feb 23 11:38:35 2013 +0000 +++ b/makeBookeA4.sh Sat Feb 23 13:10:58 2013 +0000 @@ -7,6 +7,13 @@ # makeGraphics.sh to make these. # +# Restore titles like 'Exploding Potato, The' to the +# expected 'The Exploding Potato'. +fixtitle() +{ + retval=`echo "$1" | sed -e "s/\(.*\), *\(.*\)/\2 \1/"` +} + if [ $# != 1 ]; then echo "Usage: makeBookeA4.sh <book dir name>" exit 1 @@ -41,16 +48,25 @@ find $booke -name "*.abc" | sort | while read filename do + name=`basename $filename .abc` title=`$dir/abcfield.py --field T --latex $filename` - name=`basename $filename .abc` + fixtitle "$title" + title=$retval + echo -E "\begin{center}" >> $builddir/$output echo -E "\phantomsection" >> $builddir/$output echo -E "\hypertarget{$name}{\includegraphics[width=\textwidth,keepaspectratio]{$graphicsdir/$name}}" >> $builddir/$output echo -E "\addcontentsline{toc}{subsection}{$title}" >> $builddir/$output echo -E "\end{center}" >> $builddir/$output - text=$booke/$name.tex - if [ -r $text ]; then - cat $text >> $builddir/$output + + changefile=`$dir/abcfield.py --field N $filename | grep "Change:" | sed -e "s/Change: *//"` + changetitle="" + if [ -n "$changefile" ]; then + changetitle=`$dir/abcfield.py --field T --latex $booke/$changefile` + fixtitle "$changetitle" + changetitle=$retval + changename=`basename $changefile .abc` + echo -E "Change: \hyperlink{$changename}{$changetitle}" >> $builddir/$output fi done @@ -59,8 +75,10 @@ find $booke -name "*.abc" | sort | while read filename do + name=`basename $filename .abc` title=`$dir/abcfield.py --field T --latex $filename` - name=`basename $filename .abc` + fixtitle "$title" + title=$retval echo -E "\hyperlink{$name}{$title} & \raisebox{-.25\height}{\includegraphics[width=0.6\textwidth]{$graphicsdir/firstline-$name}} \\\\" >> $builddir/$output done
--- a/makeBookeA5.sh Sat Feb 23 11:38:35 2013 +0000 +++ b/makeBookeA5.sh Sat Feb 23 13:10:58 2013 +0000 @@ -7,6 +7,13 @@ # makeGraphics.sh to make these. # +# Restore titles like 'Exploding Potato, The' to the +# expected 'The Exploding Potato'. +fixtitle() +{ + retval=`echo "$1" | sed -e "s/\(.*\), *\(.*\)/\2 \1/"` +} + if [ $# != 1 ]; then echo "Usage: makeBookeA5.sh <book dir name>" exit 1 @@ -43,17 +50,26 @@ find $booke -name "*.abc" | sort | while read filename do + name=`basename $filename .abc` title=`$dir/abcfield.py --field T --latex $filename` - name=`basename $filename .abc` + fixtitle "$title" + title=$retval + echo -E "\newpage" >> $builddir/$output echo -E "\begin{center}" >> $builddir/$output echo -E "\phantomsection" >> $builddir/$output - echo -E "\hypertarget{$name}{\includegraphics[width=\textwidth,height=0.9\textheight,keepaspectratio]{$graphicsdir/$name}}" >> $builddir/$output + echo -E "\hypertarget{$name}{\includegraphics[width=\textwidth,height=0.85\textheight,keepaspectratio]{$graphicsdir/$name}}" >> $builddir/$output echo -E "\addcontentsline{toc}{subsection}{$title}" >> $builddir/$output echo -E "\end{center}" >> $builddir/$output - text=$booke/$name.tex - if [ -r $text ]; then - cat $text >> $builddir/$output + + changefile=`$dir/abcfield.py --field N $filename | grep "Change:" | sed -e "s/Change: *//"` + changetitle="" + if [ -n "$changefile" ]; then + changetitle=`$dir/abcfield.py --field T --latex $booke/$changefile` + fixtitle "$changetitle" + changetitle=$retval + changename=`basename $changefile .abc` + echo -E "Change: \hyperlink{$changename}{$changetitle}" >> $builddir/$output fi done @@ -62,8 +78,10 @@ find $booke -name "*.abc" | sort | while read filename do + name=`basename $filename .abc` title=`$dir/abcfield.py --field T --latex $filename` - name=`basename $filename .abc` + fixtitle "$title" + title=$retval echo -E "\hyperlink{$name}{$title} & \raisebox{-.25\height}{\includegraphics[width=0.6\textwidth]{$graphicsdir/firstline-$name}} \\\\" >> $builddir/$output done
--- a/makeWeb.sh Sat Feb 23 11:38:35 2013 +0000 +++ b/makeWeb.sh Sat Feb 23 13:10:58 2013 +0000 @@ -4,6 +4,15 @@ # to be already built. # +#set -x + +# Restore titles like 'Exploding Potato, The' to the +# expected 'The Exploding Potato'. +fixtitle() +{ + retval=`echo "$1" | sed -e "s/\(.*\), *\(.*\)/\2 \1/"` +} + if [ $# -lt 2 -o $# -gt 3 ]; then echo "Usage: makeWeb.sh <book dir name> <master book dir name> [<instrument name>]" exit 1 @@ -31,7 +40,6 @@ fi if [ -n "$instrument" ]; then - # Remove any transposition tag from title. title="${title} ($instrument)" subtitle="${subtitle} ($instrument)" fi @@ -50,12 +58,21 @@ find $bookedir -name "*.abc" | sort | while read filename do - title=`$dir/abcfield.py --field T --html $filename` name=`basename $filename .abc` - # Restore titles like 'Exploding Potato, The' to the - # expected 'The Exploding Potato'. - title=`echo $title | sed -e "s/\(.*\), *\(.*\)/\2 \1/"` + title=`$dir/abcfield.py --field T --html $filename` + fixtitle "$title" + title=$retval + changefile=`$dir/abcfield.py --field N $filename | grep "Change:" | sed -e "s/Change: *//"` + changetitle="" + changevisibility="no" + if [ -n "$changefile" ]; then + changetitle=`$dir/abcfield.py --field T --html $bookedir/$changefile` + changevisibility="yes" + + fixtitle "$changetitle" + changetitle=$retval + fi # Copy tune PDF from common graphics. cp $graphicsdir/${name}.pdf $webdir @@ -70,6 +87,9 @@ # initial '&' in the title - it means things to sed. sed -e "s/@TITLE@/${title//&/\&}/" \ -e "s/@MASTERBOOKE@/${masterbooke}/" \ + -e "s/@CHANGETITLE@/${changetitle//&/\&}/" \ + -e "s/@CHANGETUNE@/${changefile/.abc/.html}/" \ + -e "s/@CHANGEVISIBILITY@/${changevisibility}/" \ -e "s/@TUNE@/${name}/" dottes.html.tune > $webdir/$tunepage sed -e "s/@TITLE@/${title//&/\&}/" \
--- a/singletune.fmt Sat Feb 23 11:38:35 2013 +0000 +++ b/singletune.fmt Sat Feb 23 13:10:58 2013 +0000 @@ -8,13 +8,14 @@ titleformat T0 C1 titlespace 0 topspace 0 -% I only want to include Notes in the tune graphics. To turn off the -% other fields, give a blank infoname for that letter. +% I don't want any info fields in the graphics. To turn off the +% fields, give a blank infoname for that letter. infoname S infoname R infoname B infoname D infoname Z infoname H +infoname N infoline true writehistory true
--- a/web/css/dottes.css Sat Feb 23 11:38:35 2013 +0000 +++ b/web/css/dottes.css Sat Feb 23 13:10:58 2013 +0000 @@ -180,3 +180,18 @@ display: table-cell; vertical-align: middle; } + +div.dottes-change-no +{ + display: none; +} + +div.dottes-change-yes +{ + display: block; + margin: 10px; +} + +div.dottes-change-link +{ +}