跳转至

格式化

MkDocs的材料为可以使用的几个HTML元素提供了支持 突出显示文档的某些部分或应用特定格式。另外, 支持[批评标记],增加了显示建议更改的能力 对于一份文件。

配置

此配置支持键盘按键,跟踪 文档,定义子和上标并突出显示文本。添加 将以下行转换为mkdocs.yml

markdown_extensions:
  - pymdownx.critic
  - pymdownx.caret
  - pymdownx.keys
  - pymdownx.mark
  - pymdownx.tilde

请参阅其他配置选项:

使用

突出显示更改

启用Critic后,可以使用Critic Markup,这增加了以下功能 突出显示建议的更改,并在文档中添加内联注释:

Text with suggested changes
Text can be {--deleted--} and replacement text {++added++}. This can also be
combined into {~~one~>a single~~} operation. {==Highlighting==} is also
possible {>>and comments can be added inline<<}.

{==

Formatting can also be applied to blocks by putting the opening and closing
tags on separate lines and adding new lines between the tags and the content.

==}

Text can be deleted and replacement text added. This can also be combined into onea single operation. Highlighting is also possible and comments can be added inline.

Formatting can also be applied to blocks by putting the opening and closing tags on separate lines and adding new lines between the tags and the content.

突出显示文本

When Caret, Mark & Tilde are enabled, text can be highlighted with a simple syntax, which is more convenient that directly using the corresponding mark, ins and del HTML tags:

Text with highlighting
- ==This was marked (highlight)==
- ^^This was inserted (underline)^^
- ~~This was deleted (strikethrough)~~
  • This was marked (highlight)
  • This was inserted (underline)
  • This was deleted (strikethrough)

副标题和上标

When Caret & Tilde are enabled, text can be sub- and superscripted with a simple syntax, which is more convenient than directly using the corresponding sub and sup HTML tags:

Text with sub- and superscripts
- H~2~O
- A^T^A
  • H2O
  • ATA

添加键盘按键

When Keys is enabled, keyboard keys can be rendered with a simple syntax. Consult the Python Markdown Extensions documentation to learn about all available shortcodes:

Keyboard keys
++ctrl+alt+del++

Ctrl+Alt+Del