目录
输入[TOC]
就能获得目录
[TOC]
额,这个目录没有生成,在haroopad是会有的。。可能博客园不支持吧
特殊字符自动转换
HTML中,© 可以写成©
也可以直接输 ©
HTML中 < 和 & 都要转码 但markdown不必,输入&
和&
都显示&
,<
也一样
4 < 5 输<
后面最好加个空格,否则会当起始标签使用
4<5 输字符码<
不用考虑这个问题
段落和换行
一个 Markdown 段落的前后要有一个以上的空行。普通段落不该用空格或制表符来缩进。如果想在段前加缩进 
是一个中文字符 
是半个中文字符
是1/4中文字符
标题有两种形式
1.用=或者-表示两阶标题,符号数量建议3个以上,紧挨着显示的标题下一行输入
第一阶标题
=======
第二阶标题显示效果有下划线
---
2.开头用#的数量表示1-6阶的标题,结尾可以以任意数量#结尾(包括0个)
#第一阶标题
##第二阶标题显示效果有下划线
区块引用
在每行前面使用> 或者只在段落中第一行前加>
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
效果:
This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
区块引用也可以嵌套,在嵌套的地方加多个>>就好
这里空行可以不加 > 只要前后段落没有其他不加>的段落就不影响效果,自己可以试试
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
>> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
效果
This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
代码区块
开头加4个空格或一个tab即可,markdown会在生成的html代码包上 pre code 标签
这是代码区块
一个代码区块会一直持续到没有缩进的那一行(或是文件结尾)。
<div class="footer">
© 2004 Foo Corporation
</div>
代码区块中的&
和<
,>
符号会自动转成html应该显示的代码,输&
就会转换成&
,显示为&
,也就是输什么显示什么。
分割线
可以在一行用3个以上的*
,-
,_
来建立一条分割线,行内除了空格不能有其他东西,当然三条线效果是不同的,按顺序是很明显,不明显,一般。第二种不仔细看真看不到有线,我是换了暗色主题才看清。
强调
两端各用一个*
或者_
包起来是斜体,各用两个包起来是粗体:
*single asterisks*
__single underscores__
single asterisks
single underscores
如果符号两边都是空白,没有紧贴着文字,将会当普通符号。
如果就是要输出符号则要反斜杠\*
或者\_
删除线
文本两端加上两个~~
即可
~~删除我~~
删除我
代码
要标记一小段行内代码,用反引号包起来`
Use the `printf()` function.
Use the printf()
function.
如果要在代码区段内插入反引号,你可以用多个反引号来开启和结束代码区段
像这样输入
``There is a literal backtick (`) here.``
效果为 There is a literal backtick (`) here.
代码区段起始前和结束后都可以放一个空格,方便代码段隔开
比如可以输入
`` `foo` ``
就显示为
`foo`
代码内可以直接放入 <
>
&
符号
表格
表头1 | 表头2
------------- | -------------
Content Cell | Content Cell
Content Cell | Content Cell
| 表头1 | 表头2|
| ------------- | ------------- |
| Content Cell | Content Cell |
| Content Cell | Content Cell |
| 名字 | 描述 |
| ------------- | ----------- |
| Help | Display the help window.|
| Close | Closes a window |
表格中也可以使用普通文本的删除线,斜体等效果
| 名字 | 描述 |
| ------------- | ----------- |
| Help | ~~Display the~~ help window.|
| Close | _Closes_ a window |
表格可以指定对齐方式
| 左对齐 | 居中 | 右对齐 |
| :------------ |:---------------:| -----:|
| col 3 is | some wordy text | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |
效果:
表头1 | 表头2 |
---|---|
Content Cell | Content Cell |
Content Cell | Content Cell |
表头1 | 表头2 |
---|---|
Content Cell | Content Cell |
Content Cell | Content Cell |
名字 | 描述 |
---|---|
Help | Display the help window. |
Close | Closes a window |
表格中也可以使用普通文本的删除线,斜体等效果
名字 | 描述 |
---|---|
Help | |
Close | Closes a window |
表格可以指定对齐方式
左对齐 | 居中 | 右对齐 |
---|---|---|
col 3 is | some wordy text | $1600 |
col 2 is | centered | $12 |
zebra stripes | are neat | $1 |
参考文章