在stackoverflow上使用markdown


stackoverflow流派的markdown。

Code and Preformatted Text

縮進四個空格,就可以寫代碼片段了

def hello():
    print "hello, world"

Linebreaks

在行尾添加個空格,就可以換行了

there is a space at the end 
another line

Italics and Bold

用下划線或星號包裹文本,就可以把它們變成斜體或粗體

_italics_
**bold**

用方括號包裹文本,把它變成鏈接

[this is a link](http://www.cnblogs.com)

Bare URLs

用尖括號包裹URL,也可以變成鏈接

<http://www.cnblogs.com>

Headers

在文本前面加井號,讓它變成標題

# level one header
## level two header
### level three header

Horizontal Rules

用3+個減號,添加一個水平分割線

hello world

---

hello world

Simple lists

文字前加上數字或標點(減號,加號,星號),讓它們變成列表

1. first item
2. second item
3. third item

- first item
- second item
- third item

Advanced lists: Nesting

列表可以嵌套喔

- first item
- second item
    * subitem 1
    * subitem 2
- third item

Simple blockquotes

在文本前加上大於號,表示引用

> hello world

Advanced blockquotes: Nesting

引用也可以嵌套喔

> hello kev
> nice to meet you
>> hi tom
>> nice to meet you too

Images

與鏈接語法類似,在最前面加個感嘆號即可

![flair](http://stackexchange.com/users/flair/141612.png)

效果圖:

flair

Inline HTML

也可以在文本中嵌入某些原生HTML代碼

Type <kbd>:wq</kbd> to save and quit
I'm a **vim** user!!!

Stack Exchange additions (SO特有)

Tags

I'm a [tag:vim] user!

Spoilers

沒用過這個功能 :(

Syntax highlighting for code

使用XML注釋,指定語言種類

<!-- language: python -->

    def hello():
        print "hello, world"

Comment formatting

評論框中的Markdown有限制

_italic_ and **bold** text,
inline `code in backticks`,
and [basic links](http://example.com).


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM