Skip to content

markdown备忘表

概述

该markdown备忘表提供所有语法元素的快速概述,分为基本语法和扩展语法两大部分,但无法涵盖所有​​的复杂情况。

基本语法

这些是John Gruber原始设计文档中概述的元素,所有markdown应用程序都应当支持这些元素。

元素markdown语法
标题# H1
## H2
### H3
粗体**bold text**
斜体*italicized text*
块引用> blockquote
有序列表1. First item
2. Second item
3. Third item
无序列表- First item
- Second item
- Third item
代码`code`
水平线---
超链接[title](https://www.example.com)
图片![alt text](image.jpg)

扩展语法

这些元素通过添加其他功能来扩展基本语法,并非所有markdown应用程序都支持这些元素。

注意

下表里仅列出了当前支持的扩展语法。

元素markdown语法
表格| Syntax | Description |
| ----------- | ----------- |
| Header | Title |
| Paragraph | Text |
表格
-github风格对齐
| Tables           |         Are         |  Cool  |
| ------------- | ------------ | ----- |
| col 3 is          | right-aligned | $1600 |
| col 2 is          |     centered    |     $12 |
| zebra stripes |     are neat    |       $1 |
围栏代码块```
{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}
```
围栏代码块
-语法高亮
```
{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}
```
围栏代码块
-行高亮
```json
{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}
```
围栏代码块
-行号
```json
{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}
```
围栏代码块
-行聚焦
```json
{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}
```
围栏代码块
-行差异
```json
{
  "firstName": "John",
  "lastName": "Smith",
  "lastName": "Elton",
  "age": 25
}
```
围栏代码块
-行高亮错误警告
```json
{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}
```
自定义容器::: info 信息
This is an info box.
:::
自定义容器
-github风格警报
> [!NOTE]
> 强调用户在快速浏览文档时也不应忽略的重要信息。