Checklists

List items can be marked complete using checklists.

Checklists (i.e., task lists) are unordered lists that have items marked as checked ([*] or [x]) or unchecked ([ ]). Here’s an example:

Example 1. Checklist syntax
* [*] checked
* [x] also checked
* [ ] not checked
* normal list item

The result of Example 1 is displayed below.

  • checked

  • also checked

  • not checked

  • normal list item

Not all items in the list have to be checklist items, as Example 1 shows.

When checklists are converted to HTML, the checkbox markup is transformed into an HTML checkbox with the appropriate checked state. The data-item-complete attribute on the checkbox is set to 1 if the item is checked, 0 if not. The checkbox is used in place of the item’s bullet.

Since HTML generated from AsciiDoc is typically static, the checkbox is set as disabled to make it appear as a simple mark. If you want to make the checkbox interactive (i.e., clickable), add the interactive option to the checklist (shown here using the shorthand syntax for the Options Attribute):

Example 2. Checklist with interactive checkboxes
[%interactive]
* [*] checked
* [x] also checked
* [ ] not checked
* normal list item

The result of Example 2 is displayed below.

  • checked

  • also checked

  • not checked

  • normal list item