Fixes #1.
I am not sure about the copyright heading you want me to use. Feel free to request a modification.
Code was tested on Python 2.7, 3.4 and 3.5. I had to make minor changes in test.py to that end.
An extension that supports task lists, that are simply lists of checkboxes. Both ordered and unordered lists are supported and can be separately enabled. Nested lists are supported.
By default, unchecked boxes ares represented by [ ]. Customize the pattern with option unchecked. You can use a list.
By default, checked boxes are represented by [x] or [X]. Customize the pattern with option checked. You can use a list.
Checked patterns are tested before unchecked patterns.
Example:
- [x] milk
- [ ] eggs
- [x] chocolate
- [ ] if possible:
1. [ ] solve world peace
2. [ ] solve world hunger
Set option unordered to False to disable parsing of unordered lists.
Set option ordered to False to disable parsing of ordered lists.
You can limit the nesting of task lists by setting the max_depth option. Default is unlimited nesting.
Option item_attrs accepts an attribute dict or a callable that takes the following arguments:
the <li> parent element
the <li> element
the generated <input type="checkbox"> element
and that should return an attribute dict.
These attributes are added to the <li> element where the checkbox is put.
Option checkbox_attrs accepts an attribute dict or a callable that takes
the following arguments:
the <li> parent element
the <li> element
and that should return an attribute dict.
These attributes are added to the checkbox element.
Note: Github has support for updating the markdown source by toggling the checkbox (by clicking on it). This is not supported by this extension, as it requires server-side processing that is out of scope of a markdown parser.
Fixes #1. I am not sure about the copyright heading you want me to use. Feel free to request a modification. Code was tested on Python 2.7, 3.4 and 3.5. I had to make minor changes in
test.py
to that end.An extension that supports task lists, that are simply lists of checkboxes. Both ordered and unordered lists are supported and can be separately enabled. Nested lists are supported.
By default, unchecked boxes ares represented by
[ ]
. Customize the pattern with optionunchecked
. You can use a list. By default, checked boxes are represented by[x]
or[X]
. Customize the pattern with optionchecked
. You can use a list. Checked patterns are tested before unchecked patterns.Example:
Set option
unordered
to False to disable parsing of unordered lists. Set optionordered
to False to disable parsing of ordered lists.You can limit the nesting of task lists by setting the
max_depth
option. Default is unlimited nesting.Option
item_attrs
accepts an attribute dict or a callable that takes the following arguments:<li>
parent element<li>
element<input type="checkbox">
elementand that should return an attribute dict. These attributes are added to the
<li>
element where the checkbox is put.Option
checkbox_attrs
accepts an attribute dict or a callable that takes the following arguments:<li>
parent element<li>
elementand that should return an attribute dict. These attributes are added to the checkbox element.
Note: Github has support for updating the markdown source by toggling the checkbox (by clicking on it). This is not supported by this extension, as it requires server-side processing that is out of scope of a markdown parser.