Markdown基本用法

2016-01-14  本文已影响0人  niccgz

Markdown是一种可以使用普通文本编辑器编写的标记语言,通过类似HTML的标记语法,它可以使普通文本内容具有一定的格式。

Markdown具有一系列衍生版本,用于扩展Markdown的功能(如表格、脚注、内嵌HTML等等),这些功能原初的Markdown尚不具备,它们能让Markdown转换成更多的格式,例如LaTeX,Docbook。Markdown增强版中比较有名的有Markdown Extra、MultiMarkdown、 Maruku等。这些衍生版本要么基于工具,如Pandoc;要么基于网站,如GitHub和Wikipedia,在语法上基本兼容,但在换行等细节上也有改动。

最常见的Markdown格式选项和键盘快捷键:

输出后的效果 Markdown 快捷键
Bold text Ctrl/⌘ + B
Emphasize text Ctrl/⌘ + I
Strike-through text Ctrl + Alt + U
Link title Ctrl/⌘ + K
Inline Code code Ctrl/⌘ + Shift + K
Image altalt Ctrl/⌘ + Shift + I
List * item Ctrl + L
Blockquote > quote Ctrl + Q
H1 # Heading
H2 ## Heading Ctrl/⌘ + H
H3 ### Heading Ctrl/⌘ + H (x2)

下面是一些例子:

Paragraphs

On July 2, an alien mothership entered Earth's orbit and deployed several dozen saucer-shaped "destroyer" spacecraft, each 15 miles (24 km) wide.

On July 3, the Black Knights, a squadron of Marine Corps F/A-18 Hornets, participated in an assault on a destroyer near the city of Los Angeles.

Headings

使用 "#"

# The largest heading (an <h1> tag)
## The second largest heading (an <h2> tag)
…
###### The 6th largest heading (an <h6> tag)

Blockquotes

使用 ">"

In the words of Abraham Lincoln:

Pardon my french

Styling text

eg:
Everyone must attend the meeting at 5 o'clock today

Lists

使用: * 或 - 或 1,2,3...

eg:

Task Lists

使用:- [x] do something

Code Formartting

inline formats: `

Here's an idea: why don't we take SuperiorProject and turn it into **Reasonable**Project.

Multiple formats: ```

Check out this neat program I wrote:

x = 0
x = 2 + 2
what is x

Links

使用: [link tag](link url)

github

Images

使用:![Alt Text](url)

[站外图片上传中……(2)]

Tables

First Header Second Header
Content from cell 1 Content from cell 2
Content in the first column Content in the second column
Left-Aligned Center Aligned Right Aligned
col 3 is some wordy text $1600
col 2 is centered $12
zebra stripes are neat $1
上一篇下一篇

猜你喜欢

热点阅读