diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-20 15:31:29 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-12-22 11:46:22 +0100 |
commit | 147679a42257660d70a9ef6ac6216fabf1d67582 (patch) | |
tree | 4dfd4a809c8351b9eea4ebfcc222878a30bec0ad /packages/gitbook-asciidoc/lib/tohtml.js | |
parent | d7b5c6a14d823cd067c7309240326d18a495674a (diff) | |
download | gitbook-147679a42257660d70a9ef6ac6216fabf1d67582.zip gitbook-147679a42257660d70a9ef6ac6216fabf1d67582.tar.gz gitbook-147679a42257660d70a9ef6ac6216fabf1d67582.tar.bz2 |
Use gitbook-html as base parser
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; |