1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-09-30 00:08:59 +02:00
This commit is contained in:
Kevin Fangzhou Chen
2014-07-07 15:45:12 +08:00
parent 821464185a
commit 12b74ada30

View File

@@ -19,130 +19,121 @@ Markdown 由 John Gruber 于 2004年创立. 它旨在成为一门容易读写的
并不会被Markdown解析器所影响。不过如果你在Markdown文件内创建了HTML元素 并不会被Markdown解析器所影响。不过如果你在Markdown文件内创建了HTML元素
你将无法在HTML元素的内容中使用Markdown语法。--> 你将无法在HTML元素的内容中使用Markdown语法。-->
<!-- Markdown also varies in implementation from one parser to a next. This <!-- 在不同的解析器中Markdown的实现方法有所不同。此教程会指出当某功能是否通用及是否只对某一解析器有效。 -->
guide will attempt to clarify when features are universal or when they are
specific to a certain parser. -->
<!-- Headers --> <!-- 标头 -->
<!-- You can create HTML elements <h1> through <h6> easily by prepending the <!-- 通过在文本前加上不同数量的hash(#), 你可以创建相对应的 <h1> 到 <h6> HTML元素。 -->
text you want to be in that element by a number of hashes (#) --> # 这是一个 <h1>
# This is an <h1> ## 这是一个 <h2>
## This is an <h2> ### 这是一个 <h3>
### This is an <h3> #### 这是一个 <h4>
#### This is an <h4> ##### 这是一个 <h5>
##### This is an <h5> ###### 这是一个 <h6>
###### This is an <h6>
<!-- Markdown also provides us with two alternative ways of indicating h1 and h2 --> <!-- 对于 <h1> 和 <h2> 元素Markdown 额外提供了两种添加方式。 -->
This is an h1 这是一个 h1
============= =============
This is an h2 这是一个 h2
------------- -------------
<!-- Simple text styles --> <!-- 简易文本样式 -->
<!-- Text can be easily styled as italic, bold, or strikethrough using markdown --> <!-- 文本的斜体粗体和删除线在Markdown中可以轻易的被实现。-->
*This text is in italics.* *此文本为斜体。*
_And so is this text._ _此文本也是。_
**This text is in bold.** **此文本为粗体。**
__And so is this text.__ __此文本也是__
***This text is in both.*** ***此文本是斜体加粗体。***
**_As is this!_** **_或者这样。_**
*__And this!__* *__这个也是!__*
<!-- In Github Flavored Markdown, which is used to render markdown files on <!-- Github采用的Markdown中 -->
Github, we also have: -->
~~This text is rendered with strikethrough.~~ ~~此文本为删除线效果。~~
<!-- Paragraphs are a one or multiple adjacent lines of text separated by one or <!-- 单个段落由一句或多句邻近的句子组成,这些句子由一个或多个空格分隔。 -->
multiple blank lines. -->
This is a paragraph. I'm typing in a paragraph isn't this fun? 这是第一段落. 这句话在同一个段落里,好玩么?
Now I'm in paragraph 2. 现在我是第二段落。
I'm still in paragraph 2 too! 这句话也在第二段落!
这句话在第三段落!
I'm in paragraph three! <!-- 如果你插入一个HTML中的<br />标签,你可以在段末加入两个以上的空格,
然后另起一段。-->
<!-- Should you ever want to insert an HTML <br /> tag, you can end a paragraph 此段落结尾有两个空格(选中以显示)。
with two or more spaces and then begin a new paragraph. -->
I end with two spaces (highlight me to see them). 上文有一个 <br />
There's a <br /> above me! <!-- 段落引用可由 > 字符轻松实现。 -->
<!-- Block quotes are easy and done with the > character. --> > 这是一个段落引用. 你可以
> 手动断开你的句子,然后在每句句子前面添加 “>” 字符。或者让你的句子变得很长,以至于他们自动得断开。
> 只要你的文字以“>” 字符开头,两种方式无异。
> This is a block quote. You can either > 你也对文本进行
> manually wrap your lines and put a `>` before every line or you can let your lines get really long and wrap on their own. >> 多层引用
> It doesn't make a difference so long as they start with a `>`. > 这多机智啊!
> You can also use more than one level <!-- 序列 -->
>> of indentation? <!-- 无序序列可由星号,加号或者减号来建立 -->
> How neat is that?
<!-- Lists --> * 项目
<!-- Unordered lists can be made using asterisks, pluses, or hyphens --> * 项目
* 另一个项目
* Item 或者
* Item
* Another item
or + 项目
+ 项目
+ 另一个项目
+ Item 或者
+ Item
+ One more item
or - 项目
- 项目
- 最后一个项目
- Item <!-- 有序序列可由数字加点来实现 -->
- Item
- One last item
<!-- Ordered lists are done with a number followed by a period --> 1. 项目一
2. 项目二
3. 项目三
1. Item one <!-- 即使你的标签数字有误Markdown依旧会呈现出正确的序号不过这并不是一个好主意-->
2. Item two
3. Item three
<!-- You don't even have to label the items correctly and markdown will still 1. 项目一
render the numbers in order, but this may not be a good idea --> 1. 项目二
1. 项目三
<!-- (此段与前例一模一样) -->
1. Item one <!-- 你也可以使用子序列 -->
1. Item two
1. Item three
<!-- (This renders the same as the above example) -->
<!-- You can also use sublists --> 1. 项目一
2. 项目二
3. 项目三
* 子项目
* 子项目
4. 项目四
1. Item one <!-- 代码段落 -->
2. Item two <!-- 代码段落HTML中<code>标签可以由缩进四格spaces或者一个标签页tab实现-->
3. Item three
* Sub-item
* Sub-item
4. Item four
<!-- Code blocks -->
<!-- You can indicate a code block (which uses the <code> element) by indenting
a line with four spaces or a tab -->
This is code This is code
So is this So is this
<!-- You can also re-tab (or add an additional four spaces) for indentation <!-- 在你的代码中你仍然使用tab可以进行缩进操作 -->
inside your code -->
my_array.each do |item| my_array.each do |item|
puts item puts item
end end
<!-- Inline code can be created using the backtick character ` --> <!-- 内联代码可由反引号 ` 实现 -->
John didn't even know what the `go_to()` function did! John didn't even know what the `go_to()` function did!