{% extends "templates/base.html" %} {% from "www/macros/livecode.html" import LiveCodeEditor with context %} {% block title %}{{topic.title}} ({{course.title}}){% endblock %} {% block head_include %} {% endblock %} {% block content %}

{{ topic.title }}

{% for s in topic.sections %}
{{ render_section(s) }}
{% endfor %}
{% endblock %} {% macro render_section(s) %} {% if s.type == "text" %} {{ render_section_text(s) }} {% elif s.type == "code" %} {{ LiveCodeEditor(s.name, s.code) }} {% else %}
Unknown section type: {{s.type}}
{% endif %} {% endmacro %} {% macro render_section_text(s) %} {{ s.contents | markdown }} {% endmacro %} {%- block script %} {{ super() }} {%- endblock %}