第一章 块元素(Block Elements)
1.1 段落和行结束(Paragraph and line breaks)
大多数 markdown 解析器忽略单行分隔符,为了上其他 markdown 解析器识别行分隔符,可以在末尾使用两个空格,或者插入 </br>
1.2 标题(Headers)
标题有6个等级,用 # 号表示
# 标题1
## 标题2
### 标题3
#### 标题4
##### 标题5
###### 标题6
1.3 引用(Blockquotes)
使用 > 字符,表示引用
> 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.4 列表(Lists)
输入 * 将会创建一个无序列表,也可以使用 + 或者 -
* Red
* Green
* Blue
- Red
- Green
- Blue
输入 1. 将会创建有序列表
1. Red
2. Green
3. Blue
- Red
- Green
- Blue
1.5 任务列表(Task List)
用 [ ] 或者 [X] 未完成,完成)表示列表,通过点击复选框来更改状态(完成/未完成)
- [ ] 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.6 代码块(Code Blocks)
使用 ```<语言> 按回车键,将会对代码进行高亮
```ruby
require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_html
```
require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_html
1.7 数学(Math Blocks)
可以使用MathJax呈现LaTeX数学表达式。
$$
\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}
$$
V 1 × V 2 = ∣ i j