Markdown常用语法

第一章 块元素

1.1标题

标题有6个等级,用#号表示

1
2
3
4
5
6
7
# 标题1
## 标题2
## 标题2
### 标题2
#### 标题4
##### 标题5
###### 标题6

1.2引用

使用>字符,表示引用

1
2
3
> This is a blockquote with two paragraphs. This is first paragraph.
> This is second pragraph.Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
> This is another blockquote with one paragraph. There is three empty line to seperate two blockquote.

This is a blockquote with two paragraphs. This is first paragraph.
This is second pragraph.Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
This is another blockquote with one paragraph. There is three empty line to seperate two blockquote.

1.3列表

1
2
* red
* blue
  • red
  • blue
1
2
1. red
2. blue
  1. red
  2. blue

1.4任务列表

用 [ ] 或者 [X] 未完成,完成)表示列表,通过点击复选框来更改状态(完成/未完成)

1
2
3
4
5
- [ ] a task list item
- [ ] list syntax required
- [ ] normal **formatting**, @mentions, #1234 refs
- [ ] incomplete
- [x] completed
  • a task list item
  • list syntax required
  • normal formatting, @mentions, #1234 refs
  • incomplete
  • completed

1.5代码块

使用 ```<语言> 按回车键,将会对代码进行高亮

1
2
3
4
5
​```ruby
require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_html
​```
1
2
3
require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_html

###1.6数学

可以使用MathJax呈现LaTeX数学表达式

1
2
3
4
5
6
7
$$
\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix}
\mathbf{i} & \mathbf{j} & \mathbf{k} \\
\frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\
\frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \\
\end{vmatrix}
$$

$$
\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix}
\mathbf{i} & \mathbf{j} & \mathbf{k} \
\frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \
\frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \
\end{vmatrix}
$$

1.7表格

使用 | First Header | Second Header | 按回车键,将会创建2列的表格

1
2
3
4
| First Header  | Second Header |
| ------------- | ------------- |
| Content Cell | Content Cell |
| Content Cell | Content Cell |
First Header Second Header
Content Cell Content Cell
Content Cell Content Cell

还可以使用 : 号,来设置文字对齐方式

1
2
3
4
5
| Left-Aligned  | Center Aligned  | Right Aligned |
| :------------ |:---------------:| -----:|
| col 3 is | some wordy text | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |
Left-Aligned Center Aligned Right Aligned
col 3 is some wordy text $1600
col 2 is centered $12
zebra stripes are neat $1

###1.8 脚注

1
2
3
4
使用 [^footnote] 创建脚注.
You can create footnotes like this[^1].
[^1]: Here is the *text* of the **footnote**.
然后,可以把鼠标停留在脚注中,查看内容

You can create footnotes like this[^1].
[^1]: Here is the text of the footnote.

1.10横线

输入 *** 或者 — 后,按回车键


1.11目录

输入 [toc] ,按回车键

[TOC]

第二章 Span元素

2.1链接

文字描述包含在 [] 内,链接地址包含在 () 内,() 要紧接着 [] 后面

1
2
This is [an example](http://example.com/ "Title") inline link.
[This link](http://example.net/) has no title attribute.

This is an example inline link.
This link has no title attribute.

2.1.1引用链接

1
2
3
[Bing][]
And then define the link:
[Bing]: http://bing.com/

Bing
And then define the link:

2.2图片

1
2
3
在链接格式前面添加 ! ,如下

![在这里插入图片描述](http://pxebjkhug.bkt.clouddn.com/image-20190906161123468.png)

在链接格式前面添加 ! ,如下

在这里插入图片描述

###2.3 强调

对应 HTML 的 标签

1
2
*single asterisks*
_single underscores_

single asterisks

single underscores

如果像使用 * 号,在 * 号前使用 \

1
\*this text is surrounded by literal asterisks\*

*this text is surrounded by literal asterisks*

2.4加粗

1
2
**double asterisks**
__double underscores__

double asterisks
double underscores

2.5代码

在文章中现实代码,用 ` 号表示

1
Use the `printf()` function.

Use the printf() function.

2.6删除线

1
~~Mistaken text.~~

Mistaken text.

2.7下划线

1
<u>Underline</u>

Underline

###2.8Emoji 表情

用两个 : 号包含单词,或者在 编辑 -> 表情与符号 中选择

1
:happy:

:happy:

2.9高亮

这个功能默认是关闭的,如果要打开这个功能(以 Mac 版本为例),选择 Typora -> 偏好设置 -> markdown 标签,勾选高亮复选框

1
==highlight==

==highlight==

作者

布谷

发布于

2019-09-10

更新于

2019-09-12

许可协议

评论