summaryrefslogtreecommitdiffstats
path: root/theme/templates/page
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-10-30 17:52:31 +0100
committerSamy Pessé <samypesse@gmail.com>2014-10-30 17:52:39 +0100
commit38c750101c479940d94759bd820d00f90a03f14d (patch)
treeb6d27691b6871d39070c858cd7123e4bcc242000 /theme/templates/page
parentba0f379a89dd44fc6d291e03ea69a92773a7ea1a (diff)
downloadgitbook-38c750101c479940d94759bd820d00f90a03f14d.zip
gitbook-38c750101c479940d94759bd820d00f90a03f14d.tar.gz
gitbook-38c750101c479940d94759bd820d00f90a03f14d.tar.bz2
Fix #487: Use generated toc as base for ebook generation
Diffstat (limited to 'theme/templates/page')
-rw-r--r--theme/templates/page/page.html32
-rw-r--r--theme/templates/page/summary.html26
2 files changed, 58 insertions, 0 deletions
diff --git a/theme/templates/page/page.html b/theme/templates/page/page.html
new file mode 100644
index 0000000..dbead6e
--- /dev/null
+++ b/theme/templates/page/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/page/exercise.html" with {section: section} %}
+ {% elif section.type == "quiz" %}
+ {% include "./includes/page/quiz.html" with {section: section} %}
+ {% endif %}
+ </section>
+ {% endfor %}
+</div>
+{% endblock %}
+
diff --git a/theme/templates/page/summary.html b/theme/templates/page/summary.html
new file mode 100644
index 0000000..8bc4d7d
--- /dev/null
+++ b/theme/templates/page/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 %}
+