From 05eaeeb0d0f1854f788078cbbb2837fe46eca1d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Thu, 13 Nov 2014 08:34:35 +0100 Subject: [PATCH] Fix #441: Improve validity of epub output --- theme/templates/ebook/layout.html | 22 ++++++++++++++++++++++ theme/templates/ebook/page.html | 6 +++--- theme/templates/ebook/summary.html | 2 +- 3 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 theme/templates/ebook/layout.html diff --git a/theme/templates/ebook/layout.html b/theme/templates/ebook/layout.html new file mode 100644 index 000000000..76efdf6cc --- /dev/null +++ b/theme/templates/ebook/layout.html @@ -0,0 +1,22 @@ + + + {{ htmlSnippet("html:start")|default("") }} + + {{ htmlSnippet("head:start")|default("") }} + + {% block title %}{% endblock %} + + + + {% block head %}{% endblock %} + {{ htmlSnippet("head:end")|default("") }} + + + {{ htmlSnippet("body:start")|default("") }} + {% block style %}{% endblock %} + {% block content %}{% endblock %} + {% block javascript %}{% endblock %} + {{ htmlSnippet("body:end")|default("") }} + + {{ htmlSnippet("html:end")|default("") }} + diff --git a/theme/templates/ebook/page.html b/theme/templates/ebook/page.html index 417ba0aa8..9ce7c1b54 100644 --- a/theme/templates/ebook/page.html +++ b/theme/templates/ebook/page.html @@ -1,4 +1,4 @@ -{% extends "../layout.html" %} +{% extends "./layout.html" %} {% block title %}{{ progress.current.title }} | {{ title }}{% endblock %} @@ -17,7 +17,7 @@

{{ progress.current.title }}

{% for section in content %} -
+
{% if section.type == "normal" %} {% autoescape false %}{{ section.content }}{% endautoescape %} {% elif section.type == "exercise" %} @@ -25,7 +25,7 @@ {% elif section.type == "quiz" %} {% include "./includes/quiz.html" with {section: section} %} {% endif %} -
+
{% endfor %} {% endblock %} diff --git a/theme/templates/ebook/summary.html b/theme/templates/ebook/summary.html index 53940f077..85388f9a8 100644 --- a/theme/templates/ebook/summary.html +++ b/theme/templates/ebook/summary.html @@ -1,4 +1,4 @@ -{% extends "../layout.html" %} +{% extends "./layout.html" %} {% block title %}Table of Contents | {{ title }}{% endblock %}