MarkDown语法实例
概述:本篇是对常用的MarkDown语法的演示示例,由于博客采用MarkDown方式书写,所以记录方便写博客的时候使用。
First level header
Second level header
H1 header
H2 header
H3 header
H4 header
H5 header
H6 header
A header without an ID
A sample blockquote.
Nested blockquotes are
also possible.Headers work too
This is the outer quote again.
This is a blockquote
continued on this
and this line.
But this is a separate paragraph.
This is also a code block. |
def what? |
- This is a list item
- And another item
And the third one
with additional text- A list item
with additional text
- A list item
This is a list item
with a blockquote
And a header
Followed by another item
Item one
- sub item one
- sub item two
- sub item three
- Item two
This is a paragraph.
This is NOT a list.
This is a list!
- Item one
- Item two
- Item three
term
: definition
: another definition
another term
and another term
: and a definition for the term
term
: definition
: definition
This is a term
: This will be a para
a blockquote
A header
| A simple | table |
| with multiple | lines|
Header1 | Header2 | Header3 |
---|---|---|
cell1 | cell2 | cell3 |
cell4 | cell5 | cell6 |
—- | ||
cell1 | cell2 | cell3 |
cell4 | cell5 | cell6 |
===== | ||
Foot1 | Foot2 | Foot3 |
Something that stays right and is not wrapped in a para.
This is wrapped in a para.
This can contain only span level elements.
A nice blockquote
{: title=”Blockquote title”}A nice blockquote
{: .class1 .class2}A nice blockquote
{: #with-an-id}
Header without id
This is emphasized,
this too!
This is strong,
this too!
This works as expected!
A link
to the kramdown homepage.
A link
to the homepage.
A link
to the homepage.
A link to the kramdown hp.
An image:
Use Kramdown::Document.new(text).to_html
to convert the text
in kramdown
syntax to HTML.
Use backticks to markup code,
e.g. `code`
.
This is written in
red.
This is red{: style=”color: red”}.
大标题
大标题一般显示工程名,类似html的\
你只要在标题下面跟上=====即可
中标题
中标题一般显示重点项,类似html的\
你只要在标题下面输入——即可
小标题
小标题类似html的\
小标题的格式如下 ### 小标题
注意#和标题字符中间要有空格
注意!!!下面所有语法的提示我都先用小标题提醒了!!!
单行文本框
这是一个单行的文本框,只要两个Tab再输入文字即可
多行文本框
这是一个有多行的文本框
你可以写入代码等,每行文字只要输入两个Tab再输入文字即可
这里你可以输入一段代码
比如我们可以在多行文本框里输入一段代码,来一个Java版本的HelloWorld吧
public class HelloWorld { |
链接
1.点击这里你可以链接到www.google.com
2.点击这里我你可以链接到我的博客
只是显示图片
想点击某个图片进入一个网页,比如我想点击github的icon然后再进入github.com
文字被些字符包围
文字被些字符包围
只要再文字前面加上>空格即可
如果你要换行的话,新起一行,输入>空格即可,后面不接文字
但> 只能放在行首才有效
文字被些字符包围,多重包围
文字被些字符包围开始
只要再文字前面加上>空格即可
如果你要换行的话,新起一行,输入>空格即可,后面不接文字
但> 只能放在行首才有效
特殊字符处理
有一些特殊字符如<,#等,只要在特殊字符前面加上转义字符\即可
你想换行的话其实可以直接用html标签\