# HG changeset patch # User Jim Hague # Date 1361625058 0 # Node ID 1e4443d58177bcf37fee16b4c5cff9bee0f63a42 # Parent 129f92df03b589ff48c60cdf522a2a193effbf5e 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. diff -r 129f92df03b5 -r 1e4443d58177 Session/ALaModeDeFrance.abc --- 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 diff -r 129f92df03b5 -r 1e4443d58177 Session/BonnyKate.abc --- 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 |\ diff -r 129f92df03b5 -r 1e4443d58177 Session/CaptainRock.abc --- 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 diff -r 129f92df03b5 -r 1e4443d58177 Session/ElizabethClare.abc --- 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 :| - diff -r 129f92df03b5 -r 1e4443d58177 Session/ExplodingPotato.abc --- 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 diff -r 129f92df03b5 -r 1e4443d58177 Session/GrandfathersTune.abc --- 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 diff -r 129f92df03b5 -r 1e4443d58177 Session/HarpersFrolick.abc --- 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 diff -r 129f92df03b5 -r 1e4443d58177 Session/JustAsTheTideWasFlowing.abc --- 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 :| - diff -r 129f92df03b5 -r 1e4443d58177 Session/KingOfTheFairies.abc --- 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 | diff -r 129f92df03b5 -r 1e4443d58177 Session/Laride6.abc --- 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 diff -r 129f92df03b5 -r 1e4443d58177 Session/MazurkaDeLapleau.abc --- 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 diff -r 129f92df03b5 -r 1e4443d58177 Session/PlaneTree.abc --- 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 diff -r 129f92df03b5 -r 1e4443d58177 Session/RoguesMarch.abc --- 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
+

@TITLE@

@TITLE@ dots +
+ Change: @CHANGETITLE@ +
  • PDF
  • diff -r 129f92df03b5 -r 1e4443d58177 makeBookeA4.sh --- 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 " 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 diff -r 129f92df03b5 -r 1e4443d58177 makeBookeA5.sh --- 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 " 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 diff -r 129f92df03b5 -r 1e4443d58177 makeWeb.sh --- 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 []" 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//&/\&}/" \ diff -r 129f92df03b5 -r 1e4443d58177 singletune.fmt --- 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 diff -r 129f92df03b5 -r 1e4443d58177 web/css/dottes.css --- 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 +{ +}