写作从学好Markdown开始程序员修炼·Markdown

Markdown 常用语法

2016-10-24  本文已影响46人  ios_geek
## 带链接的文字
[简书](http://www.jianshu.com)

带链接的文字

简书


##带链接图片
![我的图片](http:https://img.haomeiwen.com/i700489/26af59b26fd8da32.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

带链接图片

# 一级标题
## 二级标题
### 三级标题
#### 四级标题
##### 五级标题
###### 六级标题

一级标题

二级标题

三级标题

四级标题

五级标题
六级标题

- 文本1
- 文本2
- 文本3

1. 文本1
1. 文本2
1. 文本3
  1. 文本1
  2. 文本2
  3. 文本3

文字的引用

> 一盏灯, 一片昏黄; 一简书, 一杯淡茶。 守着那一份淡定, 品读属于自己的寂寞。 保持淡定, 才能欣赏到最美丽的风景! 保持淡定, 人生从此不再寂寞。

一盏灯, 一片昏黄; 一简书, 一杯淡茶。 守着那一份淡定, 品读属于自己的寂寞。 保持淡定, 才能欣赏到最美丽的风景! 保持淡定, 人生从此不再寂寞。


*一盏灯*, 一片昏黄;**一简书**, 一杯淡茶。 守着那一份淡定, 品读属于自己的寂寞。 保持淡定, 才能欣赏到最美丽的风景! 保持淡定, 人生从此不再寂寞。

一盏灯, 一片昏黄;一简书, 一杯淡茶。 守着那一份淡定, 品读属于自己的寂寞。 保持淡定, 才能欣赏到最美丽的风景! 保持淡定, 人生从此不再寂寞。

代码引用

`hello world`

hello world

多段代码引用

```
[super layoutSubviews];    
UIViewController * vc = [self getViewController];
vc.automaticallyAdjustsScrollViewInsets = NO;
CGRect rect = self.bounds;
self.tabbar.frame = CGRectMake(0, 0, rect.size.width, topBarHeight);
self.tabbar.contentSize = CGSizeMake(_tabbarWidth, 0);
self.contentView.frame = CGRectMake(0, CGRectGetMaxY(self.tabbar.frame), rect.size.width,(self.bounds.size.height - topBarHeight));
CGFloat btnH = topBarHeight;
CGFloat btnX = topBarItemMargin;
for (int i = 0 ; i < self.titles.count; i++) {
    UIButton * btn = self.tabbar.subviews[i];
    btn.frame = CGRectMake(btnX, 0, btn.frame.size.width, btnH);
    btnX += btn.frame.size.width + topBarItemMargin;
}
[self itemSelectedIndex:0];

[super layoutSubviews];    
UIViewController * vc = [self getViewController];
vc.automaticallyAdjustsScrollViewInsets = NO;
CGRect rect = self.bounds;
self.tabbar.frame = CGRectMake(0, 0, rect.size.width, topBarHeight);
self.tabbar.contentSize = CGSizeMake(_tabbarWidth, 0);
self.contentView.frame = CGRectMake(0, CGRectGetMaxY(self.tabbar.frame), rect.size.width,(self.bounds.size.height - topBarHeight));
CGFloat btnH = topBarHeight;
CGFloat btnX = topBarItemMargin;
for (int i = 0 ; i < self.titles.count; i++) {
    UIButton * btn = self.tabbar.subviews[i];
    btn.frame = CGRectMake(btnX, 0, btn.frame.size.width, btnH);
    btnX += btn.frame.size.width + topBarItemMargin;
}
[self itemSelectedIndex:0];
## 表格
>     |Tables | Are | Cool |
>     | ------------- |:-------------:| -----:|
>     | col 3 is | right-aligned | $1600 |
>     | col 2 is | centered | $12 |
>     | zebra stripes | are neat | $1 |

|Tables | Are | Cool |
| ------------- |:-------------:| -----:|
| col 3 is | right-aligned | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |


>     dog | bird | cat
>     ----:|:------:|:----
>     foo | foo | foobar
>     bar | barbaz | baz

dog | bird | cat
----:|:------:|:----
foo | foo | foobar
bar | barbaz | baz

## 显示链接中带括号的图片
>     ![][公式]
>     [公式]: http://latex.codecogs.com/gif.latex?\prod%20\(n_{i}\)+1

![][公式]
[公式]: http://latex.codecogs.com/gif.latex?\prod%20\(n_{i}\)+1


[Ps:Markdown 语法说明 (简体中文版) ](http://wowubuntu.com/markdown/)
上一篇 下一篇

猜你喜欢

热点阅读