本文根据 Devhints / Kramdown 翻译。代码示例及版本范围沿用原文。
关于
Kramdown 是 Ruby 中的 Markdown 解析器。
配置
-
parse_block_html- 块级元素内的 process 语法 -
parse_span_html- 行内元素内的 process 语法 -
html_to_native- 将 HTML 元素转换为原生元素{::options parse_block_html=“true” /}
对于 GFM 解析器:
hard_wrap
http://kramdown.gettalong.org/parser/gfm.html
针对 Jekyll (gh-pages)
# _config.yml
markdown: kramdown
kramdown:
input: GFM
脚注 (Kramdown)
This is some text.[^1]. Other text.[^footnote].
[^1]: Some *crazy* footnote definition.
缩略语 (Kramdown)
This is some text not written in HTML but in another language!
*[another language]: It's called Markdown
*[HTML]: HyperTextMarkupLanguage
类名与 ID (Kramdown)
A simple paragraph with an ID attribute.
{: #para-one}
> A blockquote with a title
{:title="The blockquote title"}
{: #myid}
* {:.cls} This item has the class "cls"
{:.ruby}
Some code here