summaryrefslogtreecommitdiffstats
path: root/lib/generate/page/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/generate/page/index.js')
-rw-r--r--lib/generate/page/index.js25
1 files changed, 7 insertions, 18 deletions
diff --git a/lib/generate/page/index.js b/lib/generate/page/index.js
index bd9b233..9e48a5e 100644
--- a/lib/generate/page/index.js
+++ b/lib/generate/page/index.js
@@ -15,6 +15,9 @@ var BaseGenerator = require("../site");
var Generator = function() {
BaseGenerator.apply(this, arguments);
+ // Base for assets in plugins
+ this.pluginAssetsBase = "ebook";
+
// List of pages content
this.pages = {};
};
@@ -34,20 +37,9 @@ Generator.prototype.convertFile = function(content, input) {
progress: parse.progress(this.options.navigation, input)
};
- 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() {
- that.pages[input] = json;
+ return this.prepareFile(content, input)
+ .then(function(page) {
+ that.pages[input] = page;
});
};
@@ -82,10 +74,7 @@ Generator.prototype.finish = function() {
// Copy assets
.then(function() {
- return fs.copy(
- path.join(that.options.theme, "assets"),
- path.join(that.options.output, "gitbook")
- );
+ return that.copyAssets();
});
};