markdown入门和进阶
编辑器
由于使用sublime,因此博主使用的是sublime的插件ominiMarkupPreviewer进行编辑
在线
本地
常用语法速查
标题 (Headings)
1
2
3# 这是 H1 <一级标题>
## 这是 H2 <二级标题>
###### 这是 H6 <六级标题>文字格式 (Styling text)
1
2
3
4**这是文字粗体格式**
*这是文字斜体格式*
_这是文字粗斜体格式_
~~在文字上添加删除线~~这是文字粗体格式
这是文字斜体格式
这是文字粗斜体格式
在文字上添加删除线列表 (List)
无序列表
1
2
3* 项目1
* 项目2
* 项目3有序列表
1
2
3
4
51. 项目1
2. 项目2
3. 项目3
* 项目1
* 项目2
引用 (Blockquotes)
1
2
3
4#可以不用每行都写一个
> Pardon my french
#可以嵌套
>> asdfasdfPardon my french
Echo1 Hereasdfasdf
段落缩进
1
2
3 或 半方大的空白
 或 全方大的空白
不断行的空白格 或 不断行的空白格段落:半方大的空白
段落:全方大的空白
不断行的空白格 不断行的空白格github特有的markdown格式
https://guides.github.com/features/mastering-markdown/
https://help.github.com/articles/github-flavored-markdown
https://help.github.com/articles/writing-on-github
比如 emoji: :sparkles: :camel: :boom:- [x] This is a complete item
- [ ] This is an incomplete item
hexo中使用emoji1
2
3
4
5{% emoji heart 32 custom_class1,custom_class2 %}
{% emoji-block %}
Lorem ipsum dolor sit amet :smiley:
consectetur adipisicing elit :boom:
{% endemoji-block %}
图像
1


图片居中
1
2
3#上面加一个
<div style="text-align:center" markdown="1">


如果拷贝了别人的图片插入到自己的博客中,最好在图片上给出一个超链接指向源头,方便追溯出处。
1
[](http://blog.leanote.com/post/freewalk/Markdown-语法手册)
链接
自动式
1
<http://example.com/>
行内式
1
[Display_Text](http://example.com/ "http://example.com/")
参考式
1
2我经常去的几个网站[Leanote][1]
[Leanote 笔记][1]锚点
用普通的html1
<a href="#end">bookmark_text</a>
效果: bookmark_text
注脚 1
1
2
3
4
5
6注脚与注脚之间必须空一行,不然会失效
使用 Markdown[^1]可以效率的书写文档, 直接转换成 HTML[^2], 你可以使用 Leanote[^Le] 编辑器进行书写。
被添加脚注的词条后面会出现一个超链接数字(有的渲染为上标格式),点击数字跳转到文末 glossary 区域该脚注的定义处。文末 glossary 区域该脚注定义的行尾会添加一个回车符号(↵),点击可回到被标注的脚注点。
测试 Hexo3.0 有些主题不支持footnote, 可以参考<http://nsfw.hjwu.me/2014-07-07/hexo-plugin-for-parse-footnotes/>嵌入代码
单行的时候用 `asdf`
多行的时候用```
aaaaaa
```比如
1
Here's an idea: why don't we take `SuperiorProject` and turn it into `**Reasonable**Project`.
Here’s an idea: why don’t we take
SuperiorProjectand turn it into**Reasonable**Project.嵌入代码里面用反引号怎么办? 参考这里
1
2
3
4
5
6
7A single backtick in a code span: `` ` ``
A backtick-delimited string in a code span: `` `foo` ``
`—` is the decimal-encoded equivalent of `—`.
``git archive master --format=zip > `git describe master`.zip``会得到:
A single backtick in a code span:`
A backtick-delimited string in a code span:`foo`—is the decimal-encoded equivalent of—.git archive master --format=zip > `git describe master`.zip标准 Markdown 不支持脚标, 只能通过内嵌 HTML 的
<sup>和<sub>标签来实现
比如H<sub>2</sub>O将生成 H2O可以直接在反引号里面写html代码
1
2
3
4
5
6
7
8
9
10
11
12
13<table>
<tr>
<th rowspan="2">值班人员</th>
<th>星期一</th>
<th>星期二</th>
<th>星期三</th>
</tr>
<tr>
<td>李强</td>
<td>张明</td>
<td>王平</td>
</tr>
</table>表格
1
2
3
4
5
6
7
8
9
10|产品|价格|
|---|--:|
|Leanote 高级账号|60元/年|
|Leanote 超级账号|120元/年 `print("Format with CodeRay")`|
|学号|姓名|分数|
|------|-----|---------|
|小明|男|75|
|小红|女|79|
|小陆|男|92|分割线
1
2
3
4
5* * *
***
*****
- - -
---------------------------------------LaTex公式
$ 表示行内公式:
1
质能守恒方程可以用一个很简洁的方程式 $E=mc^2$ 来表达。
质能守恒方程可以用一个很简洁的方程式 $E=mc^2$ 来表达。
$$ 表示整行公式:每个公式要隔一行
1
2
3$$\sum_{i=1}^n a_i=0$$
$$f(x_1,x_x,\ldots,x_n) = x_1^2 + x_2^2 + \cdots + x_n^2 $$
$$\sum^{j-1}_{k=0}{\widehat{\gamma}_{kj} z_k}$$ #测试不成功$$\sum_{i=1}^n a_i=0$$
$$f(x_1,x_x,\ldots,x_n) = x_1^2 + x_2^2 + \cdots + x_n^2 $$
$$ {\gamma} $$
流程图 更多
1
2
3
4
5
6
7
8
9
10flow
st=>start: Start:>https://www.zybuluo.com
io=>inputoutput: verification
op=>operation: Your Operation
cond=>condition: Yes or No?
sub=>subroutine: Your Subroutine
e=>end
st->io->op->cond
cond(yes)->e
cond(no)->sub->io其他
[TOC] [图标](http://fortawesome.github.io/Font-Awesome/3.2.1/icons/ "http://fortawesome.github.io/Font-Awesome/3.2.1/icons/")
The end!
参考
Markdown-语法手册
Mastering Markdown
Markdown详解
Hexo
Hexo进阶
- Footnote_Text↩

