summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-asciidoc/lib/readme.js
blob: 6ca1a83a900d7d9e3a76f061aff6dad133f58f52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var _ = require('lodash');
var cheerio = require('cheerio');

var convert = require('./utils/convert');

function parseReadme(src) {
    var html = convert(src);
    $ = cheerio.load(html);

    return {
        title: $("h1:first-child").text().trim(),
        description: $("div.paragraph").first().text().trim()
    };
}


// Exports
module.exports = parseReadme;