From 127c0380dbea322253155b72f04a0a46d35f5788 Mon Sep 17 00:00:00 2001 From: Jim Hague Date: Wed, 11 Oct 2017 17:45:27 +0100 Subject: [PATCH] Provide full titles for next and previous tunes in web pages. --- abcfield.py | 7 ++++++- dottes.html.learnertune | 4 ++-- dottes.html.tune | 4 ++-- makeWeb.sh | 8 ++++++++ 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/abcfield.py b/abcfield.py index 895e703..3b15c72 100755 --- a/abcfield.py +++ b/abcfield.py @@ -241,8 +241,13 @@ if __name__ == "__main__": def process(f, dir, options): lines = f.readlines() if options.display: - line = getFieldDisplayText(lines, dir, options.field, options.index, options.starts, options.latex) + if options.field.upper() == "FT": + line = getFullTitle(lines, dir, options.starts, options.latex) + else: + line = getFieldDisplayText(lines, dir, options.field, options.index, options.starts, options.latex) else: + if options.field.upper() == "FT": + options.field = "T" line = getFieldText(lines, options.field, options.index, options.starts) if line: print(line) diff --git a/dottes.html.learnertune b/dottes.html.learnertune index 8fce74f..140bbf6 100644 --- a/dottes.html.learnertune +++ b/dottes.html.learnertune @@ -144,7 +144,7 @@ diff --git a/dottes.html.tune b/dottes.html.tune index c57bf89..3cce223 100644 --- a/dottes.html.tune +++ b/dottes.html.tune @@ -79,7 +79,7 @@ diff --git a/makeWeb.sh b/makeWeb.sh index d1bd7bc..ae4d3ec 100755 --- a/makeWeb.sh +++ b/makeWeb.sh @@ -96,18 +96,22 @@ do # Get previous and next tune page names and titles. prevpage="" prevtitle="" + prevfulltitle="" nextpage="" nexttitle="" + nextfulltitle="" if [ $i -gt 0 ]; then prev=${filenames[$((i - 1))]} prevpage=`basename $prev .abc`.html prevtitle=`./abcfield.py --display --field="T" $prev` + prevfulltitle=`./abcfield.py --display --field="FT" $prev` fi if [ $i -lt $((nofiles - 1)) ]; then next=${filenames[$((i + 1))]} nextpage=`basename $next .abc`.html nexttitle=`./abcfield.py --display --field="T" $next` + nextfulltitle=`./abcfield.py --display --field="FT" $next` fi # Generate the tune web page. @@ -119,16 +123,20 @@ do --value "lastchanged=${lastchanged}" \ --value "prevpage=${prevpage}" \ --value "prevtitle=${prevtitle}" \ + --value "prevfulltitle=${prevfulltitle}" \ --value "nextpage=${nextpage}" \ --value "nexttitle=${nexttitle}" \ + --value "nextfulltitle=${nextfulltitle}" \ --template dottes.html.tune $filename > $webdir/$tunepage $dir/abctemplate.py \ --value "masterbooke=${masterbooke}" \ --value "lastchanged=${lastchanged}" \ --value "prevpage=learner-${prevpage}" \ --value "prevtitle=${prevtitle}" \ + --value "prevfulltitle=${prevfulltitle}" \ --value "nextpage=learner-${nextpage}" \ --value "nexttitle=${nexttitle}" \ + --value "nextfulltitle=${nextfulltitle}" \ --template dottes.html.learnertune $filename > $webdir/$learnerpage $dir/abctemplate.py --template dottes.html.tuneindex $filename >> $webdir/$tunelist done