summaryrefslogtreecommitdiffstats
path: root/lib/parse/langs.js
blob: 01b7c8c8c43c55d319f2cbe10053f5619fb96f18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var _ = require("lodash");
var parseEntries = require("./summary").entries;


var parseLangs = function(content) {
    var entries = parseEntries(content);

    return {
        list: _.chain(entries)
            .filter(function(entry) {
                return Boolean(entry.path);
            })
            .map(function(entry) {
                return {
                    title: entry.title,
                    path: entry.path,
                    lang: entry.path.replace("/", "")
                };
            })
            .value()
    };
};


module.exports = parseLangs;