Skip to content

footnote

把数组或对象转换为 Markdown 脚注定义。

语法

knap
{{ value | footnote }}

用法

  • 数组使用从 1 开始的数字标签。对象的键会转换为 kebab-case 标签。

示例

数组脚注

Data
json
{
  "notes": [
    "First item",
    "Second item"
  ]
}
Template
knap
{{ notes | footnote }}
Output
md
[^1]: First item

[^2]: Second item

对象脚注

Data
json
{
  "notes": {
    "First Note": "Content 1",
    "Second Note": "Content 2"
  }
}
Template
knap
{{ notes | footnote }}
Output
md
[^first-note]: Content 1

[^second-note]: Content 2