summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-asciidoc/lib/toHTML.js
blob: 504a20da79f29a68756a48a60c26835fe7417eb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var asciidoctor = require('asciidoctor.js')();

// Render Asciidoc to HTML (block)
function asciidocToHTML(content) {
    return asciidoctor.convert(content, {'attributes': 'showtitle'});
};

// Render Asciidoc to HTML (inline)
function asciidocToHTMLInline(content) {
    return asciidoctor.convert(content, {doctype: 'inline', attributes: 'showtitle'});
};

module.exports = {
    block: asciidocToHTML,
    inline: asciidocToHTMLInline
};