mkdocs-material/docs/extensions/pymdown/tasklist.md
2016-12-18 13:29:03 +01:00

2.0 KiB

Tasklist

The Tasklist extension included in the PyMdown Extensions package adds support for styled checkbox lists. This is useful for keeping track of tasks and showing what has been done and has yet to be done.

Installation

Make sure that the PyMdown Extensions package is installed and add the following lines to your mkdocs.yml:

markdown_extensions:
  - pymdownx.tasklist(custom_checkbox=true)

The custom_checkbox flag adds additional markup for better styling, so it is highly recommended to add this flag, as the Material theme supports it.

Usage

Checkbox lists are like regular lists, but prefixed with [ ] empty or [x] filled checkboxes.

Example:

* [x] Lorem ipsum dolor sit amet, consectetur adipiscing elit
* [x] Nulla lobortis egestas semper
* [x] Curabitur elit nibh, euismod et ullamcorper at, iaculis feugiat est
* [ ] Vestibulum convallis sit amet nisi a tincidunt
    * [x] In hac habitasse platea dictumst
    * [x] In scelerisque nibh non dolor mollis congue sed et metus
    * [x] Sed egestas felis quis elit dapibus, ac aliquet turpis mattis
    * [ ] Praesent sed risus massa
* [ ] Aenean pretium efficitur erat, donec pharetra, ligula non scelerisque
* [ ] Nulla vel eros venenatis, imperdiet enim id, faucibus nisi

Result:

  • Lorem ipsum dolor sit amet, consectetur adipiscing elit
  • Nulla lobortis egestas semper
  • Curabitur elit nibh, euismod et ullamcorper at, iaculis feugiat est
  • Vestibulum convallis sit amet nisi a tincidunt
    • In hac habitasse platea dictumst
    • In scelerisque nibh non dolor mollis congue sed et metus
    • Sed egestas felis quis elit dapibus, ac aliquet turpis mattis
    • Praesent sed risus massa
  • Aenean pretium efficitur erat, donec pharetra, ligula non scelerisque
  • Nulla vel eros venenatis, imperdiet enim id, faucibus nisi