diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-03-18 11:20:57 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-03-18 11:20:57 +0100 |
commit | edda84fefd17426fcdf822fc3fb746f30047085c (patch) | |
tree | 9be887e9a4781215110b9a4cae7e9f86ed68982e | |
parent | 10b191f631723aa5ea980953ff635d0f6c2273d5 (diff) | |
download | gitbook-edda84fefd17426fcdf822fc3fb746f30047085c.zip gitbook-edda84fefd17426fcdf822fc3fb746f30047085c.tar.gz gitbook-edda84fefd17426fcdf822fc3fb746f30047085c.tar.bz2 |
Add block "markdown", "asciidoc" and "markup"
-rw-r--r-- | lib/template/blocks.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/template/blocks.js b/lib/template/blocks.js index a079cde..5dfb0c8 100644 --- a/lib/template/blocks.js +++ b/lib/template/blocks.js @@ -12,5 +12,25 @@ module.exports = { html: false, body: blk.body }; + }, + + // Render some markdown to HTML + markdown: function(blk) { + return this.book.renderInline('markdown', blk.body) + .then(function(out) { + return { body: out }; + }); + }, + asciidoc: function(blk) { + return this.book.renderInline('asciidoc', blk.body) + .then(function(out) { + return { body: out }; + }); + }, + markup: function(blk) { + return this.book.renderInline(this.ctx.file.type, blk.body) + .then(function(out) { + return { body: out }; + }); } }; |