{%- set includeStyles = includeStyles|default(True, True) or completeFile %} {%- set showMetadata = showMetadata|default(False, True) %} {%- set showSections = showSections|default(False, True) %} {%- set showWords = showWords|default(False, True) %} {%- set showSyllables = showSyllables|default(False, True) %} {%- set showNeumes = showNeumes|default(False, True) %} {%- set showMisalignments = showMisalignments|default(True, True) %} {%- if includeStyles %} {% endif -%} {%- set chantIsMisaligned = False -%} {%- if 'misaligned' in chant.editorial and chant.editorial.misaligned -%} {%- set chantIsMisaligned = True -%} {%- endif -%}
{%- for section in chant.elements -%} {%- set numSections = chant.elements|length -%} {%- set sectionLoop = loop -%} {%- set sectionIsMisaligned = False -%} {%- if 'misaligned' in section.editorial and section.editorial.misaligned -%} {%- set sectionIsMisaligned = True -%} {%- endif -%}

Section{% if section.name -%}: {{ section.name }}{%- endif -%}

{%- for word in section.elements -%} {%- set wordLoop = loop -%} {%- set numWords = section.elements|length -%} {%- set wordIsMisaligned = False -%} {%- if 'misaligned' in word.editorial and word.editorial.misaligned -%} {%- set wordIsMisaligned = True -%} {%- endif -%} {%- set wordIsUnaligned = False -%} {%- if 'unaligned' in word.editorial and word.editorial.unaligned -%} {%- set wordIsUnaligned = True -%} {%- endif -%}
{%- set numSyllables = word.elements|length -%} {%- for syllable in word.elements -%}
{%- set numNeumes = syllable.elements|length -%} {%- if numNeumes == 0 -%}-{%- endif -%} {%- for element in syllable.elements -%} {%- if element.type == 'neume' -%} {%- for note in element.elements -%}{{ note.volpiano }}{% endfor -%} {%- if numNeumes > 1 and loop.index < numNeumes -%} - {%- endif -%} {%- elif element.type in ['flat'] -%} {{ element.volpiano }} {%- elif element.type in ['pausaminor', 'pausaminima'] -%} {%- if loop.index > 1 %}--{% endif -%} {{ element.volpiano }} {%- if loop.index < loop.length %}---{% endif -%} {%- else -%} {{ element.volpiano }} {%- endif -%} {%- endfor -%} {%- if numSyllables > 1 and loop.index < numSyllables -%} -- {%- elif loop.index == numSyllables and wordLoop.index < numWords -%} --- {%- elif loop.index == numSyllables and sectionLoop.index < numSections -%} --- {%- endif -%}
{%- if syllable.annotation -%} {{syllable.annotation}} {%- elif syllable.lyric -%} {{syllable.lyric}} {%- if numSyllables > 1 and loop.index < numSyllables and wordIsUnaligned == False -%} - {%- endif -%} {%- else -%}   {%- endif -%}
{%- endfor -%}
{%- endfor -%}
{%- endfor -%} {% for key, value in chant.metadata.items() %} {% endfor %}
{{ key }} {{ value|e }}