markdown語法
1.標題
用#表示最多六級標題
寫法:
# 一級標題
## 二級標題
### 三級標題
#### 四級標題
##### 五級標題
###### 六級標題
效果:
一級標題
二級標題
三級標題
四級標題
五級標題
六級標題
2.加粗,斜體
*傾斜部分*
_傾斜部分_
**加粗部分**
__加粗部分__
***傾斜粗體***
___傾斜粗體___
效果:
傾斜部分
傾斜部分
加粗部分
加粗部分
傾斜粗體
傾斜粗體
3.列表
3.1無序列表
使用符號*、-和+進行無序列表的創建,形式爲符號後加空格加內容
* 列表1
* 列表2
* 列表3
+ 列表4
+ 列表5
+ 列表6
- 列表7
- 列表8
- 列表9
效果:
-
列表1
-
列表2
-
列表3
-
列表4
-
列表5
-
列表6
-
列表7
-
列表8
-
列表9
3.2有序列表
利用數字加英文的**.**實現,輸入後會自動縮進
1. 列表1
2. 列表2
3. 列表3
效果:
- 列表1
- 列表2
- 列表3
4.段落
5.插入圖片
方框內爲:Alt text,代表圖片的Alt標籤,用來描述圖片的關鍵詞,可以不寫。最初的本意是當圖片因爲某種原因不能被顯示時而出現的替代文字,後來又被用於SEO,可以方便搜索引擎根據Alt text裏面的關鍵詞搜索到圖片。
5.1插入網絡圖片
沒有自己的服務器存儲圖片的可以利用github平臺進行圖片的插入,比如:
![Alt text](圖片鏈接)
效果:
![](https://github.com/yxxupup/picture/blob/master/1488771180506677.jpeg)
5.2插入本地圖片
相對路徑:圖片與md文件處於同一個文件夾中,則框中可直接寫爲
![](***.png)
絕對路徑:照片在本地的路徑
![](\user\***.png)
5.3插入圖片編碼
把圖片轉化爲字符串,插入到文檔中,放在()中的鏈接位置。
![avatar](data:image/png;base64,iVBORw0…)
base64編碼非常長,影響整個源代碼的閱讀體驗。
簡易方法:
中間調用: ![avatar][base64str]
文章末尾存放base64編碼: [base64str]:data:image/png;base64,iVBORw0…`
如何獲取base64編碼:
利用Python的base64庫:
import base64
f = open('***.png','rb') #二進制方式打開圖文件
ls_f = base64.b64encode(f.read()) #讀取文件內容,轉換爲base64編碼
f.close()
print(ls_f)
6.引用
利用>符號實現引用:
在使用時換行後會自動添加引用標號
>引用1
>引用2
>引用3
效果:
引用1
引用2
引用3
引用線後面的enter鍵可以消除一級引用
cacacaw
引用中可以正常使用其他語法
7.分割線
代碼塊中是語法,下面是效果
***
---
+++
+++
8.勾選
-空格[空格]空格
-空格[x]空格
- [ ]
- [x]
9.自動鏈接
[名字](網址)
[SLEEPYHEAD's Blog](https://yxxupup.github.io/)
10.表格
語法:
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 |
11.流程圖
基礎示例:
```mermaid
flowchat
flow
st=>start: Start
op=>operation: Your Operation
cond=>condition: Yes or No?
e=>end
st->op->cond
cond(yes)->e
cond(no)->op
```
基本結構:
tag(用於下面連接時簡寫)=>type:空格 顯示的內容:>url
選擇語句:
tag=>condition: 條件1 or 條件2?
type有以下幾類:
標籤有6種類型:start
end
operation
subroutine
condition
inputoutput
連接部分:
tag1->tag2