Markdown常用語法
加粗 斜體 刪除線
加一個(gè)星號(hào)或下劃線為斜體
*test* 或 _test_
效果: test
加兩個(gè)星號(hào)或下劃線為加粗
**test** 或 __test__
效果:test
加三個(gè)星號(hào)或下劃線為加粗的斜體
***test*** 或 ___test___
效果:test
加兩個(gè)波浪線為帶刪除線的文字
~~你看不見我~~
效果:你看不見我
引用
將 >
加在一段文字的開頭表示引用
> 成功就是1%的努力加上99%的不玩手機(jī)
成功就是1%的努力加上99%的不玩手機(jī)
多個(gè)>>
嵌套加在一段文字開頭表示嵌套引用
>成功就是1%的努力加上99%的不玩手機(jī)
>>這不是我說的
成功就是1%的努力加上99%的不玩手機(jī)
這不是我說的
標(biāo)題
Setext式語法: 在標(biāo)題文字下加==號(hào)或者---號(hào)表示標(biāo)題
This is H1
==========
效果如下:
This is H1
==========
和
This is H2
----------
效果如下:
This is H2
atx式語法: 在標(biāo)題文字前加上#
號(hào)表示標(biāo)題,#
號(hào)越少,標(biāo)題級(jí)別越高
# This is H1
## This is H2
### This is H3
#### This is H4
##### This is H5
###### This is H6
效果如下:
This is H1
This is H2
This is H3
This is H4
This is H5
This is H6
列表
有序列表
在行首增加 1.粱坤、2.、3.,即數(shù)字和英文句點(diǎn), 加一個(gè)空格 , 不要求數(shù)字一定要連續(xù)梯嗽,可以都是1
1. 有序列表
1. 有序列表
4. 有序列表
效果:
- 有序列表
- 有序列表
- 有序列表
無序列表
在行首增加 * 或 -
* 無序列表
* 無序列表
- 無序列表
- 無序列表
效果:
- 無序列表
- 無序列表
- 無序列表
- 無序列表
分割線
用三個(gè)及以上連在一起的星號(hào)***
或下劃線___
或短劃線---
變出一條分割線
框起來的代碼塊
在一段代碼的上一行和下一行加上```來將其框起來
int i = 0; i = 1;
for (int i = 0; i < 100; i++)
{
printf("hello markdown!\\n");
}
也可以用``將幾個(gè)單詞框起來,例如
`printf`
效果: printf
表格
用豎線|
畫簡單的表格:
------------ | ------------- | ------------
是不可缺少的
First Header | Second Header | Third Header
------------ | ------------- | ------------
Content Cell | Content Cell | Content Cell
Content Cell | Content Cell | Content Cell
First Header | Second Header | Third Header |
---|---|---|
Content Cell | Content Cell | Content Cell |
Content Cell | Content Cell | Content Cell |
或者可以在表格每行的最前和最后加豎線
| First Header | Second Header | Third Header |
| ------------ | ------------- | ------------ |
| Content Cell | Content Cell | Content Cell |
| Content Cell | Content Cell | Content Cell |
First Header | Second Header | Third Header |
---|---|---|
Content Cell | Content Cell | Content Cell |
Content Cell | Content Cell | Content Cell |
可以在單元格里用冒號(hào)規(guī)定文字在單元格里的對(duì)齊方式
First Header | Second Header | Third Header
:----------- | :-----------: | -----------:
Left | Center | Right
Left | Center | Right
First Header | Second Header | Third Header |
---|---|---|
Left | Center | Right |
Left | Center | Right |
插入鏈接
插入email鏈接
在email地址兩段加上<
和>
表示. 例
<example@example.com>
效果
example@example.com
插入鏈接
<http://www.直接插入鏈接.com>
[有文字描述的鏈接](鏈接地址)
效果:
有文字描述的鏈接
或者可以用字符串代替實(shí)際鏈接,稍后再定義此字符串,如插入鏈接:
[有文字描述的鏈接](id)
效果: 鏈接
然后在文檔的任意其他地方定義id:
[id]: http:www.example.com
插入圖片

效果:

圖片實(shí)際地址也可以用字符串代替并稍后定義.
角標(biāo)
角標(biāo)由兩部分組成,一個(gè)數(shù)字編號(hào)角標(biāo)和角標(biāo)的定義.
這句話有一個(gè)角標(biāo).[^1]
[^1]: 害羞的角標(biāo)
(簡書不支持角標(biāo)語法)
以上語法就很全面啦, 有需求的可以再學(xué)習(xí)流程圖, 時(shí)序圖,Mathjax 數(shù)學(xué)公式等語法.
Enjoy Markdown!