【问题标题】:How to add GFM task lists in Jekyll?如何在 Jekyll 中添加 GFM 任务列表?
【发布时间】:2018-05-27 01:19:53
【问题描述】:

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.

预期:

现实:

【问题讨论】:

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


    【解决方案1】:

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

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

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

    产生预期的

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

    $ gem update kramdown
    

    获得功能。

    【讨论】:

    • 请注意,截至 2018 年 1 月 5 日,GitHub 页面上使用的 Kramdown 版本为 1.14.0,因此这不适用于 GitHub 页面。
    猜你喜欢
    • 1970-01-01
    • 2019-02-24
    • 1970-01-01
    • 1970-01-01
    • 2016-03-25
    • 2015-05-24
    • 1970-01-01
    • 1970-01-01
    • 2022-06-24
    相关资源
    最近更新 更多