summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-05-20 23:21:12 +0200
committerSamy Pessé <samypesse@gmail.com>2014-05-20 23:21:12 +0200
commitea7ad10e8a2148cafecb026e0be9f5f7109ce95e (patch)
tree756254043525893db1b4434dbfd94df61115b10d
parent62ec695dc8aa33cbe1062cb9ca98878a664baa28 (diff)
downloadgitbook-ea7ad10e8a2148cafecb026e0be9f5f7109ce95e.zip
gitbook-ea7ad10e8a2148cafecb026e0be9f5f7109ce95e.tar.gz
gitbook-ea7ad10e8a2148cafecb026e0be9f5f7109ce95e.tar.bz2
Add support for multi-languages books in JSON format
-rw-r--r--lib/generate/json/index.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/generate/json/index.js b/lib/generate/json/index.js
index f301a7e..9e61532 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
};