summaryrefslogtreecommitdiffstats
path: root/lib/generators
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-27 12:49:08 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-27 12:49:08 +0100
commit54e1be1e775945b0f7e397c36a1ff1413c63f475 (patch)
treee08fe8e9738d02aa234ece356cffd11d35c9434e /lib/generators
parentce259eb4ec74dbcbff10938125ff00ba145befc3 (diff)
downloadgitbook-54e1be1e775945b0f7e397c36a1ff1413c63f475.zip
gitbook-54e1be1e775945b0f7e397c36a1ff1413c63f475.tar.gz
gitbook-54e1be1e775945b0f7e397c36a1ff1413c63f475.tar.bz2
Parse plugins in book instead of generator
Diffstat (limited to 'lib/generators')
-rw-r--r--lib/generators/ebook.js6
-rw-r--r--lib/generators/website.js14
2 files changed, 10 insertions, 10 deletions
diff --git a/lib/generators/ebook.js b/lib/generators/ebook.js
index 481f547..237e22e 100644
--- a/lib/generators/ebook.js
+++ b/lib/generators/ebook.js
@@ -20,9 +20,9 @@ var Generator = function(book, format) {
util.inherits(Generator, BaseGenerator);
Generator.prototype.prepareTemplates = function() {
- this.templates["page"] = this.plugins.template("ebook:page") || path.resolve(this.options.theme, 'templates/ebook/page.html');
- this.templates["summary"] = this.plugins.template("ebook:summary") || path.resolve(this.options.theme, 'templates/ebook/summary.html');
- this.templates["glossary"] = this.plugins.template("ebook:glossary") || path.resolve(this.options.theme, 'templates/ebook/glossary.html');
+ this.templates["page"] = this.book.plugins.template("ebook:page") || path.resolve(this.options.theme, 'templates/ebook/page.html');
+ this.templates["summary"] = this.book.plugins.template("ebook:summary") || path.resolve(this.options.theme, 'templates/ebook/summary.html');
+ this.templates["glossary"] = this.book.plugins.template("ebook:glossary") || path.resolve(this.options.theme, 'templates/ebook/glossary.html');
return Q();
};
diff --git a/lib/generators/website.js b/lib/generators/website.js
index 4b7595a..480e56b 100644
--- a/lib/generators/website.js
+++ b/lib/generators/website.js
@@ -57,9 +57,9 @@ Generator.prototype.prepareStyles = function() {
// Prepare templates
Generator.prototype.prepareTemplates = function() {
- this.templates["page"] = this.plugins.template("site:page") || path.resolve(this.options.theme, 'templates/website/page.html');
- this.templates["langs"] = this.plugins.template("site:langs") || path.resolve(this.options.theme, 'templates/website/langs.html');
- this.templates["glossary"] = this.plugins.template("site:glossary") || path.resolve(this.options.theme, 'templates/website/glossary.html');
+ this.templates["page"] = this.book.plugins.template("site:page") || path.resolve(this.options.theme, 'templates/website/page.html');
+ this.templates["langs"] = this.book.plugins.template("site:langs") || path.resolve(this.options.theme, 'templates/website/langs.html');
+ this.templates["glossary"] = this.book.plugins.template("site:glossary") || path.resolve(this.options.theme, 'templates/website/glossary.html');
return Q();
};
@@ -232,9 +232,9 @@ Generator.prototype._writeTemplate = function(tpl, options, output, interpolate)
summary: that.book.summary,
allNavigation: that.book.navigation,
- plugins: that.plugins,
+ plugins: that.book.plugins,
pluginsConfig: JSON.stringify(that.options.pluginsConfig),
- htmlSnippet: _.partialRight(that.plugins.html, that, options),
+ htmlSnippet: _.partialRight(that.book.plugins.html, that, options),
options: that.options,
@@ -265,10 +265,10 @@ Generator.prototype.copyAssets = function() {
// Copy plugins assets
.then(function() {
return Q.all(
- _.map(that.plugins.list, function(plugin) {
+ _.map(that.book.plugins.list, function(plugin) {
var pluginAssets = path.join(that.options.output, "gitbook/plugins/", plugin.name);
return plugin.copyAssets(pluginAssets, {
- base: that.pluginAssetsBase
+ base: "book"
});
})
);