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

问题描述 投票:0回答:1

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

jekyll github-pages github-flavored-markdown kramdown
1个回答
1
投票

您使用的是哪个版本的kramdown?从1.16.0开始支持GFM任务列表(在1.16.1中发布了一个bugfix)。为了消除项目符号列表,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

获得功能。

© www.soinside.com 2019 - 2024. All rights reserved.