Skip to content

Commit 323eab2

Browse files
committed
Add comparation of html and markup language in the appendix.
1 parent 87c61d3 commit 323eab2

File tree

1 file changed

+51
-10
lines changed

1 file changed

+51
-10
lines changed

appendix/markups.rst

Lines changed: 51 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,60 @@
66

77
没有标记语言就没有Web和丰富多彩的互联网,但创造了Web的HTML语言并非尽善尽美,\
88
存在诸如难读、难写、难以向其他格式转换的问题。究其根源是因为HTML语言是一种\
9-
“重”标记语言,对机器友好而并非对人友好。另外一种用于文档撰写的标记语言DocBook\ [#]_\
10-
也存在类似问题,虽然DocBook能实现单一源文件出版(Single-Source Publishing),\
11-
即一次撰写多种格式输出(Write once, publish many),但复杂的XML标签给写作\
12-
过程带来不小的负担。
9+
“重”标记语言,对机器友好而并非对人友好。
1310

14-
为用户提供更为便捷的方式创建UGC(用户生成内容)是GitHub流行的因素之一,奥秘\
15-
就在于使用了轻量级的标记语言。无论是代码提交说明、提交评注、问题描述、项目的\
16-
README文件、维基页面、用户主页和项目主页都可以使用Markdown\ [#]_\ 等轻量级\
17-
标记语言来撰写。轻量级标记语言如Markdown是对人友好的标记语言,一些语法参照了\
11+
下面这段HTML源码,非技术控阅读起来会遇到困难。
12+
13+
::
14+
15+
<html>
16+
<head>
17+
<meta content='application/xhtml+xml;charset=utf-8' http-equiv='Content-type' />
18+
<title>轻量级标记语言</title>
19+
</head>
20+
<body>
21+
<h1 id='id1'>轻量级标记语言</h1>
22+
23+
<p><strong>轻量级标记语言</strong> 是一种 <em>语法简单</em> 的标记语言。
24+
它使用易于理解的格式标记,没有古怪的 <code>&lt;标签&gt;</code> 。</p>
25+
26+
<ul>
27+
<li>可以使用最简单的文本编辑器编辑。</li>
28+
<li>所见即所得,非技术控亦可直接阅读源码。</li>
29+
<li>可版本控制。</li>
30+
<li>实现单一源文件出版。</li>
31+
</ul>
32+
<body>
33+
</html>
34+
35+
同样的信息如果换用轻量级标记语言来表达,就非常直观了。如下所示:
36+
37+
::
38+
39+
轻量级标记语言
40+
==============
41+
42+
**轻量级标记语言** 是一种 *语法简单* 的标记语言。
43+
它使用易于理解的格式标记,没有古怪的 `<标签>` 。
44+
45+
- 可以使用最简单的文本编辑器编辑。
46+
- 所见即所得,非技术控亦可直接阅读源码。
47+
- 可版本控制。
48+
- 实现单一源文件出版。
49+
50+
GitHub另人着迷的一个因素就在于GitHub为用户提供更为便捷地创建UGC\
51+
(用户生成内容)的方法,其奥秘就在于使用了轻量级标记语言。\
52+
无论是代码提交说明、提交评注、问题描述、项目的README文件、维基页面、\
53+
用户主页和项目主页都可以使用Markdown\ [#]_\ 等轻量级标记语言来撰写。\
54+
轻量级标记语言如Markdown是对人友好的标记语言,一些语法参照了\
1855
我们写电子邮件时的习惯,即使第一次接触用轻量级标记语言撰写的文件,也可以\
1956
毫无障碍地理解其中的内容。
2057

2158
虽然GitHub更倾向于使用Markdown标记语言\ [#]_\ ,但很多地方也提供对其他轻量级\
2259
标记语言的支持。包括为Python程序员所熟悉的reStructedText\ [#]_\ ,为Ruby程序员\
2360
所熟悉的Textile\ [#]_\ 、RDoc\ [#]_\ ,为Perl程序员所熟悉的POD\ [#]_\ ,\
2461
为Emacs用户所熟悉的Org-mode\ [#]_\ ,为维基用户所熟悉的MediaWiki\ [#]_\ 和\
25-
Creole\ [#]_\ 以及可作为DocBook前端的颇有前途的AsciiDoc\ [#]_\ 标记语言。
62+
Creole\ [#]_\ 以及可作为DocBook\ [#]_\ 前端的颇有前途的AsciiDoc\ [#]_\ 标记语言。
2663

2764
下面通过一张表格对几种常用的轻量级标记语言加以对照,供有不同标记语言偏好的\
2865
用户参考,便于在GitHub某些不能随意更换标记语言而只能使用GFM(GitHub风格的\
@@ -32,6 +69,7 @@ Markdown)的场合可以自如地转换。
3269
例如:md为Markdown,gfm是GitHub风格的Markdown,rst为reStructedText,\
3370
ttl为Textile,asc为AsciiDoc,org为Org-mode。
3471

72+
3573
.. highlight:: none
3674
.. role:: raw-html(raw)
3775
:format: html
@@ -1154,7 +1192,6 @@ ttl为Textile,asc为AsciiDoc,org为Org-mode。
11541192

11551193
----
11561194

1157-
.. [#] http://www.docbook.org/
11581195
.. [#] http://daringfireball.net/projects/markdown/
11591196
.. [#] http://github.github.com/github-flavored-markdown/
11601197
.. [#] http://docutils.sourceforge.net/rst.html
@@ -1164,6 +1201,10 @@ ttl为Textile,asc为AsciiDoc,org为Org-mode。
11641201
.. [#] http://orgmode.org/org.html
11651202
.. [#] http://www.mediawiki.org/wiki/Help:Formatting
11661203
.. [#] http://www.wikicreole.org/
1204+
.. [#] DocBook是著名的用于文档撰写的标记语言,采用XML文件格式及大量的面向出版\
1205+
的格式标签,能够实现单一源文件出版(Single-Source Publishing),\
1206+
即一次撰写多种格式输出(Write once, publish many)。但复杂的XML标签给写作\
1207+
过程带来不小的负担。网址:\ http://www.docbook.org/\
11671208
.. [#] http://www.methods.co.nz/asciidoc
11681209
.. [#] https://github.com/mojombo/god/commit/cea00609ca8441c82bc9760ae5eea7d7509d85b3
11691210
.. [#] https://github.com/mojombo/god/issues/1

0 commit comments

Comments
 (0)