summaryrefslogtreecommitdiffstats
path: root/theme
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-11-24 22:08:19 +0100
committerSamy Pessé <samypesse@gmail.com>2014-11-24 22:08:19 +0100
commit3a0f00411ba6277bda9dc2be516c96e17ce9db82 (patch)
treed47ee3444c8b325567d7067fba94654b6affc737 /theme
parent5b655bb29ada234c10da3fe7b5640b68e2c0c147 (diff)
downloadgitbook-3a0f00411ba6277bda9dc2be516c96e17ce9db82.zip
gitbook-3a0f00411ba6277bda9dc2be516c96e17ce9db82.tar.gz
gitbook-3a0f00411ba6277bda9dc2be516c96e17ce9db82.tar.bz2
Fix #505: add glossary to ebook file
Diffstat (limited to 'theme')
-rw-r--r--theme/templates/ebook/glossary.html15
-rw-r--r--theme/templates/ebook/summary.html4
2 files changed, 19 insertions, 0 deletions
diff --git a/theme/templates/ebook/glossary.html b/theme/templates/ebook/glossary.html
new file mode 100644
index 0000000..8076c4d
--- /dev/null
+++ b/theme/templates/ebook/glossary.html
@@ -0,0 +1,15 @@
+{% extends "./layout.html" %}
+
+{% block title %}Glossary | {{ title }}{% endblock %}
+
+{% block content %}
+<div class="page page-toc">
+ <h1>Glossary</h1>
+ {% for item in glossaryIndex %}
+ <section class="normal glossary" id="{{ item.id }}">
+ <h2><a href="#{{ item.id }}">{{ item.name }}</a></h2>
+ <p>{{ item.description }}</p>
+ </section>
+ {% endfor %}
+</div>
+{% endblock %}
diff --git a/theme/templates/ebook/summary.html b/theme/templates/ebook/summary.html
index 85388f9..dfbba2c 100644
--- a/theme/templates/ebook/summary.html
+++ b/theme/templates/ebook/summary.html
@@ -40,6 +40,10 @@
<h1>Table of Contents</h1>
<ol>
{{ articles(summary.chapters) }}
+
+ {% if glossary.length > 0 %}
+ <li><a href="{{ basePath }}/GLOSSARY.html">Glossary</a></li>
+ {% endif %}
</ol>
</div>
{% endblock %}