脚注¶
¥Footnotes¶
脚注是一种很好的方式,可以在不中断文档流程的情况下,为特定的单词、短语或句子添加补充或附加信息。Material for MkDocs 提供了定义、引用和渲染脚注的功能。
¥Footnotes are a great way to add supplemental or additional information to a specific word, phrase or sentence without interrupting the flow of a document. Material for MkDocs provides the ability to define, reference and render footnotes.
配置¶
¥Configuration¶
此配置添加了定义内联脚注的功能,这些脚注随后会呈现在文档所有 Markdown 内容的下方。将以下几行添加到mkdocs.yml中:
¥This configuration adds the ability to define inline footnotes, which are then rendered below all Markdown content of a document. Add the following lines to mkdocs.yml:
查看其他配置选项:
¥See additional configuration options:
脚注工具提示¶
¥Footnote tooltips¶
insiders-4.51.0
Insiders允许将脚注渲染为内联工具提示,以便用户无需离开文档上下文即可阅读脚注。可以在mkdocs.yml中通过以下方式启用脚注工具提示:
¥Insiders allows to render footnotes as inline tooltips, so the user can read the footnote without leaving the context of the document. Footnote tooltips can be enabled in mkdocs.yml with:
我们的文档上启用了脚注工具提示,因此要尝试一下,您只需将任何脚注悬停或聚焦在此页面或我们文档的任何其他页面上即可。
¥Footnote tooltips are enabled on our documentation, so to try it out, you can just hover or focus any footnote on this page or any other page of our documentation.
用法¶
¥Usage¶
添加脚注引用¶
¥Adding footnote references¶
脚注引用必须用方括号括起来,并且必须以插入符号^开头,后面紧跟任意标识符,这与标准 Markdown 链接语法类似。
¥A footnote reference must be enclosed in square brackets and must start with a caret ^, directly followed by an arbitrary identifier, which is similar to the standard Markdown link syntax.
添加脚注内容¶
¥Adding footnote content¶
脚注内容必须使用与引用相同的标识符声明。它可以插入到文档中的任意位置,并始终显示在页面底部。此外,脚注引用的反向链接会自动添加。
¥The footnote content must be declared with the same identifier as the reference. It can be inserted at an arbitrary position in the document and is always rendered at the bottom of the page. Furthermore, a backlink to the footnote reference is automatically added.
在一行上¶
¥on a single line¶
简短的脚注可以写在同一行:
¥Short footnotes can be written on the same line:
在多行上¶
¥on multiple lines¶
段落可以写在下一行,并且必须缩进四个空格:
¥Paragraphs can be written on the next line and must be indented by four spaces: