-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
27 lines (25 loc) · 807 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
module.exports = {
book: {
assets: './assets',
css: [
'bootstrap-grid.min.css'
]
},
blocks: {
row: {
blocks: ['col'],
process: function (rowBlock) {
var tasks = rowBlock.blocks.map((block) => {
var cls = block.args.length == 0 ? "col" : "col-" + block.args[0];
return this.renderBlock('markdown', block.body)
.then(function (str) {
return `<div class="${cls}">\n${str}\n</div>`;
})
});
return Promise.all(tasks).then((columns) => {
return `<div class="row">\n${columns.join("\n")}\n</div>`;
})
}
}
}
}