From edda84fefd17426fcdf822fc3fb746f30047085c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Fri, 18 Mar 2016 11:20:57 +0100 Subject: [PATCH] Add block "markdown", "asciidoc" and "markup" --- lib/template/blocks.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/template/blocks.js b/lib/template/blocks.js index a079cdea0..5dfb0c8c1 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 }; + }); } };