MPE文档阅读记录(未完待续)

Markdown是一种文本格式,可以用它来控制文档的显示。

编写Markdown

Markdown基本要素

语法说明

标题

1
2
3
4
5
6
7
8
9
10
11
# 这是 <h1> 一级标题

## 这是 <h2> 二级标题

### 这是 <h3> 三级标题

#### 这是 <h4> 四级标题

##### 这是 <h5> 五级标题

###### 这是 <h6> 六级标题

强调

1
2
3
4
5
6
7
*这会是 斜体 的文字*
_这会是 斜体 的文字_

**这会是 粗体 的文字**
__这会是 粗体 的文字__

~~这个文字将会被横线删除~~

列表

无序列表
1
2
3
4
- Item 1
- Item 2
- Item 2a
- Item 2b
有序列表
1
2
3
4
5
1. Item 1
1. Item 2
1. Item 3
1. Item 3a
1. Item 3b

添加图片

1
2
![GitHub Logo](/images/logo.png)
Format: ![Alt Text](url)

链接

1
2
3
https://github.com - 自动生成!
[GitHub](https://github.com)
Format: ![Alt Text](url)

引用

1
2
3
正如 Kanye West 所说:
> We're living the future so
> the present is our past.

分割线

1
2
3
4
如下,三个或者更多的
---连字符
***星号
___下划线

行内代码

1
`<addr>`

代码块

在代码上面和下面添加 ``` 来表示代码块。

代码块class(MPE扩展的特性)
代码行数

如果你想要你的代码块显示代码行数,只要添加 line-numbers class 就可以了。
例如:代码语言{.line-numbers}

高亮代码行数

可以通过添加 highlight 属性的方式来高亮代码行数:代码语言 {highlight=[1-10,15,20-22]}

任务列表

1
2
3
- [x] @mentions, #refs, [links](), **formatting**, and <del>tags</del> supported
- [x] this is a complete item
- [ ] this is an incomplete item

表格

1
2
3
4
First Header | Second Header
------------ | -------------
Content from cell 1 | Content from cell 2
Content in the first column | Content in the second column

扩展的语法

表格

需要在插件设置中打开 enableExtendedTableSyntax 选项来使其工作。

Emoji & Font-Awesome

1
2
:smile:
:fa-car:

上标

1
30^th^

下标

1
H~2~O

脚注

1
2
3
Content [^1]

[^1]: Hi! This is a footnote

标记

1
==marked==

Admonition

1
2
!!! note This is the admonition title
This is the admonition body

https://squidfunk.github.io/mkdocs-material/reference/admonitions/ 查看更多信息

数学

使用 KaTeX 来渲染数学表达式。
默认下的分隔符:

  • $…$或者 \(…\) 中的数学表达式将会在行内显示。
  • $$…$$ 或者 \[…\] 或者 ```math 中的数学表达式将会在块内显示。

图像

Markdown Preview Enhanced 内部支持 flow charts, sequence diagrams, mermaid, PlantUML, WaveDrom, GraphViz,Vega & Vega-lite,Ditaa 图像渲染。 也可以通过使用 Code Chunk 来渲染 TikZ, Python Matplotlib, Plotly 等图像。

Mermaid

Markdown Preview Enhanced 使用mermaid 来渲染流程图和时序图。

  • mermaid 代码块中的内容将会渲染mermaid 图像。
  • 查看mermaid 文档了解更多如果创建图形。

可以通过 Markdown Preview Enhanced: Open Mermaid Config 命令打开 mermaid 配置文件。

TOC

Markdown Preview Enhanced 支持你在 markdown 文件中创建 TOC。 你可以通过 cmd-shift-p 然后选择 Markdown Preview Enhanced: Create Toc 命令来创建 TOC。 多个 TOCs 可以被创建。 如果你想要在你的 TOC 中排除一个标题,请在你的标题 后面 添加 {ignore=true} 即可。
也可以通过在你的 markdown 文件中输入 [TOC] 来创建 TOC。但是,这种方式创建的 TOC 只会在预览中显示,而不会修改 markdown 文件。
可以通过编写 front-matter 来进行设置:

1
2
3
4
5
6
---
toc:
depth_from: 1
depth_to: 6
ordered: false
---

导入文件

1
@import "你的文件"

Code Chunk

幻灯片

Pandoc

文档导出

定制&扩展