跳转至

增加注释: Annotations

概要: 在Mkdocs中使用注释丰富文档

创建时间: 2023.10.18 23:37:45

更新时间: 2023.10.19 00:25:16

mkdocs.yaml

首先需要启用如下的Markdown插件

YAML
1
2
3
4
markdown_extensions:
  - attr_list
  - md_in_html
  - pymdownx.superfences
如果需要自定义出现的注释图标,在themes字段新增如下内容
YAML
1
2
3
theme:
  icon:
    annotation: material/arrow-right-circle

使用方法

直接在文本中使用

Markdown
1
2
3
4
5
Lorem ipsum dolor sit amet, (1) consectetur adipiscing elit.
{ .annotate }

1.  :man_raising_hand: I'm an annotation! I can contain `code`, __formatted
    text__, images, ... basically anything that can be expressed in Markdown.

Lorem ipsum dolor sit amet, (1) consectetur adipiscing elit.

  1. 🙋‍♂️ I'm an annotation! I can contain code, formatted text, images, ... basically anything that can be expressed in Markdown.

参考