diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-04-28 14:37:19 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-04-28 14:37:19 +0200 |
commit | f08732095dca8c4b2913c20a4b8b6fd593f8c9c3 (patch) | |
tree | ef6938b0cd2d386f635b60f9eb89864c182f6ef8 /lib/output/json/onPage.js | |
parent | f946650ddb6b075aa626cc165b7b9ea53924a5b1 (diff) | |
download | gitbook-f08732095dca8c4b2913c20a4b8b6fd593f8c9c3.zip gitbook-f08732095dca8c4b2913c20a4b8b6fd593f8c9c3.tar.gz gitbook-f08732095dca8c4b2913c20a4b8b6fd593f8c9c3.tar.bz2 |
Copy readme.json from main language for json output of multilingual
Diffstat (limited to 'lib/output/json/onPage.js')
-rw-r--r-- | lib/output/json/onPage.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/output/json/onPage.js b/lib/output/json/onPage.js index 54179c6..c2ee0d0 100644 --- a/lib/output/json/onPage.js +++ b/lib/output/json/onPage.js @@ -4,6 +4,8 @@ var Modifiers = require('../modifiers'); var writeFile = require('../helper/writeFile'); var getModifiers = require('../getModifiers'); +var JSON_VERSION = '3'; + /** Write a page as a json file @@ -18,6 +20,12 @@ function onPage(output, page) { // Generate the JSON var json = JSONUtils.encodeBookWithPage(output.getBook(), resultPage); + // Delete some private properties + delete json.config; + + // Specify JSON output version + json.version = JSON_VERSION; + // File path in the output folder var filePath = PathUtils.setExtension(file.getPath(), '.json'); |