最近发现markdown这个东西对于我记录博客来说简直太方便了,因为不想用鼠标点来 点去,又想控制好格式,这个东西简直好的不要不要的,尤其是我记录一些平时写程序所遇到的问题,格式不需要太复杂,完全满足了我的需求,下面的有些东西是我从其他简书上抄过来的,目的是给自己做一个备份,在最近一个月要不断的使用这些快捷操作方式,以达到 熟练掌握的目的,同时写这篇文章的目的也是为了增强自己的熟练度,闲话不多说那就开始记录每个操作方式。
标题类的操作
要输入标题类的操作,只需要在希望的标题文字前加入#号即可表示标题,#号的个数代表了标题的级别,#号越多级别越小,如下所示:
# 一级标题
## 二级标题
### 三级标题
一级标题
二级标题
三级标题
序号类的操作
无序序列:在需要表现序列的前方加入*或者-
和空格
就会有一个无序序列的开头
* 列表1
* 列表2
* 列表3
- 列表1
- 列表2
- 列表3
有序序列:在需要加入有序序列的后方前方加入.
并和序号后的内容保持一个空格
的距离
1. 列表1
2. 列表2
3. 列表3
- 列表1
- 列表2
- 列表3
引用操作
引用操作采用>
来表示引用的文字,二级引用采用>>
符号来表示引用中的引用,注意符号与引用文字之间要使用空格
>这是一段引用的文字
>>这是上一段文字中的引用中的引用
这是一段引用的文字
这是上一段文字中的引用中的引用
在文章中插入超链接和图片
在文章中插入超链接采用[文字](超链接地址)
的形式插入
[简书](http://www.jianshu.com/)
在文章中插入图片则与超链接只差一个!形式为![文字](图片地址)
,简书支持直接拖拽你喜欢的图片到文章中,会自动变成markdown格式,如果要引用其他地址的图片,最好统一上传到云端,然后再输入链接地址(本次采用七牛云存储上传的图片)。
![海贼王索隆](http://ofya1ory3.bkt.clouddn.com/%E7%B4%A2%E9%9A%86.jpg)
海贼王索隆
粗体、斜体、删除文字的操作
斜体采用一个*
包裹住文字粗体采用两个*
号包裹住文字,文字删除线采用两个~包裹住
**这里面的文字都是粗体的**
这里面的文字都是粗体的
*这里面的文字都是斜体的*
这里面的文字都是斜体的
~~这里面的文字带删除线~~
这里面的文字带删除线
在文档中插入表格,无法用语言来形容,我觉得一个demo比什么都合适
header1| header2 | header3 |header4
------------- |-------------| -----|-----
内容1| 内容2|内容3|内容4
内容1| 内容2|内容3|内容4
内容1| 内容2|内容3|内容4
header1 | header2 | header3 | header4 |
---|---|---|---|
内容1 | 内容2 | 内容3 | 内容4 |
内容1 | 内容2 | 内容3 | 内容4 |
内容1 | 内容2 | 内容3 | 内容4 |
插入代码行
文档中插入代码,这个是程序员经常遇到的,插入单行代码采用单个`
包裹住要插入的代码行,如果要插入多行代码,则采用三个`
包裹住要插入的代码,同时在第一组反引号后注明所要插入代码的类型
插入一段linux的命令行
`sudo apt-get update`
sudo apt-get update
插入一段python代码
```python
from pylab import figure, subplot, hist, xlim, show
xmin = min(data[:,0])
xmax = max(data[:,0])
figure()
subplot(411) # distribution of the setosa class (1st, on the top)
hist(data[target=='setosa',0],color='b',alpha=.7)
xlim(xmin,xmax)
subplot(412) # distribution of the versicolor class (2nd)
hist(data[target=='versicolor',0],color='r',alpha=.7)
xlim(xmin,xmax)
subplot(413) # distribution of the virginica class (3rd)
hist(data[target=='virginica',0],color='g',alpha=.7)
xlim(xmin,xmax)
subplot(414) # global histogram (4th, on the bottom)
hist(data[:,0],color='y',alpha=.7)
xlim(xmin,xmax)
show()
from pylab import figure, subplot, hist, xlim, show
xmin = min(data[:,0])
xmax = max(data[:,0])
figure()
subplot(411) # distribution of the setosa class (1st, on the top)
hist(data[target=='setosa',0],color='b',alpha=.7)
xlim(xmin,xmax)
subplot(412) # distribution of the versicolor class (2nd)
hist(data[target=='versicolor',0],color='r',alpha=.7)
xlim(xmin,xmax)
subplot(413) # distribution of the virginica class (3rd)
hist(data[target=='virginica',0],color='g',alpha=.7)
xlim(xmin,xmax)
subplot(414) # global histogram (4th, on the bottom)
hist(data[:,0],color='y',alpha=.7)
xlim(xmin,xmax)
show()
网友评论