# Markdown 基本语法
基本语法是一般的 Markdown 解析库都支持的语法
# 标题
使用#
符号标记一个标题,有几个#
号就表示几级标题,最多支持 6 级标题
### Heading level 3
#### Heading level 4
##### Heading level 5
###### Heading level 6
预览效果
# Heading level 3
# Heading level 4
# Heading level 5
# Heading level 6
# 引用
使用>
符号标记一段引用
> Dorothy followed her through many of the beautiful rooms in her castle.
Dorothy followed her through many of the beautiful rooms in her castle
# 强调
使用*
包裹一段文字,使其变成斜体
Italicized text is the _cat’s meow_.
预览效果
Italicized text is the cat's meow.
使用**
包裹一段文字,使其变成粗体
I just love **bold text**.
预览效果
I just love bold text.
# 列表
无序列表
使用-
符号标记一个列表项,使用缩进来表示层级关系
- First item
- Second item
- Third item
- Fourth item
预览效果
- First item
- Second item
- Third item
- Fourth item
有序列表
使用数字加.
符号标记一个列表项,使用缩进来表示层级关系
1. First item
2. Second item
3. Third item
4. Fourth item
预览效果
- First item
- Second item
- Third item
- Fourth item
# 分割线
使用---
符号,来表示一个分割线
---
预览效果
# 链接
使用[]()
来表示一个链接,前面填写链接显示的文字,后面填写链接的地址
[百度一下](https://www.baidu.com)。
# 图片
使用![]()
来表示一个链接,前面填写图片的替代文本,后面填写图片的地址

渲染效果如下:
注意
上面为 Markdown 原始的的基本语法,具备最基本的文档功能,在一般的编辑器还能够支持以下功能,这也是我们常用的,因此我也将其放入到基本语法中
# 视频
文字和图片,还好说,视频就有点难办了,不过在一般的 Markdown 解析器中都支持直接插入 HTML 的,因此我们可以直接书写html
标签,使用 video 标签或者 iframe 标签,下面介绍 iframe 标签来嵌入第三方网页;
出于安全原因,并非所有 Markdown 应用程序都支持在 Markdown 文档中添加 HTML。
以哔哩哔哩为例,我们可以在视频下方,找到"分享">"嵌入代码",复制这里的代码,粘贴到我们的 Markdown 中即可
<iframe
src="//player.bilibili.com/player.html?aid=35265997&bvid=BV12b411w78Y&cid=61801377&page=1"
scrolling="no"
border="0"
frameborder="no"
framespacing="0"
allowfullscreen="no"
width="640"
height="480"
></iframe>
预览效果
# 代码块
使用两个```来表示中间的内容是一段代码,使用语言的名称比如 c 来标注代码类型,可使得代码具有高亮的效果
一般来说高亮需要插件支持,比如使用 highlight.js,一般的 Markdown 编辑器会集成此功能
```c printf("hello world"); ```
# 表格
表格则需要按照下面的这个规则来书写
| Syntax | Description |
| --------- | ----------- |
| Header | Title |
| Paragraph | Text |
Syntax | Description |
---|---|
Header | Title |
Paragraph | Text |
# 总结
语义 | 标记符 |
---|---|
标题 | # |
引用 | > |
斜体 | * |
粗体 | ** |
列表 | - 注意和文字用空格隔开 |
分割线 | --- |
链接 | []() |
图片 | ![]() |
代码 | ``` |