diff options
author | Samy Pessé <samypesse@gmail.com> | 2014-05-29 17:28:18 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2014-05-29 17:28:18 +0200 |
commit | 5c3b345fa69f577ebcc752ad626cd60f6bd412c6 (patch) | |
tree | d034046c46edb688b97d6f3db146f332f08e3047 | |
parent | 46321fffd93804edd7403328f51ed611daddd720 (diff) | |
download | gitbook-5c3b345fa69f577ebcc752ad626cd60f6bd412c6.zip gitbook-5c3b345fa69f577ebcc752ad626cd60f6bd412c6.tar.gz gitbook-5c3b345fa69f577ebcc752ad626cd60f6bd412c6.tar.bz2 |
Generate valid first level table of content for ebook
-rw-r--r-- | lib/generate/ebook/index.js | 3 | ||||
-rw-r--r-- | theme/templates/page.html | 30 |
2 files changed, 4 insertions, 29 deletions
diff --git a/lib/generate/ebook/index.js b/lib/generate/ebook/index.js index 7416860..574341d 100644 --- a/lib/generate/ebook/index.js +++ b/lib/generate/ebook/index.js @@ -34,7 +34,8 @@ Generator.prototype.finish = function() { } var _options = { - "--cover": that.options.cover + "--cover": that.options.cover, + "--chapter": "\"descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter ')]\"" }; var command = [ diff --git a/theme/templates/page.html b/theme/templates/page.html index 061df6d..9c5e06e 100644 --- a/theme/templates/page.html +++ b/theme/templates/page.html @@ -39,32 +39,6 @@ {% endif %} </section> - {# Summary #} - <section id="summary"> - <h1>Table of Contents</h1> - <ol> - <li> - <a href="#README.md"> - <h2>Introduction</h2> - </a> - </li> - {% for item in summary.chapters %} - <li> - <h2><span>{{ item.level }}.</span> <a href="#{{ item.path }}">{{ item.title }}</a></h2> - {% if item.articles.length > 0 %} - <ol> - {% for article in item.articles %} - <li> - <span>{{ article.level }}</span> <a href="#{{ article.path }}">{{ article.title }}</a> - </li> - {% endfor %} - </ol> - {% endif %} - </li> - {% endfor %} - </ol> - </section> - {# Pages content #} <section> <article id="README.md"> @@ -74,7 +48,7 @@ {% for item in summary.chapters %} <section> <article id="{{ item.path }}" class="new-chapter"> - <h1>{{ item.title }}</h1> + <h1 class="book-chapter">{{ item.title }}</h1> </article> {% if pages[item.path] %} @@ -101,7 +75,7 @@ {% set exercise = 1 %} <section> <article class="new-chapter"> - <h1>Exercise Solutions</h1> + <h1 class="book-chapter">Exercise Solutions</h1> </article> <article> {% for item in summary.chapters %} |