Plugin to create checkboxes for markdown-it markdown parser
npm install markdown-it-checkbox> Plugin to create checkboxes for markdown-it markdown parser.
This plugin allows to create checkboxes for tasklists as discussed here.
node.js, browser:
``bash`
npm install markdown-it-checkbox --save
bower install markdown-it-checkbox --save
`js
var md = require('markdown-it')()
.use(require('markdown-it-checkbox'));
md.render('[ ] unchecked') // =>
//
//
//
//
md.render('[x] checked') // =>
//
//
//
//
_Differences in browser._ If you load script directly into the page, without
package system, module will add itself globally as
window.markdownitCheckbox.Options
`js
var md = require('markdown-it')()
.use(require('markdown-it-checkbox'),{
divWrap: true,
divClass: 'cb',
idPrefix: 'cbx_'
});md.render('[ ] unchecked') // =>
//
//
//
//
//
//
`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: checkboxthe id of the checkboxs input contains the prefix and an incremental number starting with
0. i.e. checkbox1` for the 2nd checkbox.MIT License © 2015 Markus Cecot
[npm-url]: https://npmjs.org/package/markdown-it-checkbox
[npm-image]: https://img.shields.io/npm/v/markdown-it-checkbox.svg
[travis-url]: http://travis-ci.org/mcecot/markdown-it-checkbox
[travis-image]: https://secure.travis-ci.org/mcecot/markdown-it-checkbox.svg?branch=master
[coveralls-url]: https://coveralls.io/r/mcecot/markdown-it-checkbox
[coveralls-image]: https://img.shields.io/coveralls/mcecot/markdown-it-checkbox.svg
[depstat-url]: https://david-dm.org/mcecot/markdown-it-checkbox
[depstat-image]: https://david-dm.org/mcecot/markdown-it-checkbox.svg
[devdepstat-url]: https://david-dm.org/mcecot/markdown-it-checkbox#info=devDependencies
[devdepstat-image]: https://david-dm.org/mcecot/markdown-it-checkbox/dev-status.svg