diff options
Diffstat (limited to 'theme/templates/ebook')
-rw-r--r-- | theme/templates/ebook/includes/exercise.html | 11 | ||||
-rw-r--r-- | theme/templates/ebook/includes/quiz.html | 14 | ||||
-rw-r--r-- | theme/templates/ebook/page.html | 32 | ||||
-rw-r--r-- | theme/templates/ebook/summary.html | 26 |
4 files changed, 83 insertions, 0 deletions
diff --git a/theme/templates/ebook/includes/exercise.html b/theme/templates/ebook/includes/exercise.html new file mode 100644 index 0000000..96a2c0a --- /dev/null +++ b/theme/templates/ebook/includes/exercise.html @@ -0,0 +1,11 @@ +<div class="exercise-header">Exercise</div> +<div class="exercise-inner"> + {% autoescape false %}{{ section.content }}{% endautoescape %} +</div> +<div class="exercise-inner"> + <pre><code>{% autoescape false %}{{ section.code.base|code }}{% endautoescape %}</code></pre> +</div> +<hr> +<div class="exercise-inner"> + <pre><code>{% autoescape false %}{{ section.code.solution|code }}{% endautoescape %}</code></pre> +</div> diff --git a/theme/templates/ebook/includes/quiz.html b/theme/templates/ebook/includes/quiz.html new file mode 100644 index 0000000..ada363c --- /dev/null +++ b/theme/templates/ebook/includes/quiz.html @@ -0,0 +1,14 @@ +<div class="exercise-header">Quiz</div> +<div class="exercise-inner">{% autoescape false %}{{ section.content }}{% endautoescape %}</div> +{% for quiz in section.quiz %} +<div class="question exercise-inner"> + <div class="question-header">Question {{ loop.index }} of {{ section.quiz.length }}</div> + + <div class="question-base"> + {% autoescape false %}{{ quiz.base }}{% endautoescape %} + </div> + <div class="question-solution"> + {% autoescape false %}{{ quiz.solution }}{% endautoescape %} + </div> +</div> +{% endfor %} diff --git a/theme/templates/ebook/page.html b/theme/templates/ebook/page.html new file mode 100644 index 0000000..417ba0a --- /dev/null +++ b/theme/templates/ebook/page.html @@ -0,0 +1,32 @@ +{% extends "../layout.html" %} + +{% block title %}{{ progress.current.title }} | {{ title }}{% endblock %} + +{% block style %} +<link rel="stylesheet" href="{{ staticBase }}/print.css"> +{% for resource in plugins.resources.css %} + {% if resource.url %} + <link rel="stylesheet" href="{{ resource.url }}"> + {% else %} + <link rel="stylesheet" href="{{ staticBase }}/plugins/{{ resource.path }}"> + {% endif %} +{% endfor %} +{% endblock %} + +{% block content %} +<div class="page"> + <h1 class="book-chapter book-chapter-{{ progress.current.level|lvl }}">{{ progress.current.title }}</h1> + {% for section in content %} + <section class="{{ section.type }}" id="section-{{ section.id }}"> + {% if section.type == "normal" %} + {% autoescape false %}{{ section.content }}{% endautoescape %} + {% elif section.type == "exercise" %} + {% include "./includes/exercise.html" with {section: section} %} + {% elif section.type == "quiz" %} + {% include "./includes/quiz.html" with {section: section} %} + {% endif %} + </section> + {% endfor %} +</div> +{% endblock %} + diff --git a/theme/templates/ebook/summary.html b/theme/templates/ebook/summary.html new file mode 100644 index 0000000..8bc4d7d --- /dev/null +++ b/theme/templates/ebook/summary.html @@ -0,0 +1,26 @@ +{% extends "../layout.html" %} + +{% block title %}Table of Contents | {{ title }}{% endblock %} + +{% block style %} +<link rel="stylesheet" href="{{ staticBase }}/print.css"> +{% for resource in plugins.resources.css %} + {% if resource.url %} + <link rel="stylesheet" href="{{ resource.url }}"> + {% else %} + <link rel="stylesheet" href="{{ staticBase }}/plugins/{{ resource.path }}"> + {% endif %} +{% endfor %} +{% endblock %} + +{% block content %} +<div class="page"> + <h1>Table of Contents</h1> + <p> + {% for chapter in toc %} + <a href="{{ basePath }}/{{ chapter.path|mdLink }}">{{ chapter.title }}</a><br/> + {% endfor %} + </p> +</div> +{% endblock %} + |