diff options
author | Aaron O'Mullan <aaron.omullan@friendco.de> | 2014-06-17 16:18:08 -0700 |
---|---|---|
committer | Aaron O'Mullan <aaron.omullan@friendco.de> | 2014-06-17 16:18:08 -0700 |
commit | 6c5c8e6eb71889977df189223be70d8ae623bf30 (patch) | |
tree | fbb009b17d365507c93fdb71684f4a93bb8bd3cd /lib/parse/langs.js | |
parent | 3aefcaea73c481081908653b6256c9efd71d64a3 (diff) | |
download | gitbook-6c5c8e6eb71889977df189223be70d8ae623bf30.zip gitbook-6c5c8e6eb71889977df189223be70d8ae623bf30.tar.gz gitbook-6c5c8e6eb71889977df189223be70d8ae623bf30.tar.bz2 |
Fix LANGS.md parsing
And cleanup Summary parsing
Diffstat (limited to 'lib/parse/langs.js')
-rw-r--r-- | lib/parse/langs.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/parse/langs.js b/lib/parse/langs.js index 46c3a46..01b7c8c 100644 --- a/lib/parse/langs.js +++ b/lib/parse/langs.js @@ -1,13 +1,14 @@ -var _ = require("lodash") -var parseSummary = require("./summary"); +var _ = require("lodash"); +var parseEntries = require("./summary").entries; + var parseLangs = function(content) { - var summary = parseSummary(content); + var entries = parseEntries(content); return { - list: _.chain(summary.chapters) + list: _.chain(entries) .filter(function(entry) { - return entry.path != null; + return Boolean(entry.path); }) .map(function(entry) { return { @@ -17,7 +18,8 @@ var parseLangs = function(content) { }; }) .value() - } + }; }; + module.exports = parseLangs;
\ No newline at end of file |