1.1.0 • Published 9 years ago

markdown-it-checkbox v1.1.0

Weekly downloads
8,575
License
MIT
Repository
github
Last release
9 years ago

markdown-it-checkbox NPM version

Build Status Coverage Status Dependency Status devDependency Status

Plugin to create checkboxes for markdown-it markdown parser.

This plugin allows to create checkboxes for tasklists as discussed here.

Usage

Install

node.js, browser:

npm install markdown-it-checkbox --save
bower install markdown-it-checkbox --save

Use

var md = require('markdown-it')()
            .use(require('markdown-it-checkbox'));

md.render('[ ] unchecked') // =>
// <p>
//  <input type="checkbox" id="checkbox0">
//  <label for="checkbox0">unchecked</label>
// </p>

md.render('[x] checked') // =>
// <p>
//  <input type="checkbox" id="checkbox0" checked="true">
//  <label for="checkbox0">checked</label>
// </p>

Differences in browser. If you load script directly into the page, without package system, module will add itself globally as window.markdownitCheckbox.

Options

var md = require('markdown-it')()
            .use(require('markdown-it-checkbox'),{
              divWrap: true,
              divClass: 'cb',
              idPrefix: 'cbx_'
            });

md.render('[ ] unchecked') // =>
// <p>
//  <div classname="cb">
//    <input type="checkbox" id="cbx_0">
//    <label for="cbx_0">unchecked</label>
//  </div>
// </p>

divWrap

  • Type: Boolean
  • Default: false

wrap div arround checkbox. this makes it possible to use it for example with Awesome Bootstrap Checkbox.

divClass

  • Type: String
  • Default: checkbox

classname of div wrapper. will only be used if divWrap is enanbled.

idPrefix

  • Type: String
  • Default: checkbox

the id of the checkboxs input contains the prefix and an incremental number starting with 0. i.e. checkbox1 for the 2nd checkbox.

License

MIT License © 2015 Markus Cecot

mypen@hyiromori/lib-js-markdown@everseenflash/mypenskri.be@itlangzi/medit@everything-registry/sub-chunk-2132grunt-slice-markdownhexo-renderer-markdownjungledrumignitegwi-vue-componentsimdone-coreimdone-vue-liblearnmoremarkdown-uimarkdown-pdf-climarkdown-to-filemarkdowndoc-markdown-parserfiddlyorandaoh-hi-markdownpenpen.mdnodebb-plugin-markdownnodebb-plugin-markdown-lemonhxnodebb-plugin-markdown-niuniunodebb-plugin-markdown-urbanicnodebb-plugin-markdown-venomnodebb-plugin-ws-markdownnodebb-plugin-cppnet-markdownnode-red-contrib-static-markdownmrbuilder-plugin-markdownmakeitpdfmd2apkgmenneumeemo-appmotes-mdpretty-markdown-pdfrayx-uireviewercanvas-native@doc-tools/yfm2xliff@documint/custom-handlebars-helpers@dking/markdown-webpack-loadercaptains-blogcreate-eleventy-blogbryn-md-renderbitmui@kyicy/md2anki@mrbuilder/plugin-markdown@mryhryki/markdown@publishkit/pklibyoginth-pen@foxone/vuepress-theme-docs@fullstax/pretty-markdown-pdfcsycms-corecsycms-core-testvscode-office@mitmaro/aglio-theme-olio@motes/md@qingqingfe/nodebb-plugin-qingqing-markdown@pipythonmc/markdown-folder-to-htmlblogmore.beta1docx-clivuepress-theme-dogvuepress-theme-yuchannsvue-markdown-it-toczfinder@kohaku/hexo-renderer-markdown-it@studyathome-internationally/vuepress-theme-hub@vipzhichengfork/pretty-markdown-pdf@wulechuan/generate-html-via-markdownbigyangui@asterics-docs/vuepress-theme-docsaglio-theme-adminaglio-theme-apiaglio-theme-attributableaglio-theme-bieaglio-theme-planadoaglio-theme-setlistaglio-theme-shoelaceaglio-theme-tandaaglio-theme-vinilaaglio-theme-w00tw00taglio-theme-wealthboxaglio-theme-weekwoodaglio-theme-chargeaglio-theme-confluenceaglio-theme-dlioaglio-theme-gooseaglio-theme-iobeamdocsaglio-theme-legoaglio-theme-minimalaglio-theme-mnovelliaglio-theme-okapiaglio-theme-olioaglio-theme-olio-attributesaglio-theme-olio-patchedaglio-theme-olio-printingaglio-theme-olio-printing-nav
1.1.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago