Markdown 学习笔记: Basics
Markdown 学习笔记: Basics##
原文:Basics.
了解Markdown格式化句法的要点###
本页对如何使用Markdown提供了一个简单的概述。在“句法”页中对Markdown的所有特性提供了完整的,包含细节的文档。但Markdown应该仅通过浏览几个简单的例子就可以开始使用。本页中的这些例子写成了之前/之后的形式,展示出了Markdown的句法和对应的HTML输出。
另一个有用的方法就是试用下Markdown。Dingus是一个可以输入Markdown格式文本并转换成XHTML格式的web应用。
段落,标题和块引用###
一个段落就是一行或多行连续的文本,由一行或多行空白行分隔开。(空白行可以是任何看起来空白的行,可以包含多个空格或制表符。)普通的段落不应该用空格或制表符缩进。
Markdown提供了两种风格的标题:Setext和atx。用于<h1
>和<h2
>标签的Setext风格标题,是通过在文字下方分别用等号或连字符实现的。而要实现atx风格的标题,是在行首放置1-6个#号,#号的数量等同于HTML标题的级别。
块引用是用email风格的角括号>
来表示。
Markdown:
A First Level Header
====================
A Second Level Header
---------------------
Now is the time for all good men to come to
the aid of their country. This is just a
regular paragraph.
The quick brown fox jumped over the lazy
dog's back.
### Header 3
> This is a blockquote.
>
> This is the second paragraph in the blockquote.
>
> ## This is an H2 in a blockquote
Output:
<h1>A First Level Header</h1>
<h2>A Second Level Header</h2>
<p>Now is the time for all good men to come to
the aid of their country. This is just a
regular paragraph.</p>
<p>The quick brown fox jumped over the lazy
dog'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__.
Output:
<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.
都会产生同样的输出:
<ul>
<li>Candy.</li>
<li>Gum.</li>
<li>Booze.</li>
</ul>
有序的列表用数字加上句号作为列表标记。如下:
1. Red
2. Green
3. Blue
输出为:
<ol>
<li>Red</li>
<li>Green</li>
<li>Blue</li>
</ol>
如果你在列表项之间插入空白行,生成的文本中会有<p
>标签。你可以通过在你段落前用四个空格或者一个制表符缩进来制造多段的列表项。
* A list item.
With multiple paragraphs.
* Another item in the list.
输出:
<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/).
输出:
<p>This is an <a href="http://example.com/">
example link</a>.</p>
可选的,你可以在圆括号中包含一个标题参数:
This is an [example link](http://example.com/ "With a Title").
输出:
<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"
输出:
<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>
标题属性是可选的。链接名称可以包含字母,数字或者空格,但不是大小写敏感的。
I start my morning with a cup of coffee and
[The New York Times][NY Times].
[ny times]: http://www.nytimes.com/
输出:
<p>I start my morning with a cup of coffee and
<a href="http://www.nytimes.com/">The New York Times</a>.</p>
图片###
图片句法同引用句法很相像。
内联的(标题可选):

引用风格:
![alt text][id]
[id]: /path/to/img.jpg "Title"
上面两个例子会产生同样的输出:
<img src="/path/to/img.jpg" alt="alt text" title="Title" />
代码###
在通常的段落中,你可以通过将文本包含在重音符`中来产生代码段。任何&符号或角括号会自动转换成HTML实体。这使得用Markdown写HTML的实例代码非常容易。
I strongly recommend against using any `<blink>` tags.
I wish SmartyPants used named entities like `—`
instead of decimal-encoded entites like `—`.
输出:
<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-encoded
entites like <code>&#8212;</code>.</p>
要指定一段格式化的代码,将代码块的每行用四个空格或一个制表符缩进。同重音符产生的代码段一样,&
等特殊字符也会被自动跳过。
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>
输出:
<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>
Markdown 学习笔记: Basics的更多相关文章
- 首秀:Markdown学习笔记
# Markdown学习 ## 标题 ### 三级标题 #### 四级标题 ## 字体 **Hello,World!** *Hello,World!* ***Hello,World!*** ~~Hel ...
- 一、MarkDown学习笔记
MakrDown学习 MarkDown是什么? 是一种纯文件格式的标记语言,跟我们写txt和word是一样的,不过它有一些简单的标记,可以使普通文本具有一定的格式. MarkDown有什么样式? 样式 ...
- 我的 MarkDown 学习笔记
MarkDown 一种用于写作的轻量级[标记语言].它用简洁的语法代替排版,而不像一般的文字处理软件 Word 或者 Pages 有大量的排版.字体设置等. 如果你对文章的样式没有太多要求,只注重写文 ...
- MarkDown 学习笔记
MarkDown是一种适用于网络的书写语言,可以帮助你快速书写文档,不必再纠结文档排版的问题.并且它的语法简单,学习成本低,程序员必备技能...助你快速书写技术文档.文章. 用于书写 MarkDown ...
- Markdown学习笔记(一) 基本的Markdown标签
Markdown是一种可以使用普通文本编辑器编写的标记语言,通过简单的标记语法,它可以使普通文本内容具有一定的格式. Markdown的语法简洁明了.学习容易,而且功能比纯文本更强,因此有很多人用它写 ...
- Markdown学习笔记
分为两步: 1.阅读Markdown中文官网的文档 2.下载MarkdownPad2将中文官网中文档的例子敲一遍,其中Markdownpad2为官网中推荐的编辑器 备注: 如果只看中文官网文档,不边看 ...
- markdown学习笔记 (一)
##类Atx形式标题 # H1标题(一个井号加文字) ### H3标题(三个井号加文字) ###### H6标题(6个井号加文字) 类setext ======== 一级标题(下行加若干个等号) == ...
- Markdown学习笔记(一)
解决Markdown文件插入图片无法只能本地查看的问题 原因:图片的显示与图片地址关联,写入Markdown时用的本机地址,一旦上传到网络,地址就发生了变化,也就显示不了图片. 寻找免费的图床网站. ...
- MarkDown学习笔记 Typora
快捷方式篇 新建 ctrl + N 新建窗口 ctrl + shift + N 打开md文件 ctrl + O 快速打开 ctrl + P 保存 ctrl + S 另存为 ctrl + shift + ...
随机推荐
- FeatureClass对象
概述: 在讲述FeatureClass对象之前,首先说明与FeatureClass对象相关的对象: Table对象,是不具有空间信息的二维表,是一张仅能在ArcMap的Table Of Content ...
- .net ADF 中 Ajax 的调用过程.
图示是 .net ADF Ajax调用过程的简略过程: 1,2)当页面初始化之后, 浏览器一旦触发回调事件, 脚本函数负责处理回调信息, 并调用 ASP.NET 2.0/3.5 中的 WebForm_ ...
- taglib的使用
使用自定义的taglib可以是我们对页面数据的处理放在后台,不仅使用方便,而且影藏了处理逻辑,也更加的安全. 需要使用到servlet.jar 1.在web-inf下建立taglib.tld文件 &l ...
- linux目录权限小记
r : 拥有读取目录结构列表的权限 x:拥有进入此目录的权限 w: 1: 建立新的档案和目彔: 2删除已经存在的档案和目录(无论该档案的权限为何!) 3能够重命名档案和目录: 4 能够移动目录里面的 ...
- jdbc 获取connection 对象的三种方式
获取数据库连接方法一:驱动实现类 //创建mysql的Driver对象 Driver driver=new com.mysql.jdbc.Driver(); //jdbc url 定位一个数据库: S ...
- poj 1182 并查集高级应用
C - 是谁站在食物链的顶端 Crawling in process... Crawling failed Time Limit:1000MS Memory Limit:10000KB ...
- MySql中查询表中的列名
例如我的数据库名为"example",使用 USE example; 确定使用example数据库.使用 show tables; 显示数据库中的所有表.使用 DESC perso ...
- JDK + Tomcat 安装配置
学习Java 开发的第一步就是配置环境,今天第一次配置,把过程记录下以备后用. 一.下载JDK.Tomcat JDK:http://www.oracle.com/technetwork/java/ja ...
- IIS中启用gzip压缩(网站优化)
HTTP协议上的GZIP编码是一种用来改进WEB应用程序性能的技术.大流量的WEB站点常常使用GZIP压缩技术来让用户感受更快的速度.这一般是指WWW服务器中安装的一个功能,当有人来访问这个服务器中的 ...
- PHP扩展开发(2) - VS2013环境搭建
1. 安装VS2013 2. Cygwin安装 3. 下载Windows的PHP源码 4. 修改~/ext/ext_skel_win32.php 加上 $cygwin_path = 'c:\c ...