之前寫文章都是使用的編輯富文本方式悠轩,圖片和代碼直接添加進(jìn)文章间狂,很直接,但不是很高效火架,偶然發(fā)現(xiàn)Markdown編輯器鉴象,發(fā)現(xiàn)果然好用忙菠,語法也簡單,在這里寫下其常用語法纺弊。
簡單起見只搁,上面寫Markdown語法,下面顯示其效果俭尖。
標(biāo)題
#這是一個(gè)一級(jí)標(biāo)題
##這是一個(gè)二級(jí)標(biāo)題
###這是一個(gè)三級(jí)標(biāo)題
這是一個(gè)一級(jí)標(biāo)題
這是一個(gè)二級(jí)標(biāo)題
這是一個(gè)三級(jí)標(biāo)題
無序列表
* 條目
* 條目
* 條目
- 條目
- 條目
- 條目
有序列表
1. 條目一
2. 條目二
3. 條目三
- 條目一
- 條目二
- 條目三
引用
>這里是引用
這里是引用
鏈接
[點(diǎn)擊這里跳轉(zhuǎn)到百度](http://www.baidu.com)
點(diǎn)擊這里跳轉(zhuǎn)到百度
圖片
![這是一張圖片,這里寫圖片描述](https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo/bd_logo1_31bdc765.png)
![這是一張圖片洞翩,這里寫圖片描述](https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo/bd_logo1_31bdc765.png)
粗體
**粗體**
粗體
斜體
*斜體*
斜體
表格
| 姓名 | 性別 | 年齡 |
| --- |:------:| -----:|
|小明 | 男 | 12|
| 小紅| 男 | 12|
| 小張| 男 | 12|
表格上方需空一行
姓名 | 性別 | 年齡 |
---|---|---|
小明 | 男 | 12 |
小紅 | 男 | 12 |
小張 | 男 | 12 |
代碼
使用"`"符號(hào)把代碼包裹起來就是下面的效果
`func setUI() {
baseView = UIView.init(frame: CGRect.init(x: 0, y: 0, width: radius, height: radius))
baseView.center = self.view.center
self.view.addSubview(baseView)
let center = CGPoint.init(x: radius/2, y: radius/2)
var index = 0.0
for _ in 0...9 {
let color = UIColor.randomColor().cgColor
let nextIndex = index + 1
let aPath = UIBezierPath.init(arcCenter: center, radius: CGFloat(radius), startAngle: CGFloat(M_PI * index / 5), endAngle: CGFloat(M_PI * nextIndex / 5), clockwise: true)
aPath.addLine(to: center)
index = nextIndex
let tempLayer = CAShapeLayer.init()
tempLayer.path = aPath.cgPath
tempLayer.fillColor = color
tempLayer.strokeColor = UIColor.white.cgColor
tempLayer.lineWidth = 3
baseView.layer.addSublayer(tempLayer)
}
self.view.layer.setNeedsDisplay()
}`