Files
songsheet_generator/templates/song_template.tt
T
2025-01-31 17:23:37 +01:00

90 lines
2.5 KiB
Plaintext

[% PROCESS purpose_processing.tt;
IF assignments;
PROCESS "$assignments";
END;
IF overrides != '';
"\[% $overrides %\]" | evaltt;
END;
-%]
\song{[% purpose_print ? purpose_print : purpose %]}{[% song_title -%]}{
[% before_song -%]
\begin{samepage}
[% IF scores;
IF scores.gregorian AND (gregorian OR NOT scores.congregation);
IF NOT gregorian;
GET '\\textbf{\\LARGE{Activate gregorian}}';
GET "\n";
ELSE;
GET "\\gresetgregpath{{${directory}/}}";
GET "\\gregorioscore{${scores.gregorian}}\n";
END;
ELSE;
IF parts;
GET '\lilypondfile{';
IF parts == 'band';
IF scores.band;
GET "${directory}/${scores.band}";
ELSIF scores.leadsheet;
GET "${directory}/${scores.leadsheet}";
ELSIF scores.full;
GET "${directory}/${scores.full}";
ELSE;
GET "${directory}/${scores.SATB}";
END;
ELSIF parts == 'full';
IF scores.full;
GET "${directory}/${scores.full}";
ELSIF scores.leadsheet;
GET "${directory}/${scores.leadsheet}";
ELSE;
GET "${directory}/${scores.SATB}";
END;
ELSIF parts == 'SATB';
IF scores.SATB;
GET "${directory}/${scores.SATB}";
ELSE;
GET "${directory}/${scores.leadsheet}";
END;
ELSE;
IF scores.${parts};
GET "${directory}/${scores.$parts}";
ELSE;
IF scores.full;
GET "${directory}/${scores.full}";
ELSIF scores.leadsheet;
GET "${directory}/${scores.leadsheet}";
ELSE;
GET "${directory}/${scores.SATB}";
END;
END;
END;
GET "}\n";
ELSE;
IF scores.congregation;
GET "\\lilypondfile{${directory}/${scores.congregation}}\n";
END;
END;
END;
ELSIF lyrics;
GET lyrics;
END; %]
[% IF credits -%]
\leavevmode\\*
[% FOREACH key = credits.keys;
# Workaround because PERL keeps resolving \\$ to $
s = "\\ ${key}{${credits.$key}}\n";
GET s.replace('(\W) ', '$1');
END; -%]
[% END -%]
\end{samepage}
[% content -%]
[% IF (meditation && meditations) || (parts && meditation) -%]
\leavevmode\par\smallskip
[% meditation %]
[% END -%]
[% IF after_song -%]
\leavevmode\par\smallskip
[% after_song %]
[% END -%]
}