summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-asciidoc/lib/utils/convert.js
blob: 8a1963843a1f6dc6c38e2a6ebe130efbaebf5dbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
var asciidoctor = require('asciidoctor.js')();
var opal = asciidoctor.Opal;

var processor = null;
var useExtensions = true;

if (useExtensions) {
    processor = asciidoctor.Asciidoctor(true);
} else {
    processor = asciidoctor.Asciidoctor();
}


var convert = function(content) {
    var options = opal.hash2(['attributes'], {'attributes': 'showtitle'});

    var html = processor.$convert(content, options);
    return html;
};

module.exports = convert;