A markdown-it plugin to create GitHub-style task lists
npm install markdown-it-task-checkboxA markdown-it plugin to create GitHub-style task lists
Modified from
node.js:
``bash`
npm install markdown-it-task-checkbox --save
`js
var md = require('markdown-it')()
.use(require('markdown-it-checkbox'),{
disabled: true,
divWrap: false,
divClass: 'checkbox',
idPrefix: 'cbx_',
ulClass: 'task-list',
liClass: 'task-list-item'
});
md.render('- [x] unchecked') // =>
//
_Differences in browser._ If you load script directly into the page, without
package system, module will add itself globally as
window.markdownitCheckbox.Options
disabled
* Type:
Boolean
* Default: trueif the value is true, the checkbox can not be selected.
divWrap
* Type:
Boolean
* Default: falsewrap div arround checkbox. this makes it possible to use it for example with Awesome Bootstrap Checkbox.
divClass
* Type:
String
* Default: checkboxclassname of div wrapper. will only be used if
divWrap is enanbled.idPrefix
* Type:
String
* Default: cbx_the id of the checkboxs input contains the prefix and an incremental number starting with
0. i.e. cbx_1 for the 2nd checkbox.ulClass
* Type:
String
* Default: task-listclassname of ul wrapper.
liClass
* Type:
String
* Default: task-list-item`classname of li wrapper.
MIT License © 2016 Linsir