Go Markdown Grammar Handbook

Source: Internet
Author: User

Markdown is a lightweight markup language that converts text into valid XHTML (or HTML) documents whose goal is to make it easy to read and write, and to be a writing language for the web.

Markdown Grammar is concise and easy to master, so it is an efficient and comfortable thing to write with it. We are well known and some large CMS, such as joomla!, Drupal and so can be very good support markdown. I started to touch markdown because I wrote the Readme in the GitHub project library.

Markdown does not want to replace HTML, or even close to it, it has very few grammatical types, only a small part of the HTML tag. Markdown's idea is not to make HTML documents easier to write. In my opinion, HTML is easy to write. Markdown's philosophy is that it makes it easier to read, write, and change documents. HTML is a published format, and Markdown is a form of writing. In this way, Markdown's format syntax covers only the range that plain text can cover.

Headers title:

#  H1##  H2###  H3####  H4#####  H5######  H6另外,H1和H2还能用以下方式显示:一级标题===二级标题---

Emphasis text emphasizes:

*斜体* or _强调_**加粗** or __加粗__***粗斜体*** or ___粗斜体__但是,如果你的 * 和 _ 两边都有空白的话,它们就只会被当成普通的符号:这是一段* 文本强调 *的说明示例。如果要在文字前后直接插入普通的星号或底线,你可以用反斜线(转义符):\*this text is surrounded by literal asterisks\*

Lists list:

Unordered 无序列表:* 无序列表* 子项* 子项+ 无序列表+ 子项+ 子项- 无序列表- 子项- 子项Ordered 有序列表:1. 第一行2. 第二行3. 第三行1. 第一行- 第二行- 第三行组合:* 产品介绍(子项无项目符号)    此时子项,要以一个制表符或者4个空格缩进* 产品特点    1. 特点1    - 特点2    - 特点3* 产品功能    1. 功能1    - 功能2    - 功能3可有时我们会出现这样的情况,首行内容是以日期或数字开头:2013. 公司年度目标。为了避免也被转化成有序列表,我们可以在"."前加上反斜杠(转义符):2013\. 公司年度目标。

Links Connection (title is optional):

Inline-style 内嵌方式:[link text](https://www.google.com "title text")Reference-style 引用方式:[link text][id][id]: https://www.mozilla.org "title text" Relative reference to a repository file 引用存储文件:[link text](../path/file/readme.text "title text") 还能这样使用:[link text][][link text]: http://www.reddit.comEmail 邮件:<[email protected]>

Images Pictures:

Inline-style 内嵌方式:![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "title text")Reference-style 引用方式:![alt text][logo][logo]: https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "title text"

Code and Syntax highlighting codes and syntax highlighting:

标记一小段行内代码:本文是一篇介绍`Markdown`的语法的文章如果高亮的内容包含`号,可以这样写:`` `包裹起来` ``语法高亮:```html    <div>Syntax Highlighting</div>``````css    body{font-size:12px}``````javascript    var s = "JavaScript syntax highlighting";    alert(s);``````php    <?php      echo "hello, world!";    ?>``````python    s = "Python syntax highlighting"    print s```

Block Code code grouping (code block):

在该行开头缩进4个空格或一个制表符(tab)<strong>Blockquotes 引用:</strong>> Email-style angle brackets> are used for blockquotes.> > And, they can be nested.> #### Headers in blockquotes> * You can quote a list.> * Etc.

Hard line Breaks:

在一行的结尾处加上2个或2个以上的空格,也可以使用</br>标签第一行文字,第二行文字

Horizontal Rules Horizontal Split line:

**** * *- - -

Escape character escape character (backslash):

Markdown 可以利用反斜杠来插入一些在语法中有其它意义的符号,例如:如果你想要用星号加在文字旁边的方式来做出强调效果,你可以在星号的前面加上反斜杠:\*literal asterisks\*Markdown 支持以下这些符号前面加上反斜杠来帮助插入普通的符号:\反斜杠  `反引号  *星号  _下划线  {}花括号  []方括号  ()括弧  #井字号  +加号  -减号  .英文句 !感叹号

Additional Supplement:

Markdown也支持传统的HTML标签。比如一个链接,你不太喜欢Markdown的写法,也可以直接写成<a href="http://www.baidu.com">百度</a>

Markdown Official website: http://daringfireball.net/projects/markdown/
Reference: http://markdown.tw/

Markdown Online Editor:
dillinger:http://dillinger.io/
Markdown here:http://markdown-here.com/livedemo.html

--------------------------------------------------------------------------

Transferred from: http://www.bluesdream.com/blog/markdown-cheatsheet-syntax-manual.html

Go Markdown Grammar Handbook

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.