From ea7ad10e8a2148cafecb026e0be9f5f7109ce95e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Tue, 20 May 2014 23:21:12 +0200 Subject: [PATCH] Add support for multi-languages books in JSON format --- lib/generate/json/index.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/generate/json/index.js b/lib/generate/json/index.js index f301a7e33..9e6153262 100644 --- a/lib/generate/json/index.js +++ b/lib/generate/json/index.js @@ -40,6 +40,23 @@ Generator.prototype.convertFile = function(content, input) { }); }; +// Generate languages index +Generator.prototype.langsIndex = function(langs) { + var that = this; + + var json = { + langs: langs.list + }; + + return Q() + .then(function() { + return fs.writeFile( + path.join(that.options.output, "langs.json"), + JSON.stringify(json, null, 4) + ); + }); +}; + Generator.prototype.finish = function() { // ignore };