summaryrefslogtreecommitdiffstats
path: root/lib/generators/json.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-21 11:33:33 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-21 11:33:33 +0100
commitbe2da0fab1c467f84c33517950d67da3c9b5768d (patch)
treed5840c8c1cb97bd8f8a8a192c545ffb4577a8e3b /lib/generators/json.js
parent0da50819d663b94bb85ffcaae4231a635921431c (diff)
downloadgitbook-be2da0fab1c467f84c33517950d67da3c9b5768d.zip
gitbook-be2da0fab1c467f84c33517950d67da3c9b5768d.tar.gz
gitbook-be2da0fab1c467f84c33517950d67da3c9b5768d.tar.bz2
Fix json template preparation
Diffstat (limited to 'lib/generators/json.js')
-rw-r--r--lib/generators/json.js11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/generators/json.js b/lib/generators/json.js
index 65197e0..a1202ad 100644
--- a/lib/generators/json.js
+++ b/lib/generators/json.js
@@ -6,7 +6,6 @@ var _ = require("lodash");
var fs = require("../utils/fs");
var BaseGenerator = require("../generator");
var links = require("../utils/links");
-var pageUtil = require("../utils/page");
var Generator = function() {
BaseGenerator.apply(this, arguments);
@@ -18,18 +17,14 @@ Generator.prototype.transferFile = function(input) { };
Generator.prototype.finish = function() { };
// Convert an input file
-Generator.prototype.writeParsedFile = function(page, input) {
+Generator.prototype.writeParsedFile = function(page) {
var that = this;
var json = {
progress: page.progress,
- sections: pageUtil.normalize(page.sections, {
- navigation: that.book.navigation,
- base: path.dirname(input) || './',
- output: path.dirname(input) || './'
- })
+ sections: page.sections
};
- var output = links.changeExtension(input, ".json");
+ var output = links.changeExtension(page.path, ".json");
output = path.join(that.options.output, output);
return fs.writeFile(