在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
Links
用方括号包裹文本,把它变成链接
Bare URLs
用尖括号包裹URL,也可以变成链接
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
与链接语法类似,在最前面加个感叹号即可

效果图:

Inline HTML
也可以在文本中嵌入某些原生HTML代码
Type :wq 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注释,指定语言种类
def hello():
print "hello, world"
Comment formatting
评论框中的Markdown有限制
italic and bold text,
inline code in backticks,
and basic links.

浙公网安备 33010602011771号