MOU关于MarkDown语言的学习 ,Mark下,,防以后用到
来源:互联网 发布:迪卡侬 天猫 知乎 编辑:程序博客网 时间:2024/05/16 11:45
段落、标题、区块代码
一个段落是由一个以上的连接的行句组成,而一个以上的空行则会划分出不同的段落(空行的定义是显示上看起来像是空行,就被视为空行,例如有一行只有空白和 tab,那该行也会被视为空行),一般的段落不需要用空白或换行缩进。
Markdown 支持两种标题的语法,Setext 和 atx 形式。Setext 形式是用底线的形式,利用 =
(最高阶标题)和 -
(第二阶标题),Atx 形式在行首插入 1 到 6 个 #
,对应到标题 1 到 6 阶。
>
' 角括号。Markdown 语法:
A First Level Header====================A Second Level Header---------------------Now is the time for all good men to come tothe aid of their country. This is just aregular paragraph.The quick brown fox jumped over the lazydog's back.### Header 3> This is a blockquote.> > This is the second paragraph in the blockquote.>> ## This is an H2 in a blockquote
输出 HTML 为:
<h1>A First Level Header</h1><h2>A Second Level Header</h2><p>Now is the time for all good men to come tothe aid of their country. This is just aregular paragraph.</p><p>The quick brown fox jumped over the lazydog's back.</p><h3>Header 3</h3><blockquote><p>This is a blockquote.</p><p>This is the second paragraph in the blockquote.</p><h2>This is an H2 in a blockquote</h2></blockquote>
修辞和强调
Markdown 使用星号和底线来标记需要强调的区段。
Markdown 语法:
Some of these words *are emphasized*.Some of these words _are emphasized also_.Use two asterisks for **strong emphasis**.Or, if you prefer, __use two underscores instead__.
输出 HTML 为:
<p>Some of these words <em>are emphasized</em>.Some of these words <em>are emphasized also</em>.</p><p>Use two asterisks for <strong>strong emphasis</strong>.Or, if you prefer, <strong>use two underscores instead</strong>.</p>
列表
无序列表使用星号、加号和减号来做为列表的项目标记,这些符号是都可以使用的,使用星号:
* Candy.* Gum.* Booze.
加号:
+ Candy.+ Gum.+ Booze.
和减号
- Candy.- Gum.- Booze.
都会输出 HTML 为:
<ul><li>Candy.</li><li>Gum.</li><li>Booze.</li></ul>
有序的列表则是使用一般的数字接着一个英文句点作为项目标记:
1. Red2. Green3. Blue
输出 HTML 为:
<ol><li>Red</li><li>Green</li><li>Blue</li></ol>
如果你在项目之间插入空行,那项目的内容会用 <p>
包起来,你也可以在一个项目内放上多个段落,只要在它前面缩排 4 个空白或 1 个 tab 。
* A list item. With multiple paragraphs.* Another item in the list.
输出 HTML 为:
<ul><li><p>A list item.</p><p>With multiple paragraphs.</p></li><li><p>Another item in the list.</p></li></ul>
链接
Markdown 支援两种形式的链接语法: 行内 和 参考 两种形式,两种都是使用角括号来把文字转成连结。
行内形式是直接在后面用括号直接接上链接:
This is an [example link](http://example.com/).
输出 HTML 为:
<p>This is an <a href="http://example.com/">example link</a>.</p>
你也可以选择性的加上 title 属性:
This is an [example link](http://example.com/ "With a Title").
输出 HTML 为:
<p>This is an <a href="http://example.com/" title="With a Title">example link</a>.</p>
参考形式的链接让你可以为链接定一个名称,之后你可以在文件的其他地方定义该链接的内容:
I get 10 times more traffic from [Google][1] than from[Yahoo][2] or [MSN][3].[1]: http://google.com/ "Google"[2]: http://search.yahoo.com/ "Yahoo Search"[3]: http://search.msn.com/ "MSN Search"
输出 HTML 为:
<p>I get 10 times more traffic from <a href="http://google.com/"title="Google">Google</a> than from <a href="http://search.yahoo.com/"title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/"title="MSN Search">MSN</a>.</p>
title 属性是选择性的,链接名称可以用字母、数字和空格,但是不分大小写:
I start my morning with a cup of coffee and[The New York Times][NY Times].[ny times]: http://www.nytimes.com/
输出 HTML 为:
<p>I start my morning with a cup of coffee and<a href="http://www.nytimes.com/">The New York Times</a>.</p>
图片
图片的语法和链接很像。
行内形式(title 是选择性的):
![alt text](/path/to/img.jpg "Title")
参考形式:
![alt text][id][id]: /path/to/img.jpg "Title"
上面两种方法都会输出 HTML 为:
<img src="/path/to/img.jpg" alt="alt text" title="Title" />
代码
在一般的段落文字中,你可以使用反引号 `
来标记代码区段,区段内的 &
、<
和 >
都会被自动的转换成 HTML 实体,这项特性让你可以很容易的在代码区段内插入 HTML 码:
I strongly recommend against using any `<blink>` tags.I wish SmartyPants used named entities like `—`instead of decimal-encoded entites like `—`.
输出 HTML 为:
<p>I strongly recommend against using any<code><blink></code> tags.</p><p>I wish SmartyPants used named entities like<code>&mdash;</code> instead of decimal-encodedentites like <code>&#8212;</code>.</p>
如果要建立一个已经格式化好的代码区块,只要每行都缩进 4 个空格或是一个 tab 就可以了,而 &
、<
和 >
也一样会自动转成 HTML 实体。
Markdown 语法:
If you want your page to validate under XHTML 1.0 Strict,you've got to put paragraph tags in your blockquotes:<blockquote><p>For example.</p></blockquote>
输出 HTML 为:
<p>If you want your page to validate under XHTML 1.0 Strict,you've got to put paragraph tags in your blockquotes:</p><pre><code><blockquote><p>For example.</p></blockquote></code></pre>
- MOU关于MarkDown语言的学习 ,Mark下,,防以后用到
- 关于MOU下MarkDown编辑实例,最近在学习的一门文本编辑器
- 【mark,以后用到再看】创业,团队建设的好文章
- Mac上的markdown文本编辑神器 Mou
- mac 上的Markdown编辑器Mou
- Markdown编辑器--Mou
- mark关于Java语言Static的生命周期
- 关于AndroidAnnotation的调用顺序(以便以后用到)
- 【mark一下实习用到的软件】
- 以后 没准会用到 先留着保存学习
- [总结]关于以后的学习和生活
- mou——编写markdown文件神器
- Mac 下两款 Markdown 编辑器 Mou/MacDown
- 工作以后要用到的哦,何为“五险一金”? 关于人事档案
- 以后可能会用到的JavaScript正则表达式
- 图像处理-以后可能用到的资料
- 以后可能会经常用到的gulp插件
- 以后可能用到的库,先记录
- hibernate 普通字段延迟加载无效的解决办法(如:Lazy Fetch Blob)
- MINA框架的第一课
- iOS开发——JS网页交互——javaScript
- 托福口语四大难点是什么
- 通过代码创建按钮案例
- MOU关于MarkDown语言的学习 ,Mark下,,防以后用到
- 有25匹马,5条赛道
- 深入浅出数据分析
- MOOC上的数据科学学习路线图
- 火云开发课堂 - 《Shader从入门到精通》系列 第二十二节:在Shader中实现3D方向光
- C++中栈和队列
- Linux 内核Tcp Socket参数调优
- IOS开发—App 在 IOS 8 的simulator运行时,定位卡死bug解决
- coderforce 527A Arrays