Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/linsir/markdown-it-task-checkbox
A markdown-it plugin to create GitHub-style task lists with checkbox
https://github.com/linsir/markdown-it-task-checkbox
Last synced: 2 months ago
JSON representation
A markdown-it plugin to create GitHub-style task lists with checkbox
- Host: GitHub
- URL: https://github.com/linsir/markdown-it-task-checkbox
- Owner: linsir
- License: other
- Created: 2016-09-21T14:36:31.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-11-01T05:23:19.000Z (about 3 years ago)
- Last Synced: 2024-10-31T19:37:02.871Z (3 months ago)
- Language: JavaScript
- Size: 28.3 KB
- Stars: 26
- Watchers: 3
- Forks: 12
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# markdown-it-task-checkbox
A [markdown-it](https://www.npmjs.com/package/markdown-it) plugin to create GitHub-style [task lists](https://github.com/blog/1825-task-lists-in-all-markdown-documents)
Modified from and
## Usage
## Install
node.js:
```bash
npm install markdown-it-task-checkbox --save
```## Use
```js
var md = require('markdown-it')()
.use(require('markdown-it-task-checkbox'),{
disabled: true,
divWrap: false,
divClass: 'checkbox',
idPrefix: 'cbx_',
ulClass: 'task-list',
liClass: 'task-list-item'
});md.render('- [x] unchecked') // =>
//
-
//
//
// 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:** `true`
if the value is true, the checkbox can not be selected.
## divWrap
* **Type:** `Boolean`
* **Default:** `false`
wrap div arround checkbox. this makes it possible to use it for example with [Awesome Bootstrap Checkbox](https://github.com/flatlogic/awesome-bootstrap-checkbox/).
## divClass
* **Type:** `String`
* **Default:** `checkbox`
classname 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-list`
classname of ul wrapper.
## liClass
* **Type:** `String`
* **Default:** `task-list-item`
classname of li wrapper.
## THANKS
and
## License
MIT License © 2016 Linsir