summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-09-17 13:08:30 +0200
committerSamy Pessé <samypesse@gmail.com>2014-09-17 13:08:30 +0200
commit11b299653f64eff2c997602bdd29cf07b6fa80e8 (patch)
tree1f818c2c1ce9dead652ffaf648adc57a2dd04d95
parentc8c07fe8ce7ccc3b4a83412025123cc05853dc40 (diff)
downloadgitbook-11b299653f64eff2c997602bdd29cf07b6fa80e8.zip
gitbook-11b299653f64eff2c997602bdd29cf07b6fa80e8.tar.gz
gitbook-11b299653f64eff2c997602bdd29cf07b6fa80e8.tar.bz2
Remove githubId
Enable hook for ebook
-rw-r--r--lib/generate/json/index.js1
-rw-r--r--lib/generate/page/index.js30
-rw-r--r--lib/generate/site/index.js5
-rwxr-xr-xtheme/javascript/core/state.js1
-rwxr-xr-xtheme/javascript/gitbook.js5
-rw-r--r--theme/templates/page.html4
-rw-r--r--theme/templates/site.html2
7 files changed, 6 insertions, 42 deletions
diff --git a/lib/generate/json/index.js b/lib/generate/json/index.js
index 745933b..6a68f68 100644
--- a/lib/generate/json/index.js
+++ b/lib/generate/json/index.js
@@ -26,7 +26,6 @@ Generator.prototype.convertFile = function(content, input) {
return Q()
.then(function() {
return parse.page(content, {
- repo: that.options.githubId,
dir: path.dirname(input) || '/'
});
})
diff --git a/lib/generate/page/index.js b/lib/generate/page/index.js
index a013219..9e48a5e 100644
--- a/lib/generate/page/index.js
+++ b/lib/generate/page/index.js
@@ -37,33 +37,9 @@ Generator.prototype.convertFile = function(content, input) {
progress: parse.progress(this.options.navigation, input)
};
- var _callHook = function(name) {
- return that.callHook(name, json)
- .then(function(_page) {
- json = _page;
- return json;
- });
- };
-
- return Q()
- .then(function() {
- return parse.page(content, {
- repo: that.options.githubId,
- dir: path.dirname(input) || '/',
- outdir: './',
- singleFile: true
- });
- })
- .then(function(sections) {
- json.content = sections;
- })
- .then(function(sections) {
-
- // Use plugin hook
- return _callHook("ebook:page");
- })
- .then(function() {
- that.pages[input] = json;
+ return this.prepareFile(content, input)
+ .then(function(page) {
+ that.pages[input] = page;
});
};
diff --git a/lib/generate/site/index.js b/lib/generate/site/index.js
index 5d3a57b..dc9a4d4 100644
--- a/lib/generate/site/index.js
+++ b/lib/generate/site/index.js
@@ -62,10 +62,6 @@ Generator.prototype._writeTemplate = function(tpl, options, output, interpolate)
title: that.options.title,
description: that.options.description,
- githubAuthor: that.options.github ? that.options.github.split("/")[0] : "",
- githubId: that.options.github,
- githubHost: that.options.githubHost,
-
glossary: that.options.glossary,
summary: that.options.summary,
@@ -133,7 +129,6 @@ Generator.prototype.prepareFile = function(content, _input) {
// Get HTML generated sections
return parse.page(lexed, {
- repo: that.options.githubId,
dir: path.dirname(_input) || '/',
outdir: path.dirname(_input) || '/',
});
diff --git a/theme/javascript/core/state.js b/theme/javascript/core/state.js
index 2f7c633..de5c65c 100755
--- a/theme/javascript/core/state.js
+++ b/theme/javascript/core/state.js
@@ -7,7 +7,6 @@ define([
var $book = $(dom.find(".book"));
state.$book = $book;
- state.githubId = $book.data("github");
state.level = $book.data("level");
state.basePath = $book.data("basepath");
state.revision = $book.data("revision");
diff --git a/theme/javascript/gitbook.js b/theme/javascript/gitbook.js
index 0682b2f..77c7ae0 100755
--- a/theme/javascript/gitbook.js
+++ b/theme/javascript/gitbook.js
@@ -18,11 +18,6 @@ define([
var $book;
$book = state.$book;
- if (state.githubId) {
- // Initialize storage
- storage.setBaseKey(state.githubId);
- }
-
// Init sidebar
sidebar.init();
diff --git a/theme/templates/page.html b/theme/templates/page.html
index 9c58ab1..89ffc24 100644
--- a/theme/templates/page.html
+++ b/theme/templates/page.html
@@ -41,7 +41,7 @@
<article id="{{ article.path }}">
<h1 class="book-chapter book-chapter-{{ item.level|lvl }}">{{ item.title }}</h1>
{% if pages[item.path] %}
- {{ articleContent(pages[item.path].content) }}
+ {{ articleContent(pages[item.path].sections) }}
{% endif %}
</article>
{% endfor %}
@@ -56,7 +56,7 @@
{% for item in progress.chapters %}
{% if pages[item.path] %}
- {% for section in pages[item.path].content %}
+ {% for section in pages[item.path].sections %}
{% if section.type == "exercise" %}
<div class="exercise">
<div class="exercise-header">Exercise #{{ exercise }}</div>
diff --git a/theme/templates/site.html b/theme/templates/site.html
index 7db7449..cf90c9a 100644
--- a/theme/templates/site.html
+++ b/theme/templates/site.html
@@ -17,7 +17,7 @@
{% block description %}{% if progress.current.level == "0" %}{{ description }}{% endif %}{% endblock %}
{% block content %}
- <div class="book" {% if githubId %}data-github="{{ githubId }}"{% endif %} data-level="{{ progress.current.level }}" data-basepath="{{ basePath }}" data-revision="{{ revision }}">
+ <div class="book" data-level="{{ progress.current.level }}" data-basepath="{{ basePath }}" data-revision="{{ revision }}">
{% include "includes/book/summary.html" %}
<div class="book-body">
<div class="body-inner">