如何在Jekyll中添加GFM任务列表?

时间:2017-12-13 08:02:46

标签: jekyll github-pages github-flavored-markdown kramdown

GFM支持任务列表:

https://github.com/blog/1375-task-lists-in-gfm-issues-pulls-comments

如何在Jekyll页面中使用它?在我的网站_config.yml

# Build settings
markdown: kramdown
kramdown:
  input: GFM
  hard_wrap: false

这适用于大多数其他GFM构造。但没有任务列表。

降价示例:

#### Checklist for Aggregations
- [ ] Always add `max(x)` in the group for size of buckets needed. When data is distributed across multiple content nodes this result can be inaccurate. To increase accuracy we need to use `precision(x)` as well to tune accuracy as we need.

预期:

enter image description here

现实: enter image description here

1 个答案:

答案 0 :(得分:1)

您使用的是哪个版本的kramdown?自1.16.0起支持GFM任务列表(在1.16.1中发布了错误修复)。要删除项目符号列表,list-style-type: none is necessary

在我的系统上,以下测试文件

---
---

- [ ] Unchecked
- [x] Checked
{: style='list-style-type: none'}

生成预期的

GFM task list

使用kramdown 1.16.2和Jekyll 3.6.2。如果你的kramdown早于1.16.1,你应该可以简单地

$ gem update kramdown

获得功能。