Giter Site home page Giter Site logo

y1zhou / markdown-checklists Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fnd/markdown-checklist

0.0 2.0 2.0 483 KB

Python Markdown extension for lists of tasks with checkboxes

Makefile 7.00% JavaScript 15.82% CSS 36.55% Python 32.77% Smarty 7.87%

markdown-checklists's Introduction

Markdown Checklists Build Status

a Python Markdown extension for lists of tasks with checkboxes inspured by GitHub task lists.

Markdown-Checklists is forked from Markdown Checklist and extended with addtional features.

Features

  • a dash can be used instead of an asterisk for list items
  • both upper- and lowercase "x" are accepted to activate checkboxes

Additional Features

  • MakeFile provides task to create for Sublime-Text 3 Plugin OmniMarkupPreviewer an Markdown-Renderer extension with additonal template files.
  • class attribute for <ul>-Tag for Checklists.
  • class attribute for <li>-Tag of Checklists.
  • Genearting key (hash) for each checkpoint text, using hash to make checklist check"ed" able.
  • id attribute for <input>-Tag of Checklists.
  • for attribute for <label>-Tag of Checklists.

Example HTML Output

h1>Hello World</h1>
<ul class="checklist">
<li class="task-list-item"><input type="checkbox" id="ca052d1d7e0a2f787f4ef9937840dcf91e647b08b208df4bbce2e78d527a4f8c"><label for="ca052d1d7e0a2f787f4ef9937840dcf91e647b08b208df4bbce2e78d527a4f8c"> foo</label></li>
<li class="task-list-item"><input type="checkbox" id="375719a43941c6a5e7f957c74b6f1d7e20cfefd0040181aaf6d3074c8eaac311" checked><label for="375719a43941c6a5e7f957c74b6f1d7e20cfefd0040181aaf6d3074c8eaac311"> bar</label></li>
<li class="task-list-item"><input type="checkbox" id="7d80d75283fdbf2a3d8a0e2eed45e9d844d1a7482372cd8bc59581725373c179"><label for="7d80d75283fdbf2a3d8a0e2eed45e9d844d1a7482372cd8bc59581725373c179"> baz</label></li>
<li class="task-list-item"><input type="checkbox"></li>
<li class="task-list-item"><input type="checkbox" checked></li>
</ul>
<p>lorem ipsum</p>

Installation

$ pip install markdown-checklists

Markdown-Renderer Extension for OmniMarkupPreviewer

installs the extension to the current user.

$ make OmniMarkupPreviewerInstall

Usage

import markdown
html = markdown.markdown(source, extensions=['markdown_checklists.extension'])

or

import markdown
from markdown_checklists.extension import ChecklistsExtension
html = markdown.markdown(source, extensions=[ChecklistsExtension()])

There is also a small JavaScript/jQuery library to make checkboxes interactive:

new Checklists("article", function(checkbox, callback) {
    var uri = checkbox.closest("article").find("h1 a").attr("href");
    jQuery.get(uri, callback);
}, function(markdown, checkbox, callback) {
    var uri = checkbox.closest("article").find("h1 a").attr("href");
    jQuery.ajax({
        type: "put",
        uri: uri,
        data: markdown,
        success: callback
    });
});

See included checklists.js for details.

markdown-checklists's People

Contributors

cdent avatar fnd avatar

Watchers

 avatar  avatar

Forkers

geniusv dilboy

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.