summaryrefslogtreecommitdiffstats
path: root/lib/template/blocks.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-03-18 11:20:57 +0100
committerSamy Pessé <samypesse@gmail.com>2016-03-18 11:20:57 +0100
commitedda84fefd17426fcdf822fc3fb746f30047085c (patch)
tree9be887e9a4781215110b9a4cae7e9f86ed68982e /lib/template/blocks.js
parent10b191f631723aa5ea980953ff635d0f6c2273d5 (diff)
downloadgitbook-edda84fefd17426fcdf822fc3fb746f30047085c.zip
gitbook-edda84fefd17426fcdf822fc3fb746f30047085c.tar.gz
gitbook-edda84fefd17426fcdf822fc3fb746f30047085c.tar.bz2
Add block "markdown", "asciidoc" and "markup"
Diffstat (limited to 'lib/template/blocks.js')
-rw-r--r--lib/template/blocks.js20
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 };
+ });
}
};