{#- The Listen page's text, one chapter at a time: listen.html draws every chapter with it, and
a book that is still growing (#724) gets each new chapter drawn by the same macro, through
the chapter route, so a chapter added while the page is open is the same as one drawn with
the page. Import it "with context" (it needs `t` and `document`). -#}
{% from "_icons.html" import icon %}
{#- A piece of a block: a sentence the voice reads (`.s`) or text between sentences. Its parts
show what the audiobook's own edits did (#392, D-665 conflict 2, D-704b): text left out is
struck in pencil, text read differently is underlined with its reading. -#}
{% macro parts(piece) -%}
{%- if piece.parts -%}
{%- for part in piece.parts -%}
{%- if part.mark == 'cut' -%}{{ part.text }} {{ t('listen.cut_hidden') }}
{%- elif part.mark == 'said' -%}{{ part.text }} {{ t('listen.said_as_hidden', said=part.said) }}
{%- else -%}{{ part.text }}{%- endif -%}
{%- endfor -%}
{%- else -%}{{ piece.text }}{%- endif -%}
{%- endmacro %}
{% macro pieces(block) -%}
{%- for piece in block.pieces -%}
{%- if piece.element -%}{{ parts(piece) }}
{%- else -%}{{ parts(piece) }}{%- endif -%}
{%- endfor -%}
{%- endmacro %}
{% macro show(block) -%}
{% if block.page %}
{{ t('listen.page', page=block.page) }}
{% endif %} {% if block.notice %}{{ icon('skip') }}{{ t('listen.notice') }} {{ block.notice }}
{% for figure in block.figures %}{{ block.printed }}
{{ block.code }}{% endif %}
{% if not block.read %}{{ t('listen.not_read') }} {% endif %}{{ pieces(block) }}
{% endif %} {%- endmacro %} {% macro sheet_chapter(chapter, n) -%}