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

标签 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 构造。但不适用于任务列表。

Markdown 示例:

#### 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

最佳答案

您使用的是哪个版本的 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

获得该功能。

关于jekyll - 如何在 Jekyll 中添加 GFM 任务列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47788154/

相关文章:

python - 全局包含在重组文本中

heroku - 自定义 Jekyll 404 页面在 Heroku 上不起作用

Jekyll:将变量从索引传递到帖子

python-sphinx - Sphinx 扩展以在 Sphinx 中使用 GitHub Markdown 表情符号?

github - 如何在 Github Flavored Markdown 中创建一个好看的通知或警告框?

markdown - Github Markdown 中的列表项之间出现额外的行

css - Jekyll 站点中未呈现的样式

git - 为什么调用 git branch --unset-upstream 来修复?

configuration - Jekyll: 'About' 永久链接无法正常工作

github - 如何在 GitHub Pages 上托管 Sphinx 文档?