made section templates more flexible

This commit is contained in:
leopoldfajtak
2024-12-05 10:35:07 +01:00
parent 12dc7edf0e
commit 6938f650fd
13 changed files with 62 additions and 124 deletions
+10 -4
View File
@@ -3,11 +3,17 @@ tpage = tpage $(tpage_defs)
tex_deps = *.tt $(config_dir)/variables.tt $(dynamic_deps)
songsheet.tex: songsheet.tt $(tex_deps) header.tt head.tt footer.tt
$(tpage) $< > $(build_dir)/$@
musician_scores.tex: musician_scores.tt $(tex_deps)
$(tpage) $< > $(build_dir)/$@
leadsheet_collection.tex: musician_scores.tt $(tex_deps)
$(tpage) --define parts=band $< > $(build_dir)/$@
full_scores.tex: musician_scores.tt $(tex_deps)
$(tpage) --define parts=full $< > $(build_dir)/$@
choir_scores.tex: musician_scores.tt $(tex_deps)
$(tpage) --define parts=SATB $< > $(build_dir)/$@
leadsheets.tex: musician_scores.tt $(tex_deps)
$(tpage) --define parts=band $< > $(build_dir)/$@
$(build_dir)/dynamic_deps.mk: dynamic_deps.mk.tt $(song_choices) $(user_variables)
$(tpage) $< > $@
violin_parts.tex: musician_scores.tt $(tex_deps)
$(tpage) --define parts=violin $< > $(build_dir)/$@
viola_parts.tex: musician_scores.tt $(tex_deps)
$(tpage) --define parts=viola $< > $(build_dir)/$@
cello_parts.tex: musician_scores.tt $(tex_deps)
$(tpage) --define parts=cello $< > $(build_dir)/$@
+1 -2
View File
@@ -79,8 +79,7 @@ BoldFont = *-Bold
\footnotesize Originaltitel: #1}}
\newcommand{\TM}[1]{{
\footnotesize T \& M: #1}}
\newcommand{\arrangement}[1]{{
\footnotesize S: #1}}
\newcommand{\arrangement}[1]{}
\newcommand{\lyrics}[1]{{
\footnotesize T: #1}}
\newcommand{\melody}[1]{{
+9 -10
View File
@@ -71,9 +71,9 @@ RawFeature = {+ss06}
\begin{document}
\section*{[% title %]}
\begin{centering}
[% subtitle %]
\end{centering}
\vfill
[% parts %]
[% USE song_choices = datafile("${config_dir}/song_choices.csv", delim= '|') %]
[% IF parts == 0 -%]
@@ -81,14 +81,13 @@ parts = ensemble
[% END -%]
[% FOREACH song = song_choices %]
\newpage
[% template = song.template == '' ? "song_template.tt" : song.template -%]
[% INCLUDE "$template"
[% template = song.template == '' ? "song_template.tt" : song.template;
INCLUDE "$template"
purpose = song.purpose
title = song.title
content = song.content
variables = song.variables ? "${library_dir}/${song.variables}/assignments.tt" : ''
directory = song.variables ? "${library_dir}/${song.variables}" : ''
%]
[% END %]
assignments = song.assignments_directory ? "${library_dir}/${song.assignments_directory}/assignments.tt" : ''
directory = song.assignments_directory ? "${library_dir}/${song.assignments_directory}" : ''
overrides = song.overrides;
-%]
[% END; -%]
\end{document}
+26 -7
View File
@@ -1,6 +1,9 @@
[% PROCESS purpose_processing.tt;
IF variables;
PROCESS "$variables";
IF assignments;
PROCESS "$assignments";
END;
IF overrides != '';
"\[% $overrides %\]" | evaltt;
END;
-%]
\song{[% purpose_print ? purpose_print : purpose %]}{[% song_title -%]}{
@@ -14,10 +17,12 @@
GET "\\gregorioscore{${directory}/${scores.gregorian}}\n";
END;
ELSE;
GET '\lilypondfile{';
IF parts;
IF parts == 'band';
IF scores.leadsheet;
GET '\lilypondfile{';
IF parts == 'band' || parts == 'full';
IF scores.full;
GET "${directory}/${scores.full}";
ELSIF scores.leadsheet;
GET "${directory}/${scores.leadsheet}";
ELSE;
GET "${directory}/${scores.SATB}";
@@ -28,11 +33,25 @@
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;
GET "${directory}/${scores.congregation}";
IF scores.congregation;
GET "\\lilypondfile{${directory}/${scores.congregation}}\n";
END;
END;
GET "}\n";
END;
ELSIF lyrics;
GET lyrics;
+10 -9
View File
@@ -10,15 +10,16 @@
[% USE song_choices = datafile("${config_dir}/song_choices.csv", delim= '|') %]
[% FOREACH song = song_choices %]
[% template = song.template == '' ? "song_template.tt" : song.template -%]
[% INCLUDE "$template"
purpose = song.purpose
content = song.content
variables = song.variables ? "${library_dir}/${song.variables}/assignments.tt" : ''
directory = song.variables ? "${library_dir}/${song.variables}" : ''
%]
[% END %]
[%
FOREACH song = song_choices;
template = song.template == '' ? "song_template.tt" : song.template;
INCLUDE "$template"
purpose = song.purpose
assignments = song.assignments_directory ? "${library_dir}/${song.assignments_directory}/assignments.tt" : ''
directory = song.assignments_directory ? "${library_dir}/${song.assignments_directory}" : ''
overrides = song.overrides;
END;
-%]
[% INCLUDE footer.tt %]