跳转至

语法说明

一、Markdown基本语法

工具使用的是 Monaco Editor 编辑器,使用的渲染是 markdown-it 渲染,支持基本的 Markdown 语法。

参考:

二、扩展语法

2.1 上标

<p>2<sup>32</sup></p>

232

2.2 下标

<p>H<sub>2</sub>O</p>

H2O

2.3 脚注

Text Only
Here's a simple footnote,[^1] and here's a longer one.[^bignote]

[^1]: This is the first footnote.

[^bignote]: Here's one with multiple paragraphs and code.

    Indent paragraphs to include them in the footnote.

    `{ my code }`

    Add as many paragraphs as you like.

Here's a simple footnote,1 and here's a longer one.2

2.4 emoji

方式一

Text Only
:smile:
:joy:

😄 😂

方式二

直接输入,通过工具栏的按钮插入:👍😱

2.5 自定义代码块

支持代码高亮,使用 highlight.js 引擎,支持 100+ 编程语言:

JavaScript
1
2
3
function hello() {
    console.log('Hello World')
}

2.6 支持katex公式

行内公式

Text Only
$E = mc^2$

\(E = mc^2\)

公式块

Text Only
1
2
3
$$
\frac{n!}{k!(n-k)!} = \binom{n}{k}
$$
\[ \frac{n!}{k!(n-k)!} = \binom{n}{k} \]

2.7 支持特殊字符输入

通过工具栏按钮插入特殊符号,支持 20000+ 符号。

2.8 支持mermaid绘图

支持 Mermaid 图表渲染,包括流程图、时序图、类图、状态图、甘特图等。详细参考 060-支持mermaid渲染

2.9 支持Plantuml绘图

支持 PlantUML 图表渲染,通过 markdown-it-plantuml 插件实现。

2.10 支持Material的Admonition

支持 mkdocs Material 主题的 Admonition 告警块:

Text Only
1
2
3
4
5
!!! note "Note"
    This is a note admonition.

!!! warning "Warning"
    This is a warning admonition.

2.11 支持选项卡(Tabbed Set)

支持 mkdocs Material 主题的选项卡功能:

Text Only
1
2
3
4
5
=== "Tab A"
    Content of Tab A

=== "Tab B"
    Content of Tab B

  1. This is the first footnote. 

  2. Here's one with multiple paragraphs and code.

    Indent paragraphs to include them in the footnote.

    { my code }

    Add as many paragraphs as you like.