{% extends 'base.html' %} {% set meta = book %} {% macro poem_html(toc_obj, level) %}
  • {% if toc_obj.numeral %} {{ toc_obj.name }} {% if poems[book.slug][toc_obj.slug].text -%}{% endif %} {% if poems[book.slug][toc_obj.slug].titled %} {% if poems[book.slug][toc_obj.slug].text -%}{% endif %} {{ poems[book.slug][toc_obj.slug].title }} {% else %} {% for line in poems[book.slug][toc_obj.slug].first_line|parsePoem|first %} {{ line.text|formatFirstLine }}{% if not loop.last %}
    {% endif %} {% endfor %} {% endif %} {% if poems[book.slug][toc_obj.slug].text -%}
    {% endif %}
    {% else %} {% if poems[book.slug][toc_obj.slug].text -%}{% endif %} {{ toc_obj.name }} {% if poems[book.slug][toc_obj.slug].text -%}{% endif %} {% endif %}
  • {% endmacro %} {% block content %} {% include "includes/nav.html" %}

    {{ book.title }}

    {% for graf in book.description %}

    {{ graf }}

    {% endfor %} {% if book.public_domain == true and (availablePoems|length) > 0 and ((availablePoems|length) < (allPoems.length)) %}

    Thus far, {{ availablePoems|length|apnumber }} of the book’s {{ allPoems|length|apnumber }} poems have been digitized. Here’s how you can get involved in adding more.

    {% endif %}
    {% if book.public_domain == true and (availablePoems|length) > 0 %}

    Table of contents

      {% for level1 in toc[book.slug] %} {{ poem_html(level1, '1') }} {% if level1.children|length > 0 %}
      1. {% for level2 in level1.children %} {{ poem_html(level2, '2') }} {% if level2.children %}
        1. {% for level3 in level2.children -%} {{ poem_html(level3, '3') }} {% endfor %}
      2. {% endif %} {% endfor %}
    1. {% endif %} {% endfor %}
    {% endif %}
    {% endblock content %} {% block footer -%} {% endblock footer -%}