Remove githubId

Enable hook for ebook
This commit is contained in:
Samy Pessé
2014-09-17 13:08:30 +02:00
parent c8c07fe8ce
commit 11b299653f
7 changed files with 6 additions and 42 deletions
-1
View File
@@ -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) || '/'
});
})
+3 -27
View File
@@ -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;
});
};
-5
View File
@@ -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) || '/',
});
-1
View File
@@ -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");
-5
View File
@@ -18,11 +18,6 @@ define([
var $book;
$book = state.$book;
if (state.githubId) {
// Initialize storage
storage.setBaseKey(state.githubId);
}
// Init sidebar
sidebar.init();
+2 -2
View File
@@ -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>
+1 -1
View File
@@ -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">