summaryrefslogtreecommitdiffstats
path: root/lib/template/blocks.js
diff options
context:
space:
mode:
authorSamy Pesse <samypesse@gmail.com>2016-04-23 17:10:16 +0200
committerSamy Pesse <samypesse@gmail.com>2016-04-23 17:10:16 +0200
commite1fa977b5b1b3c03790de6e2c21ee39ba55d9555 (patch)
treea1ad4386100b5779ef930845093c14639a3353b5 /lib/template/blocks.js
parentce95f316b9ce1eac1e615db3540c4d0f30408d63 (diff)
downloadgitbook-e1fa977b5b1b3c03790de6e2c21ee39ba55d9555.zip
gitbook-e1fa977b5b1b3c03790de6e2c21ee39ba55d9555.tar.gz
gitbook-e1fa977b5b1b3c03790de6e2c21ee39ba55d9555.tar.bz2
Add json encoding utils
Diffstat (limited to 'lib/template/blocks.js')
-rw-r--r--lib/template/blocks.js36
1 files changed, 0 insertions, 36 deletions
diff --git a/lib/template/blocks.js b/lib/template/blocks.js
deleted file mode 100644
index 5dfb0c8..0000000
--- a/lib/template/blocks.js
+++ /dev/null
@@ -1,36 +0,0 @@
-var _ = require('lodash');
-
-module.exports = {
- // Return non-parsed html
- // since blocks are by default non-parsable, a simple identity method works fine
- html: _.identity,
-
- // Highlight a code block
- // This block can be replaced by plugins
- code: function(blk) {
- return {
- 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 };
- });
- }
-};