Markdown语法


区块元素


段落和换行

'
'


标题

行首插入 1 到 6 个 #,对应到标题 1 到 6 阶

#标题
##标题
。。。。。。

区块引用 Blockquotes

Markdown 标记区块引用是使用类似 email 中用 > 的引用方式。

> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.

区块引用可以嵌套(例如:引用内的引用),只要根据层次加上不同数量的 >:

> This is the first level of quoting.
>
> > This is nested blockquote.
>
> Back to the first level.

引用的区块内也可以使用其他的 Markdown 语法,包括标题、列表、代码区块等:

> ## 这是一个标题。
> 
> 1. 这是第一行列表项。
> 2. 这是第二行列表项。
> 
> 给出一些例子代码:
>
 > return shell_exec("echo $input | $markdown_script");

列表

无序列表使用星号、加号或是减号作为列表标记:

* Red
* Green
* Blue
或者
+ Red
+ Green
+ Blue
或者
- Red
- Green
- Blue

有序列表则使用数字接着一个英文句点:


1. Bird
2. McHale
3. Parish

要让列表看起来更漂亮,你可以加个*在内容前面,把内容用固定的缩进整理好:

* Lorem ipsum dolor sit amet, consectetuer adipiscing elit.Aliquam 
hendreritmi posuere lectus. Vestibulum enim wisi,viverra nec, fringilla in, 
laoreet vitae, risus.* Donec sit amet nisl. Aliquam semper ipsum sit 
amet velit.Suspendisse id sem consectetuer libero luctus adipiscing.

代码区块

<pre><code>
      /**代码块**/
</pre></code>

分隔线

你可以在一行中用三个以上的星号、减号、底线来建立一个分隔线,行内不能有其他东西。你也可以在星号或是减号中间插入空格。

***
---

区段元素

链接

链接网址可以用方括号包起来:

[id]: <http://example.com/>

下面是一个参考式链接的范例:

I get 10 times more traffic from [Google][] than from[Yahoo][] or [MSN][]. 
[google]: http://google.com/ "Google" 
[yahoo]: http://search.yahoo.com/ "Yahoo Search" 
[msn]: http://search.msn.com/ "MSN Search"

强调

Markdown 使用星号(*)和底线()作为标记强调字词的符号,被 * 或 _
包围的字词会被转成用 <em>标签包围,用两个 *或
包起来的话,则会被转成 <strong>,例如:

*single asterisks*
_single underscores_
**double asterisks**
__double underscores__

如果要在文字前后直接插入普通的星号或底线,你可以用反斜线:

\*this text is surrounded by literal asterisks\*

代码

如果要标记一小段行内代码,你可以用反引号把它包起来(`),例如:

Use the `printf()` function.

如果要在代码区段内插入反引号,你可以用多个反引号来开启和结束代码区段:

``There is a literal backtick (`) here.``

图片

行内式的图片语法:

![Alt text](/path/to/img.jpg)

加空格

   &nbsp;


表格

| 1| 2|
| ------------- |:-------------:|
| 1.1 |2.1 |
|1.2| 2.2 |
| 1.3 |2.3 | 

1 2
1.1 2.1
1.2 2.2
1.3 2.3

参考http://www.appinn.com/markdown/#hr

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • << 访问 Wow!Ubuntu NOTE: This is Simplelified Chinese Edit...
    fisher爱吃鱼阅读 11,653评论 0 71
  • Markdown 语法说明 (简体中文版) 概述宗旨兼容 HTML特殊字符自动转换 区块元素段落和换行标题区块引用...
    蚊子Skeeter阅读 8,394评论 3 12
  • Markdown 语法说明 概述宗旨兼容 HTML特殊字符自动转换 区块元素段落和换行标题区块引用列表代码区块分隔...
    Clunt阅读 4,235评论 0 4
  • 上课总结:从机器语言(010101010)->汇编语言(add 1,2)有意义的英文单词--->结构化->面向对象...
    程序员有话说阅读 4,553评论 1 1
  • 声明: 这份文档派生(fork)于繁体中文版,在此基础上进行了繁体转简体工作,并进行了适当的润色。此文档用 Mar...
    Cellei阅读 10,095评论 0 21