Markdown

基本语法介绍

Posted by tong木头 on September 16, 2016

鉴于本blog都是采用markdown格式写的,所以第一篇就介绍下markdown的基本语法

Markdown

标题

标题是每篇文章都需要也是最常用的格式,在 Markdown 中,如果一段文字被定义为标题,只要在这段文字前加 # 号即可。

# Heading

## Sub-heading

### Another deeper heading

Heading

Sub-heading

Another deeper heading

文字

文字换行使用2个空格,直接回车的话是不会有换行的效果的。

Paragraphs are separated
by a blank line.
 
Two spaces at the end of a line leave a  
line break

Paragraphs are separated by a blank line.

Two spaces at the end of a line leave a
line break.

列表

列表的显示只需要在文字前加上 - 或 * 即可变为无序列表,有序列表则直接在文字前加1. 2. 3. 符号要和文字之间加上一个字符的空格。

无序列表:

  * apples
  * oranges
  - pears

有序列表:

  1. apples
  2. oranges
  3. pears

无序列表:

  • apples
  • oranges
  • pears

有序列表:

  1. apples
  2. oranges
  3. pears