Jekyll 是一个静态站点生成器,它获取 Markdown 文件并将其转换为网站。Jekyll 是一个用 Ruby 编程语言编写的免费开源应用程序。数以千计的网站(包括 Markdown 指南)都依赖 Jekyll 将 Markdown 源文件转换为 HTML 输出。GitHub Pages 使用 Jekyll 作为其免费网站创建服务的后端。
默认情况下,Jekyll 使用具有原始设置的 kramdown Markdown 处理器,但您可以启用其他 kramdown 选项,甚至可以将 Jekyll 切换到另一个 Markdown 处理器。有关更多信息,请参阅 Jekyll Markdown 配置选项文档。您可以在文件中更改 Jekyll 的 kramdown 设置。Markdown Guide 的设置如下所示。_config.yml
kramdown:
syntax_highlighter: rouge
input: GFM
auto_ids: true
toc_levels: 1..3
Jekyll 为以下 Markdown 元素提供支持。
Element | Support | Notes |
---|---|---|
Headings | Yes | |
Paragraphs | Yes | |
Line Breaks | Yes | |
Bold | Yes | |
Italic | Yes | |
Blockquotes | Yes | |
Ordered Lists | Yes | |
Unordered Lists | Yes | |
Code | Yes | |
Horizontal Rules | Yes | |
Links | Yes | |
Images | Yes | |
Tables | Yes | |
Fenced Code Blocks | Yes | |
Syntax Highlighting | Yes | Make sure that is in the section of the file.
syntax_highlighter: rouge kramdown _config.yml |
Footnotes | Yes | |
Heading IDs | Yes | |
Definition Lists | Yes | |
Strikethrough | Yes | You can use two tildes () or one tilde () — both work.
~~word~~ ~word~ |
Task Lists | Yes | |
Emoji (copy and paste) | Yes | |
Emoji (shortcodes) | No | Not supported by default, but you can use the jemoji plugin to enable support. |
Highlight | No | |
Subscript | No | |
Superscript | No | |
Automatic URL Linking | Yes | |
Disabling Automatic URL Linking | Yes | |
HTML | Yes |
作为额外的好处,Jekyll 提供了对几个晦涩元素的支持。
Element | Markdown | Rendered Output |
---|---|---|
Abbreviation | *[HTML]: Hyper Text Markup Language The HTML specification is maintained by the W3C. |
The HTML specification is maintained by the W3C. |
在 60 页中学习 Markdown。《Markdown 指南》专为新手和专家设计,是一本全面的参考书,包含您入门和掌握 Markdown 语法所需的一切。
获取书籍