mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-12 05:48:57 +00:00
52 lines
1.2 KiB
JavaScript
52 lines
1.2 KiB
JavaScript
var Immutable = require('immutable');
|
|
var TemplateBlock = require('../models/templateBlock');
|
|
|
|
module.exports = Immutable.Map({
|
|
html: TemplateBlock({
|
|
name: 'html',
|
|
process: function(blk) {
|
|
return blk;
|
|
}
|
|
}),
|
|
|
|
code: TemplateBlock({
|
|
name: 'code',
|
|
process: function(blk) {
|
|
return {
|
|
html: false,
|
|
body: blk.body
|
|
};
|
|
}
|
|
}),
|
|
|
|
markdown: TemplateBlock({
|
|
name: 'markdown',
|
|
process: function(blk) {
|
|
return this.book.renderInline('markdown', blk.body)
|
|
.then(function(out) {
|
|
return { body: out };
|
|
});
|
|
}
|
|
}),
|
|
|
|
asciidoc: TemplateBlock({
|
|
name: 'asciidoc',
|
|
process: function(blk) {
|
|
return this.book.renderInline('asciidoc', blk.body)
|
|
.then(function(out) {
|
|
return { body: out };
|
|
});
|
|
}
|
|
}),
|
|
|
|
markup: TemplateBlock({
|
|
name: 'markup',
|
|
process: function(blk) {
|
|
return this.book.renderInline(this.ctx.file.type, blk.body)
|
|
.then(function(out) {
|
|
return { body: out };
|
|
});
|
|
}
|
|
})
|
|
});
|