summaryrefslogtreecommitdiffstats
path: root/lib/generate/json/index.js
diff options
context:
space:
mode:
authorDavid Graf <davidagraf@gmail.com>2014-05-21 16:24:07 +0200
committerDavid Graf <davidagraf@gmail.com>2014-05-21 16:24:07 +0200
commite7be132194aed102c9d1983a68cd2de5f6b4c45b (patch)
tree336fe9a9ca8086c41d9730d487718c7670444c49 /lib/generate/json/index.js
parent7c65adc9b2c7a1f386a8bd54cdc03bdeac4df5a5 (diff)
parent0e1717f4bb979ebdbba5500dd5ae85f7f10f3528 (diff)
downloadgitbook-e7be132194aed102c9d1983a68cd2de5f6b4c45b.zip
gitbook-e7be132194aed102c9d1983a68cd2de5f6b4c45b.tar.gz
gitbook-e7be132194aed102c9d1983a68cd2de5f6b4c45b.tar.bz2
Merge branch 'master' into livereload
Diffstat (limited to 'lib/generate/json/index.js')
-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
};