diff options
Diffstat (limited to 'packages/gitbook-asciidoc/lib/tohtml.js')
-rw-r--r-- | packages/gitbook-asciidoc/lib/tohtml.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/gitbook-asciidoc/lib/tohtml.js b/packages/gitbook-asciidoc/lib/tohtml.js new file mode 100644 index 0000000..80cbb89 --- /dev/null +++ b/packages/gitbook-asciidoc/lib/tohtml.js @@ -0,0 +1,13 @@ +var asciidoctor = require('asciidoctor.js')(); +var opal = asciidoctor.Opal; +var processor = asciidoctor.Asciidoctor(true); + + +function asciidocToHTML(content) { + var options = opal.hash2(['attributes'], {'attributes': 'showtitle'}); + + var html = processor.$convert(content, options); + return html; +}; + +module.exports = asciidocToHTML; |