GithubHelp home page GithubHelp logo

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

View Code? Open in Web Editor NEW

This project forked from revin/markdown-it-task-lists

0.0 1.0 0.0 26 KB

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

License: ISC License

JavaScript 100.00%

markdown-it-task-lists's Introduction

markdown-it-task-lists

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

Build Status Code Climate

What it does

  • Builds task/todo lists out of markdown lists with items starting with [ ] or [x].
  • Nothing else

Why is this useful?

When you have markdown documentation with checklists, rendering HTML checkboxes out of the list items looks nicer than the raw square brackets.

Installation

npm install markdown-it-task-lists

Usage

Use it the same as a normal markdown-it plugin:

var md = require('markdown-it');
var taskLists = require('markdown-it-task-lists');

var parser = md().use(taskLists);

var result = parser.render(...); // markdown string containing task list items

The rendered checkboxes are disabled; to change this, pass a truthy value into the enabled property of the plugin options:

var parser = md().use(taskLists, {enabled: true});

If you'd like to wrap the rendered list items in a <label> element for UX purposes, pass a truthy value to the label property of the plugin options:

var parser = md().use(taskLists, {label: true});

The options can be combined, of course.

Browser Usage

If you use one of the versions of this module available in dist/ directly in a browser by including it with a <script> element, it will be available globally in window.markdownitTaskLists.

Tests

npm install
npm test

License

ISC

markdown-it-task-lists's People

Contributors

greenkeeperio-bot avatar revin 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.