forked from GitbookIO/plugin-hints
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
32 lines (29 loc) · 771 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
28
29
30
31
32
var CLASSES = {
info:'info',
tip:'success',
danger:'danger',
working:'warning'
};
function makeIcon(name) {
return '<i class="octicon octicon-'+name+'" style=""></i>';
}
var ICONS = {
info: makeIcon('info'),
tip: makeIcon('mortar-board'), // Diploma hat
danger: makeIcon('issue-opened'),
working: makeIcon('tools')
};
module.exports = {
blocks: {
hint: {
process: function (block) {
// Available styles: info, danger, tip, working
var style = block.kwargs.style || 'info';
return '<div class="alert alert-'+CLASSES[style]+'">'
+ ICONS[style]
+ block.body
+ '</div>';
}
}
}
};