GithubHelp home page GithubHelp logo

gerhobbelt / markdown-it-task-checkbox Goto Github PK

View Code? Open in Web Editor NEW

This project forked from linsir/markdown-it-task-checkbox

0.0 1.0 0.0 28 KB

A markdown-it plugin to create GitHub-style task lists with checkbox

License: Other

JavaScript 100.00%

markdown-it-task-checkbox's Introduction

markdown-it-task-lists

A markdown-it plugin to create GitHub-style task lists

Modified from https://github.com/mcecot/markdown-it-checkbox and https://github.com/revin/markdown-it-task-lists

Usage

Install

node.js:

npm install markdown-it-task-checkbox --save

Use

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') // =>
// <ul class="task-list">
//  <li class="task-list-item">
//     <div classname="checkbox">
//       <input type="checkbox" id="cbx_0" checked="true" disabled="true">
//       <label for="cbx_0">unchecked</label>
//     </div>
//  </li>
// </ul>

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.

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

https://github.com/mcecot/markdown-it-checkbox and https://github.com/revin/markdown-it-task-lists

License

MIT License © 2016 Linsir

markdown-it-task-checkbox's People

Contributors

arve0 avatar linsir avatar mrmurphy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.