{% extends "layout.html" %} {% block title %}{{ title }}{% endblock %} {% block style %} {% endblock %} {% macro articleContent(content) %} {% for section in content %} {% if section.type == "normal" %} {% autoescape false %}{{ section.content }}{% endautoescape %} {% elif section.type == "exercise" %}
Exercise #{{ exercise }}
{% autoescape false %}{{ section.content }}{% endautoescape %}
{% autoescape false %}{{ section.code.base|code }}{% endautoescape %}
{% set exercise = exercise + 1 %}
{% elif section.type == "quiz" %}
Exercise #{{ exercise }}
{% autoescape false %}{{ section.content }}{% endautoescape %} {% autoescape false %}{{ section.quiz.base }}{% endautoescape %} {% set exercise = exercise + 1 %}
{% endif %} {% endfor %} {% endmacro %} {% set exercise = 1 %} {% block content %} {# Cover #}

{{ title }}

{% if githubId %}

By @{{ githubAuthor }}

{% endif %}
{# Summary #}

Table of Contents

  1. Introduction

  2. {% for item in summary.chapters %}
  3. {{ item.level }}. {{ item.title }}

    {% if item.articles.length > 0 %}
      {% for article in item.articles %}
    1. {{ article.level }} {{ article.title }}
    2. {% endfor %}
    {% endif %}
  4. {% endfor %}
{# Pages content #}
{{ articleContent(pages["README.md"].content) }}
{% for item in summary.chapters %}

{{ item.title }}

{% if pages[item.path] %}
{{ articleContent(pages[item.path].content) }}
{% endif %} {% if item.articles.length > 0 %} {% for article in item.articles %} {% if pages[article.path] %}
{{ articleContent(pages[article.path].content) }}
{% endif %} {% endfor %} {% endif %}
{% endfor %} {# Exercise solutions #} {% if exercise > 1 %} {% set exercise = 1 %}

Exercise Solutions

{% for item in summary.chapters %} {% for article in item.articles %} {% if pages[article.path] %} {% for section in pages[article.path].content %} {% if section.type == "exercise" %}
Exercise #{{ exercise }}
{% autoescape false %}{{ section.content }}{% endautoescape %}
{% autoescape false %}{{ section.code.solution|code }}{% endautoescape %}
{% set exercise = exercise + 1 %}
{% elif section.type == "quiz" %}
Exercise #{{ exercise }}
{% autoescape false %}{{ section.content }}{% endautoescape %} {% autoescape false %}{{ section.quiz.solution }}{% endautoescape %} {% set exercise = exercise + 1 %}
{% endif %} {% endfor %} {% endif %} {% endfor %} {% endfor %}
{% endif %} {% endblock %} {% block javascript %}{% endblock %}