changeset 708:7da70e8900ab build-default-278

First attempt at adding Tradition below subtitle in web and print.
author Jim Hague <jim.hague@acm.org>
date Sun, 08 Oct 2017 17:06:09 +0100
parents 1bbf0e27389e
children 2e2e0db16b8c e99a1b0ad869
files abctemplate.py dottes.html.tune dottes.tex dottes.tex.tune web/css/dottes.css
diffstat 5 files changed, 21 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/abctemplate.py	Sun Oct 08 16:49:53 2017 +0100
+++ b/abctemplate.py	Sun Oct 08 17:06:09 2017 +0100
@@ -21,6 +21,7 @@
 # * name. The file base name. Base filename without extension.
 # * title. The tune title.
 # * subtitle. The tune subtitle (second Title field), if any.
+# * tradition. The Morris tradition the dance tune is from.
 # * composer. The tune composer.
 # * key. The tune key.
 # * changefile. The name of the 'change' file, if any.
@@ -66,6 +67,7 @@
     vars["name"] = fname
     vars["title"] = getFieldDisplayText(lines, fdir, "T", latex=args.latex)
     vars["subtitle"] = getFieldDisplayText(lines, fdir, "T", n=2, latex=args.latex)
+    vars["tradition"] = getFieldDisplayText(lines, fdir, "A", latex=args.latex)
     vars["composer"] = getFieldDisplayText(lines, fdir, "C", latex=args.latex)
     vars["key"] = getFieldDisplayText(lines, fdir, "K", latex=args.latex)
     vars["notes"] = getFieldDisplayText(lines, fdir, "N", starts="Dottes:", latex=args.latex)
--- a/dottes.html.tune	Sun Oct 08 16:49:53 2017 +0100
+++ b/dottes.html.tune	Sun Oct 08 17:06:09 2017 +0100
@@ -37,6 +37,7 @@
             <div class="dottes-tune-header-title">
               <h1>${title}</h1>
               <h2>${subtitle}</h2>
+              <h3>${tradition}</h3>
             </div>
             <div class="dottes-tune-header-composer">
               <em>${composer}</em>
--- a/dottes.tex	Sun Oct 08 16:49:53 2017 +0100
+++ b/dottes.tex	Sun Oct 08 17:06:09 2017 +0100
@@ -45,23 +45,26 @@
 \makeatother
 
 % Show the main tune graphic and optional change.
-% Args are tune name, tune title, tune subtitle, composer, tune graphic
-% filename, notes, history.
-\newcommand{\showtune}[7]{%
+% Args are tune name, tune title, tune subtitle, tradition, composer,
+% tune graphic, filename, notes, history.
+\newcommand{\showtune}[8]{%
   \phantomsection
   \begin{tabularx}{\textwidth}{LCR}
       \addcontentsline{toc}{section}{#2}
-      & \hypertarget{#1}{\Large{#2}} & \emph{#4} \tabularnewline
+      & \hypertarget{#1}{\Large{#2}} & \emph{#5} \tabularnewline
       \ifemptyarg{#3}{}{%
         & #3 & \tabularnewline
       }
+      \ifemptyarg{#4}{}{%
+        & \emph{#4} & \tabularnewline
+      }
       \multicolumn{3}{c}{%
-        \includegraphics[width=\textwidth,height=0.8\textheight,keepaspectratio]{#5}%
+        \includegraphics[width=\textwidth,height=0.8\textheight,keepaspectratio]{#6}%
       }\tabularnewline
   \end{tabularx}
-  #6
+  #7
 
-  #7
+  #8
   \vfill
 }
 
--- a/dottes.tex.tune	Sun Oct 08 16:49:53 2017 +0100
+++ b/dottes.tex.tune	Sun Oct 08 17:06:09 2017 +0100
@@ -1,1 +1,1 @@
-\showtune{$name}{$title}{$subtitle}{$composer}{$graphicsdir/$name}{$notes}{$history}
+\showtune{$name}{$title}{$subtitle}{$tradition}{$composer}{$graphicsdir/$name}{$notes}{$history}
--- a/web/css/dottes.css	Sun Oct 08 16:49:53 2017 +0100
+++ b/web/css/dottes.css	Sun Oct 08 17:06:09 2017 +0100
@@ -176,6 +176,13 @@
     margin: 0px;
 }
 
+div.dottes-tune-header-title h3
+{
+    font-style: italic;
+    text-align: center;
+    margin: 0px;
+}
+
 div.dottes-tune-header-composer
 {
     display: table-cell;