1. 区块元素
1.1. 标题
1.1.1. 类Setext形式
使用方式
使用底线的形式,用 = 和 - 表示一二阶标题,如:
This is an H1
===
This is an H2
---
(= 和 - 的个数没有限制)
效果:
This is an H1
This is an H2
1.1.2 类Atx形式
使用方式
在行首插入1~6个#,对应标题1到6阶,注意#后应保持一个空格
# H1
## H2
### H3
#### H4
##### H5
###### H6
效果:
H1
H2
H3
H4
H5
H6
1.2. 区块
使用方式
在行首插入>表示区块引用,注意>后应保持一个空格,如:
> This is an Blockquotes,
> this is an another Blockquotes.
或者只在整个段落的第一行最前面加入>,如:
>This is an Blockquotes,
>this is an another Blockquotes.
当然,>也可嵌套使用,不过很少看到如此使用的= =,如:
> This is an Blockquotes,
>>This is an inner Blockquotes.
效果:
This is an Blockquotes,
this is an another Blockquotes.
嵌套使用:
This is an Blockquotes,This is an inner Blockquotes.
1.3. 列表
1.3.1. 有序列表
使用方式
使用数字后接一个英文句点(英文句点后保持一个空格),如:
1. item1
2. item2
3. item3
注意:目前只有第一个序号会影响从几号开始,其余数字不影响序号,无需考虑数字的正确性,如:
2. item1
9. item2
10. item3
列表项目标记后面接1~3个空格,同时也支持一个项目下多个段落,此时每个项目下的段落必须缩进4个空格,如:
1. This is a list item with two paragraphs. Lorem ipsum dolor
sit amet, consectetuer adipiscing elit. Aliquam hendrerit
mi posuere lectus.
Vestibulum enim wisi, viverra nec, fringilla in, laoreet
vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
sit amet velit.
2. Suspendisse id sem consectetuer libero luctus adipiscing.
也可以插入引用(4个空格+>)或者代码块(8个空格),可简单记为:4个空格额外加上正常的使用方式。
效果:
- item1
- item2
- item3
- item1
- item2
- item3
-
This is a list item with two paragraphs. Lorem ipsum dolor
sit amet, consectetuer adipiscing elit. Aliquam hendrerit
mi posuere lectus.Vestibulum enim wisi, viverra nec, fringilla in, laoreet
vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.
-
This is a list item with two paragraphs. Lorem ipsum dolor
sit amet, consectetuer adipiscing elit. Aliquam hendrerit
mi posuere lectus.Vestibulum enim wisi, viverra nec, fringilla in, laoreet
vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.
1.3.2. 无序列表
使用方式
使用*、+、-作为列表标记,其结果相同,如:
* Item1
* Item2
* Item3
+ Item1
+ Item2
+ Item3
- Item1
- Item2
- Item3
效果:
- Item1
- Item2
- Item3
1.4. 代码区块
使用方式
缩进4个空格,代码区块会一直持续到没有所进的那一行,或者文件结尾,如:
Here is an example of Script:
printf("Hello world");
或者使用封闭的``` ```生成代码块
效果:
1.5. 分割线
使用方式
在一行中用三个以上的*,-,-来建立一个分割线,行内无其他东西。符号间允许空格出现,如
***
* * *
---
- - -
效果:
2. 区段元素
2.1. 链接
2.1.1 行内式链接
使用方式
连接文字使用[]来标记,在[]后面紧接着()并插入网址链接,同时可通过在网址后面用"title"方式来加入标题,如:
This is [baidu](http://www.baidu.com/ "百度") in link.
同时可以通过相对路径来连接到同样主机的资源,如:
See my [About](/about/) page for details.
效果
This is baidu in link.
See my About page for details.
2.1.2 参考式链接
使用方式
在链接文字的()后面在街上另一个[],而在第二个[]里面填入用以辨识链接的标记:
This is [百度] [id] reference-style link.
接着在文件的任意处,把这个标记的链接内容定义出来:
[id]: http://www.baidu.com "百度"
链接内容定义的格式如下:
1. [连接文字](前面至多加入3个空格)
2. :冒号
3. 一个以上的空格
4. 链接的网址(可选择是否用<>包起来)
5. 选择性的接着title内容,“title”或‘title’或(title)
注意:链接辨识标签不区分大小写
另外,在第二个[]为空时,这种情形下,链接标记会等同于链接文字,如
[baidu] []
[baidu]: http://www.baidu.com/
效果
This is 百度 reference-style link.
2.2. 强调
使用方式
使用封闭的*或者_作为强调字词的符号,使用封闭的~~加入删除线,如:
*倾斜*
_倾斜_
**加粗**
__加粗__
***倾斜+加粗***
___倾斜+加粗___
~~删除线~~
注意:如果要输入普通的*号,则需要输入\*
效果
倾斜
倾斜
加粗
加粗
倾斜+加粗
倾斜+加粗
删除线
2.3. 代码
使用方式
标记一小段行内代码:
用封闭的反引号`some code`,如:
Use the `printf()` function
在代码区段中插入反引号,用多个反引号来开启和结束代码区段,如:
``There is a literal backtick (`) here.``
效果
Use the printf
function
There is a literal backtick (`) here.
2.4. 图片
2.4.1 行内式
使用方式
行内式的图片语法看起来类似于:
![Alt text](/path/to/img.jpg)
![Alt text](/path/to/img.jpg "Optional title")
详细描述:
![图片的替代文字](图片网址 “Optional title”)
2.4.2 参考式
使用方式
参考式的图片语法:
![Alt text][id]
[id]: url/to/image "optional title attribute"
详细描述:
![图片的替代文字][id]
[id]: 图片网址 "Optional title attribute"
3. 其他
3.1. 反斜杠
使用方式
Markdown利用反斜杠\来帮助插入普通的符号
\ 反斜线
` 反引号
* 星号
_ 底线
{} 花括号
[] 方括号
() 括弧
# 井字号
+ 加号
- 减号
. 英文句点
! 惊叹号
3.2. 自动链接
使用方式
Markdown支持以比较简短的自动链接形式来处理网址和电子邮件信箱,用封闭的<>包起来,如:
<http://www.baidu.com>
效果
3.3. 表格
使用方式
注: : 代表对齐方式 ,** : 与 | 之间不要有空格**,否则对齐会有些不兼容
| a | b | c |
|:-------:|:------------- | ----------:|
| 居中 | 左对齐 | 右对齐 |
|=========|===============|============|
或者简约写法
a | b | c
:-:|:- |-:
居中 | 左对齐 | 右对齐
============|=================|=============
效果
a | b | c |
---|---|---|
居中 | 左对齐 | 右对齐 |
============ | ============ | ============ |
3.4 注释
使用方式
Android[^1]
[^1]: Android是Google开源的手机操作系统
注意:文章最后面显示注释
效果
Markdown[1]
3.5 流程图、时序图、侧边栏、导航
对于图而言,莫不如采用visio(win)工具
而侧边栏和导航等,需要采用模板,原生貌似不支持,因此也不多做说明。需要的可自行百度。
END
-
Android是Google开源的手机操作系统 ↩