Files
gitbook/theme/templates/page.html
T
2014-04-04 20:12:22 -07:00

76 lines
2.6 KiB
HTML

{% extends "layout.html" %}
{% block title %}{{ title }}{% endblock %}
{% block style %}
{% parent %}
<link rel="stylesheet" href="{{ staticBase }}/print.css">
{% endblock %}
{% set exercise = 0 %}
{% block content %}
{# Cover #}
<section id="cover">
<h1>{{ title }}</h1>
<h2>By <a href="{{ githubHost }}{{ githubAuthor }}">@{{ githubAuthor }}</a></h2>
</section>
{# Summary #}
<section id="summary">
<h1>Summary</h1>
<ul class="summary">
<li>
<a href="#README.md">Introduction</a>
</li>
{% for item in summary.chapters %}
<li>
<a href="#{{ item.path }}">{{ item.level }}) {{ item.title }}</a>
{% if item.articles.length > 0 %}
<ul>
{% for article in item.articles %}
<li>
<a href="#{{ article.path }}">{{ article.level }}) {{ article.title }}</a>
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
</section>
{# Pages content #}
{% for item in summary.chapters %}
{% if item.articles.length > 0 %}
<section>
<article id="{{ item.path }}" class="new-chapter">
<h1>{{ item.title }}</h1>
</article>
{% for article in item.articles %}
<article id="{{ article.path }}">
{% for section in pages[article.path].content %}
{% if section.type == "normal" %}
{% autoescape false %}{{ section.content }}{% endautoescape %}
{% elif section.type == "exercise" %}
<div class="exercise">
<div class="exercise-header">Exercise #{{ exercise }}</div>
{% autoescape false %}{{ section.content }}{% endautoescape %}
<pre>
<code>
{% autoescape false %}{{ section.code.base|code }}{% endautoescape %}
</code>
</pre>
{% set exercise = exercise + 1 %}
</div>
{% endif %}
{% endfor %}
</article>
{% endfor %}
</section>
{% endif %}
{% endfor %}
{% endblock %}
{% block javascript %}{% endblock %}