Python Markdown extension for task lists with checkboxes
Project description
[Markdown Checklist](https://github.com/FND/markdown-checklist)
a [Python Markdown](http://pythonhosted.org/Markdown/) extension for lists of
tasks with checkboxes
inspired by
[GitHub task lists](https://github.com/blog/1375-task-lists-in-gfm-issues-pulls-comments):
* [ ] foo
* [x] bar
* [ ] baz
becomes
<ul>
<li><input type="checkbox" disabled> foo</li>
<li><input type="checkbox" disabled checked> bar</li>
<li><input type="checkbox" disabled> baz</li>
</ul>
* a dash can be used instead of an asterisk for list items
* both upper- and lowercase "x" are accepted to activate checkboxes
Installation
------------
$ pip install markdown-checklist
Usage
-----
import markdown
html = markdown.markdown(source, extensions=['markdown_checklist.extension'])
or
import markdown
from markdown_checklist.extension import ChecklistExtension
html = markdown.markdown(source, extensions=[ChecklistExtension()])
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.
a [Python Markdown](http://pythonhosted.org/Markdown/) extension for lists of
tasks with checkboxes
inspired by
[GitHub task lists](https://github.com/blog/1375-task-lists-in-gfm-issues-pulls-comments):
* [ ] foo
* [x] bar
* [ ] baz
becomes
<ul>
<li><input type="checkbox" disabled> foo</li>
<li><input type="checkbox" disabled checked> bar</li>
<li><input type="checkbox" disabled> baz</li>
</ul>
* a dash can be used instead of an asterisk for list items
* both upper- and lowercase "x" are accepted to activate checkboxes
Installation
------------
$ pip install markdown-checklist
Usage
-----
import markdown
html = markdown.markdown(source, extensions=['markdown_checklist.extension'])
or
import markdown
from markdown_checklist.extension import ChecklistExtension
html = markdown.markdown(source, extensions=[ChecklistExtension()])
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file markdown-checklist-0.4.0.tar.gz
.
File metadata
- Download URL: markdown-checklist-0.4.0.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0229fda0dc025b17b30e4f9d9851149815665371590ff704906dc5d9ee64555c |
|
MD5 | 17d664a15593a2035fc98c7062af282c |
|
BLAKE2b-256 | 6913244bbcb5b8b6bbf5c5f03cd7367f48a29448f4f8ac02b97f84b7bee60586 |