Project

General

Profile

TraditionalChineseWikiFormatting » History » Version 2

chigeon null, 2015-06-09 03:58

1 1 Ben Huang
h1. 文字格式設定
2
3
{{>TOC}}
4
5
h2. 連結
6
7
h3. Redmine 連結
8
9
在任何可以使用文字格式設定的地方,Redmine 都允許在資源(問題、變更集、 Wiki 頁面...)間建立超連結。
10
11
* 連結至一個問題: *!#1* (顯示 #1, 若該問題已結束,則會使用刪除線來顯示連結)
12
* 連結至一個問題的筆記: *!#124-6*, 或 *!#124#note-6*
13
* 連結至一個變更集: *!r758* (顯示 r758)
14
* 連結至一個使用非數字雜湊碼的變更集: *commit:c6f4d0fd* (顯示 c6f4d0fd).
15
16
Wiki 連結:
17
18
* *[[Guide]]* 顯示一個頁面名稱為 'Guide' 的連結: [[Guide]]
19
* *[[Guide|User manual]]* 使用不同的文字來顯示相同頁面的連結: [[Guide|User manual]]
20
* *[[Guide#User-guide|User guide]]* 使用不同的文字來顯示相同頁面中某個標題的連結: [[Guide#User-guide|User guide]]
21
22
您也可以連結至其他專案的 Wiki 頁面(使用專案的代碼):
23
24
* *[[sandbox:some page]]* 顯示 Sanbox 專案 wiki 頁面的一個名為 'Some page' 的連結
25
* *[[sandbox:]]* 顯示 Sandbox 專案 wiki 首頁的連結
26
27
當頁面不存在的時候, Wiki 連結會以紅色的方式顯示,例如: [[Nonexistent page]].
28
29
連結至其他資源:
30
31
* 文件:
32
33
  * *!document#17* (連結到編號為 17 的文件)
34
  * *!document:Greetings* (連結至標題為 "Greetings" 的文件)
35
  * *!document:"Some document"* (文件標題包含空白字元時,可以使用雙引號來標示)
36
  * *!sandbox:document:"Some document"* (連結至 "sandbox" 專案中,標題為 "Some document" 的文件)
37
38
* 版本:
39
40
  * *!version#3* (連結至編號為 3 的版本)
41
  * *!version:1.0.0* (連結至名稱為 "1.0.0" 的版本)
42
  * *!version:"1.0 beta 2"* (版本名稱包含空白字元時,可以使用雙引號來標示)
43
  * *!sandbox:version:1.0.0* (連結至 "sandbox" 專案中,名稱為 "1.0.0" 的版本)
44
45
* 附加檔案:
46
  
47
  * *!attachment:file.zip* (連結至目前物件中,名稱為 file.zip 的附加檔案)
48
  * *!attachment:"some file.zip"* (檔案名稱包含空白字元時,可以使用雙引號來標示)
49
  * 目前, 僅提供參考到目前物件中的附加檔案 (若您正位於一個問題中,僅可參考位於此問題中的附加檔案)
50
51
* 變更集:
52
53
  * *!r758* (連結至一個變更集)
54
  * *!commit:c6f4d0fd* (連結至一個使用非數字雜湊的變更集)
55
  * *!svn1|r758* (連結至指定儲存機制中的變更集,用於使用多個儲存機制的專案)
56
  * *!commit:hg|c6f4d0fd* (連結至指定儲存機制中,使用非數字雜湊的變更集)
57
  * *!sandbox:r758* (連結至其他專案的變更集)
58
  * *!sandbox:commit:c6f4d0fd* (連結至其他專案中,使用非數字雜湊的變更集)
59
60
* 儲存機制中之檔案:
61
62
  * *!source:some/file* (連結至專案儲存機制中,位於 /some/file 的檔案)
63
  * *!source:some/file@52* (連結至此檔案的 52 版次)
64
  * *!source:some/file#L120*  (連結至此檔案的第 120 行)
65
  * *!source:some/file@52#L120*  (連結至此檔案的 52 版次中的第 120 行)
66
  * *!source:"some file@52#L120"* (當 URL 包含空白字元時,可以使用雙引號來標示)
67
(連結至指定儲存機制中的此檔案,用於專案使用多個儲存機制時之情況)
68
  * *!source:repo_identifier|some/file* (連結至其他儲存機制中的檔案,用於使用多個儲存機制的專案)
69
  * *!source:"repo_identifier|some file"* (連結至其他儲存機制中的檔案,有空白字元的檔名)
70
  * *!export:some/file* (強制下載此檔案)
71
 
72
* 論壇:
73
74
  * *!forum#2* (連結至編號為 2 的論壇)
75
  * *!forum:Discussion* (連結至名稱為 "Discussion" 的論壇)
76
  * *!forum:"Help and more"* (當論壇名稱包含空白字元時,可以使用雙引號來標示)
77
78
* 論壇訊息:
79
80
  * *!message#1218* (連結至編號為 1218 的訊息)
81
82
* 新聞項目:
83
84
  * *!news#1* (連結至編號為 1 的新聞項目)
85
  * *!news:Greetings* (連結至名稱為 "Greetings" 的新聞項目)
86
  * *!news:"eCookbook first release !"* (當新聞項目名稱包含空白字元時,可以使用雙引號來標示)
87
88
* 專案:
89
90
  * *!project#3* (連結至編號為 3 的專案)
91
  * *!project:someproject* (連結至名稱為 "someproject" 的專案)
92
  * *!project:"Multiple words project"* (當專案名稱包含空白字元時,可以使用雙引號來標示)
93
94
逸出字元:
95
96
* 您可以在文字的前面加上驚嘆號 (!) 來避免該文字被剖析成 Remine 連結
97
98
h3. 外部連結
99
100
HTTP 連結與電子郵件地址會自動被轉換成可點擊的連結:
101
102
* *http://www.redmine.org* -- 外部連結到 redmine 網站: http://www.redmine.org
103
* *someone@foo.bar* -- 連結到電子郵件地址: someone@foo.bar
104
105
HTTP 連結也可以使用不同的文字來顯示:
106
107
* *"Redmine web site":http://www.redmine.org* -- 使用不同文字的外部連結(標準的 textile 語法): "Redmine web site":http://www.redmine.org
108
* *!http://www.redmine.org/attachments/7069/Redmine_logo.png(Redmine web site)!:http://www.redmine.org* -- 顯示一個帶有標題並連結至 URL 的外部影像:
109
110
p=. !http://www.redmine.org/attachments/7069/Redmine_logo.png(Redmine web site)!:http://www.redmine.org
111
112
h3. 電子郵件地址
113
114
電子郵件地址被自動轉為可點擊的連結:
115
116
* *"Email someone":mailto:someone@foo.bar* -- 以不同文字顯示的電子郵件連結: "Email someone":mailto:someone@foo.bar
117
118
更複雜的電子郵件指令可以被加入到電子郵件連結。可以定義一個預設的主旨,預設的內文和 CC 資訊。請注意,在這些欄位中的任何空白字元需要替換為 %20。
119
120
* *"Email webmaster and admin":mailto:webmaster@foo.bar?cc=admin@foo.bar* -- Email 給 webmaster, CC 給 admin:  "Email webmaster and admin":mailto:webmaster@foo.bar?cc=admin@foo.bar
121
122
* *"Email someone for help":mailto:someone@foo.bar?subject=Website%20Help* -- 帶有主旨 "Website Help" 的電子郵件連結: "Email someone for help":mailto:someone@foo.bar?subject=Website%20Help
123
124
* *"Email someone for help":mailto:someone@foo.bar?subject=Website%20Help&body=My%20problem%20is%20* -- 帶有主旨 "Website Help" 和預設內文的電子郵件連結: "Email someone for help":mailto:someone@foo.bar?subject=Website%20Help&body=My%20problem%20is%20
125
126
h2. 文字格式設定
127
128
對於像是標題、粗體字、表格、清單等項目, Redmine 支援使用 "Textile 語法":http://en.wikipedia.org/wiki/Textile_%28markup_language%29。請參考 http://redcloth.org/hobix.com/textile/ 關於使用這些格式化功能的說明資訊。下面包含了一些使用範例,但格式化引擎的處理能力遠多於這些簡單的使用範例。
129
130
h3. 首字母縮寫字
131
132
<pre>
133
JPL(Jean-Philippe Lang)
134
</pre>
135
136
顯示:
137
138
JPL(Jean-Philippe Lang)
139
140
h3. 字型樣式
141
142
<pre><code>* *bold*
143
* _italic_
144
* *_bold italic_*
145
* +underline+
146
* -strike-through-
147
* Plain ^superscript^
148
* Plain ~subscript~
149
* @inline monospace@
150
* <notextile>normal *bold* _italic_ normal;E=mc ^2^</notextile>
151
* <notextile>normal<notextile></notextile>*bold*<notextile></notextile>_italic_<notextile></notextile>normal;E=mc<notextile></notextile>^2^</notextile>
152
* <notextile>Escaping: <notextile>*bold* _italic_ @inlinemono@</notextile> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Alternative using HTML-codes: &#42;bold&#42; &#95;italic&#95; &#64;inlinemono&#64;</notextile>
153
* <notextile><pre>*some lines*      some "link":http://www.redmine.org</pre></notextile>
154
* <notextile><pre><notextile></notextile>*some lines*      some "link":http://www.redmine.org</pre></notextile>
155
</code></pre>
156
157
顯示:
158
159
 * *bold*
160
 * _italic_
161
 * *_bold italic_*
162
 * +underline+
163
 * -strike-through-
164
 * Plain ^superscript^
165
 * Plain ~subscript~
166
 * @inline monospace@
167
 * normal *bold* _italic_ normal;E=mc ^2^
168
 * normal<notextile></notextile>*bold*<notextile></notextile>_italic_<notextile></notextile>normal;E=mc<notextile></notextile>^2^
169
 * Escaping: <notextile>*bold* _italic_ @inlinemono@</notextile> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Alternative using HTML-codes: &#42;bold&#42; &#95;italic&#95; &#64;inlinemono&#64;
170
 * <pre>*some lines*      some "link":http://www.redmine.org</pre>
171
 * <pre><notextile></notextile>*some lines*      some "link":http://www.redmine.org</pre>
172
173
h3. 顏色
174
175
<pre><code><notextile>* %{color:red}red% %{color:green}green% %{color:yellow}yellow% %{color:#82B6E1}blue'ish%
176
* %{color:red}red%<notextile></notextile>%{color:green}green%<notextile></notextile>%{color:yellow}yellow%<notextile></notextile>%{color:#82B6E1}blue'ish%
177
* %{background:lightgreen}Lightgreen Background% %{background:yellow}Yellow Background%
178
* %{background:lightgreen}Lightgreen Background%<notextile></notextile>%{background:yellow}Yellow Background%
179
</notextile></code></pre>
180
181
顯示:
182
183
 * %{color:red}red% %{color:green}green% %{color:yellow}yellow% %{color:#82B6E1}blue'ish%
184
 * %{color:red}red%<notextile></notextile>%{color:green}green%<notextile></notextile>%{color:yellow}yellow%<notextile></notextile>%{color:#82B6E1}blue'ish%
185
 * %{background:lightgreen}Lightgreen Background% %{background:yellow}Yellow Background%
186
 * %{background:lightgreen}Lightgreen Background%<notextile></notextile>%{background:yellow}Yellow Background%
187
188
h3. Inline 影像
189
190
* *&#33;image_url&#33;* 顯示位於 image_url 的影像(textile syntax)
191
* *&#33;>image_url&#33;* 向右浮動的影像
192
* *&#33;image_url(Image title)&#33;* 顯示具有 alt/title 屬性的影像
193
* *&#33;image_url&#33;:URL* 顯示位於 image_url 的影像,並加入 URL 連結
194
195
如果您有影像檔附加到您的 wiki 頁面,可以使用它的檔案名稱來 inline 顯示: *&#33;attached_image.png&#33;*
196
197
您也可以套用 CSS 樣式到影像,與套用樣式到 SPAN 相同。程式碼 *&#33;{width: 100%}attached_image.png&#33;* 將影像的大小調整為父元素的寬度。
198
199
h3. 標題
200
201
<pre><code>h1. Heading
202
203
h2. Subheading
204
205
h3. Subheading
206
</code></pre>
207
208
Redmine 為每一種標題指定一個 HTML 錨點 (anchor) ,因此您可使用 "#Heading"、"#Subheading" 等方式連結至這些標題。
209
210
h3. 段落
211
212
<pre><code>p. left aligned
213
214
  p(. left ident 1em
215
216
    p((. left ident 2em
217
    as well as for following lines
218
219
                                                                                   p>. right aligned
220
221
                                                                        p)))>. right ident 3em
222
223
                           p=. This is centered paragraph.
224
</code></pre>
225
226
h3. 水平線
227
228
@----@
229
230
顯示:
231
232
----
233
234
h3. 預定義格式
235
236
若要逸出 wiki 語法
237
<pre> <pre> *您的文字將不會變成粗體字* </pre> </pre>
238
239
顯示:
240
241
<pre> *您的文字將不會變成粗體字* </pre>
242
243
h3. 引用文字
244
245
使用 *bq.* 開始一個引文段落:
246
247
<pre><code>bq. Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.
248
To go live, all you need to add is a database and a web server.
249
</code></pre>
250
251
顯示:
252
253
bq. Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.
254
To go live, all you need to add is a database and a web server.
255
256
您也可以在每一行的開頭使用 >,然後堆疊它們進行巢狀的引用:
257
258
<pre>
259
>> Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.
260
>> To go live, all you need to add is a database and a web server.
261
> Great!
262
</pre>
263
264
顯示:
265
266
>>  Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.
267
>>  To go live, all you need to add is a database and a web server.
268
> Great!
269
270
h3. 項目清單
271
272
<pre>
273
* Item 1
274
* Item 2
275
** Item 21
276
** Item 22
277
* Item 3
278
</pre>
279
280
顯示:
281
282
* Item 1
283
* Item 2
284
** Item 21
285
** Item 22
286
* Item 3
287
288
h3. 編號清單
289
290
<pre>
291
# Item 1
292
# Item 2
293
# Item 3
294
## Item 3.1
295
## Item 3.2
296
</pre>
297
298
顯示:
299
300
# Item 1
301
# Item 2
302
# Item 3
303
## Item 3.1
304
## Item 3.2
305
306
h3. 表格
307
308
<pre>
309
|_.UserID      |_.Name          |_.Group     |_. attribute list   |
310
|Starting with | a              |   simple   |row                 |
311
|\3=.IT                                      |<. align left       |
312
|1             |Artur Pirozhkov |/2.Users    |>. align right      |
313
|2             |Vasya Rogov     |=. center   |
314
|3             |John Smith      |Admin
315
                                 (root)      |^. valign top       |
316
|4             |-               |Nobody
317
                                 (anonymous) |~. valign bottom    |
318
</pre>
319
320
顯示 (所有多個空白字元將被取代為一個空白):
321
322
|_.UserID      |_.Name          |_.Group     |_. attribute list   |
323
|Starting with | a              |   simple   |row                 |
324
|\3=.IT                                      |<. align left       |
325
|1             |Artur Pirozhkov |/2.Users    |>. align right      |
326
|2             |Vasya Rogov     |=. center   |
327
|3             |John Smith      |Admin
328
                                 (root)      |^. valign top       |
329
|4             |-               |Nobody
330
                                 (anonymous) |~. valign bottom    |
331
332
如果您要在你表格中(例如,wiki 連結)包含管線字元(|),您必須防止 textile 解譯它們:
333
334
|_.Input |_. Output|
335
|*<notextile><notextile>|</notextile></notextile>*|<notextile>|</notextile>|
336
337
h3. 目錄
338
339
<pre><code>{{toc}} => 靠左對齊目錄
340
{{>toc}} => 靠右對齊目錄
341
</code></pre>
342
343
請記得,toc 標記的上一行和下一行必須是空白行,而且它的前後不能有其它文字。
344
345
範例:
346
347
<pre><code>
348
h1. headLineOne
349
350
h2. something
351
352
{{toc}}
353
354
h2. something more
355
</code></pre>
356
357
h2. 巨集
358
359 2 chigeon null
Redmine 包含一個巨集系統,允許您加入自訂函數,以在格式化文字中插入動態內容。您可以學習編寫您自己的巨集,在  "RedmineMacros":http://www.redmine.org/projects/redmine/wiki/RedmineMacros 。Redmine 已包含幾個內建巨集:
360 1 Ben Huang
361
362
{{macro_list}}
363
364
h2. 程式碼高亮度顯示
365
366
程式碼高亮度顯示依賴 "CodeRay":http://coderay.rubychan.de/,它是一個快速語法高亮度顯示的程式庫,完全以 Ruby 所編寫的。它目前支援 C, C++, CSS, Delphi, Diff, Groovy, HTML, Java, Javascript, JSON, Nitro-XHTML, PHP, Python, RHTML, Ruby, Scheme, SQL, XML 和 YAML 程式碼。
367
368
您可以在您的 wiki 頁面中高亮度顯示程式碼,使用以下的語法:
369
370
<pre><code><pre><code class="ruby">
371
  Place your code here.
372
</code></pre>
373
</code></pre>
374
375
範例:
376
377
<pre><code class="ruby">
378
# The Greeter class
379
class Greeter
380
  def initialize(name)
381
    @name = name.capitalize
382
  end
383
 
384
  def salute
385
    puts "Hello #{@name}!"
386
  end
387
end
388
</code></pre>
389
390
h2. Textile 格式化
391
392
Redmine 支援 textile 格式化。詳細資訊請參閱 "Textile syntax":http://en.wikipedia.org/wiki/Textile_%28markup_language%29
393
394
額外支援的 textiles:
395
* *<notextile>%</notextile>{background:lightgreen}綠色背景%* 顯示 %{background:lightgreen}綠色背景%