From 5c3b345fa69f577ebcc752ad626cd60f6bd412c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Thu, 29 May 2014 17:28:18 +0200 Subject: [PATCH] Generate valid first level table of content for ebook --- lib/generate/ebook/index.js | 3 ++- 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 7416860ac..574341da4 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 061df6d6f..9c5e06e08 100644 --- a/theme/templates/page.html +++ b/theme/templates/page.html @@ -39,32 +39,6 @@ {% endif %} - {# Summary #} -
-

Table of Contents

-
    -
  1. - -

    Introduction

    -
    -
  2. - {% for item in summary.chapters %} -
  3. -

    {{ item.level }}. {{ item.title }}

    - {% if item.articles.length > 0 %} -
      - {% for article in item.articles %} -
    1. - {{ article.level }} {{ article.title }} -
    2. - {% endfor %} -
    - {% endif %} -
  4. - {% endfor %} -
-
- {# Pages content #}
@@ -74,7 +48,7 @@ {% for item in summary.chapters %}
-

{{ item.title }}

+

{{ item.title }}

{% if pages[item.path] %} @@ -101,7 +75,7 @@ {% set exercise = 1 %}
-

Exercise Solutions

+

Exercise Solutions

{% for item in summary.chapters %}