You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

wiki_syntax_detailed_textile.html.erb 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  3. <head>
  4. <title>RedmineWikiFormatting</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. <%= stylesheet_link_tag "wiki_syntax_detailed.css" %>
  7. </head>
  8. <body>
  9. <h1><a name="1" class="wiki-page"></a>Wiki 格式設定</h1>
  10. <ul class='toc'>
  11. <li><a href='#2'>連結</a></li>
  12. <ul>
  13. <li><a href='#3'>Redmine 連結</a></li>
  14. <li><a href='#4'>外部連結</a></li>
  15. </ul>
  16. <li><a href='#5'>文字格式設定</a></li>
  17. <ul>
  18. <li><a href='#6'>字型樣式</a></li>
  19. <li><a href='#7'>內嵌圖像</a></li>
  20. <li><a href='#8'>標題</a></li>
  21. <li><a href='#9'>段落</a></li>
  22. <li><a href='#10'>區塊引述</a></li>
  23. <li><a href='#11'>目錄</a></li>
  24. <li><a href='#14'>水平線</a></li>
  25. </ul>
  26. <li><a href='#12'>巨集</a></li>
  27. <li><a href='#13'>程式碼醒目提示</a></li>
  28. </ul>
  29. <h2><a name="2" class="wiki-page"></a>連結</h2>
  30. <h3><a name="3" class="wiki-page"></a>Redmine 連結</h3>
  31. <p>在任何可以使用 Wiki 格式設定的地方, Redmine 都允許在資源 (議題、變更集、 Wiki 頁面...) 間建立超連結。</p>
  32. <ul>
  33. <li>連結至一個議題: <strong>#124</strong> (若該議題已經結束,則使用刪除線顯示連結: <del><a href="#" class="issue" title="bulk edit doesn't change the category or fixed version properties (Closed)">#124</a></del>)</li>
  34. <li>Link to an issue including tracker name and subject: <strong>##124</strong> (displays <a href="#" class="issue" title="bulk edit doesn't change the category or fixed version properties (New)">Bug #124</a>: bulk edit doesn't change the category or fixed version properties)</li>
  35. <li>連結至一個議題的筆記: <strong>#124-6</strong>, 或 <strong>#124#note-6</strong></li>
  36. <li>Link to an issue note within the same issue: <strong>#note-6</strong></li>
  37. </ul>
  38. <p>Wiki 連結:</p>
  39. <ul>
  40. <li><strong>[[Guide]]</strong> 顯示一個頁面名稱為 'Guide' 的連結: <a href="#" class="wiki-page">Guide</a></li>
  41. <li><strong>[[Guide#further-reading]]</strong> 會顯示連結至一個 "further-reading" 的 HTML 錨定 (anchor) 。每個標題文字都會被自動指定一個 HTML 錨定,以便您可以用來連結它們: <a href="#" class="wiki-page">Guide</a></li>
  42. <li><strong>[[#further-reading]]</strong> link to the anchor "further-reading" of the current page: <a href="#" class="wiki-page">#further-reading</a></li>
  43. <li><strong>[[Guide|User manual]]</strong> 使用不同的文字來顯示一個頁面名稱為 'Guide' 的連結: <a href="#" class="wiki-page">User manual</a></li>
  44. </ul>
  45. <p>您也可以連結至其他專案的 Wiki 頁面:</p>
  46. <ul>
  47. <li><strong>[[sandbox:some page]]</strong> 顯示一個 Sanbox wiki 中頁面名稱為 'Some page' 的連結</li>
  48. <li><strong>[[sandbox:]]</strong> 顯示 Sandbox wiki 首頁頁面的連結</li>
  49. </ul>
  50. <p>當頁面不存在的時候, Wiki 連結會以紅色的方式顯示,例如: <a href="#" class="wiki-page new">Nonexistent page</a>.</p>
  51. <p>連結至其他資源:</p>
  52. <ul>
  53. <li>文件:
  54. <ul>
  55. <li><strong>document#17</strong> (連結到編號為 17 的文件)</li>
  56. <li><strong>document:Greetings</strong> (連結至文件標題為 "Greetings" 的文件)</li>
  57. <li><strong>document:"Some document"</strong> (文件標題包含空白字元時可以使用雙引號來標示)</li>
  58. <li><strong>sandbox:document:"Some document"</strong> (連結至另外一個 "sandbox" 專案中,文件標題為 "Some document" 的文件)</li>
  59. </ul></li>
  60. </ul>
  61. <ul>
  62. <li>版本:
  63. <ul>
  64. <li><strong>version#3</strong> (連結至編號為 3 的版本)</li>
  65. <li><strong>version:1.0.0</strong> (連結至名稱為 "1.0.0" 的版本)</li>
  66. <li><strong>version:"1.0 beta 2"</strong> (版本名稱包含空白字元時可以使用雙引號來標示)</li>
  67. <li><strong>sandbox:version:1.0.0</strong> (連結至 "sandbox" 專案中,名稱為 "1.0.0" 的版本)</li>
  68. </ul></li>
  69. </ul>
  70. <ul>
  71. <li>附加檔案:
  72. <ul>
  73. <li><strong>attachment:file.zip</strong> (連結至目前物件中,名稱為 file.zip 的附加檔案)</li>
  74. <li>目前僅提供參考到目前物件中的附加檔案 (若您正位於一個議題中,僅可參考位於此議題中之附加檔案)</li>
  75. </ul></li>
  76. </ul>
  77. <ul>
  78. <li>變更集:
  79. <ul>
  80. <li><strong>r758</strong> (連結至一個變更集)</li>
  81. <li><strong>commit:c6f4d0fd</strong> (使用雜湊碼連結至一個變更集)</li>
  82. <li><strong>svn1|r758</strong> (連結至指定儲存機制中之變更集,用於專案使用多個儲存機制時之情況)</li>
  83. <li><strong>commit:hg|c6f4d0fd</strong> (使用某特定儲存機制中的雜湊碼連結至一個變更集)</li>
  84. <li><strong>sandbox:r758</strong> (連結至其他專案的變更集)</li>
  85. <li><strong>sandbox:commit:c6f4d0fd</strong> (使用其他專案的雜湊碼連結至一個變更集)</li>
  86. </ul></li>
  87. </ul>
  88. <ul>
  89. <li>儲存機制中之檔案:
  90. <ul>
  91. <li><strong>source:some/file</strong> (連結至專案儲存機制中,位於 /some/file 的檔案)</li>
  92. <li><strong>source:some/file@52</strong> (連結至該檔案的 52 版次)</li>
  93. <li><strong>source:some/file#L120</strong> (連結至該檔案的第 120 行)</li>
  94. <li><strong>source:some/file@52#L120</strong> (連結至該檔案的 52 版次中之第 120 行)</li>
  95. <li><strong>source:"some file@52#L120"</strong> (當 URL 中包含空白字元時,使用雙引號來標示)</li>
  96. <li><strong>export:some/file</strong> (強制下載該檔案)</li>
  97. <li><strong>source:svn1|some/file</strong> (連結至指定儲存機制中的該檔案,用於專案使用多個儲存機制時之情況)</li>
  98. <li><strong>sandbox:source:some/file</strong> (連結至 "sandbox" 專案的儲存機制中,位於 /some/file 的檔案)</li>
  99. <li><strong>sandbox:export:some/file</strong> (強迫下載該檔案)</li>
  100. </ul></li>
  101. </ul>
  102. <ul>
  103. <li>論壇:
  104. <ul>
  105. <li><strong>forum#1</strong> (連結至編號為 1 的論壇)</li>
  106. <li><strong>forum:Support</strong> (連結至名稱為 Support 的論壇)</li>
  107. <li><strong>forum:"Technical Support"</strong> (當論壇名稱中包含空白字元時,使用雙引號來標示)</li>
  108. </ul></li>
  109. </ul>
  110. <ul>
  111. <li>論壇訊息:
  112. <ul>
  113. <li><strong>message#1218</strong> (連結至編號為 1218 的訊息)</li>
  114. </ul></li>
  115. </ul>
  116. <ul>
  117. <li>專案:
  118. <ul>
  119. <li><strong>project#3</strong> (連結至編號為 3 的專案)</li>
  120. <li><strong>project:someproject</strong> (連結至名稱為 "someproject" 的專案)</li>
  121. <li><strong>project:"some project"</strong> (當專案名稱中包含空白字元時,使用雙引號來標示)</li>
  122. </ul></li>
  123. </ul>
  124. <ul>
  125. <li>新聞:
  126. <ul>
  127. <li><strong>news#2</strong> (連結至編號為 2 的新聞項目)</li>
  128. <li><strong>news:Greetings</strong> (連結至名稱為 "Greetings" 的新聞項目)</li>
  129. <li><strong>news:"First Release"</strong> (當新聞項目名稱中包含空白字元時,使用雙引號來標示)</li>
  130. </ul></li>
  131. </ul>
  132. <ul>
  133. <li>Users:
  134. <ul>
  135. <li><strong>user#2</strong> (link to user with id 2)</li>
  136. <li><strong>user:jsmith</strong> (Link to user with login jsmith)</li>
  137. <li><strong>@jsmith</strong> (Link to user with login jsmith)</li>
  138. </ul>
  139. </li>
  140. </ul>
  141. <p>逸出字元:</p>
  142. <ul>
  143. <li>您可以在文字的前面加上驚嘆號 (!) 來避免該文字被剖析成 Redmine 連結</li>
  144. </ul>
  145. <h3><a name="4" class="wiki-page"></a>外部連結</h3>
  146. <p>URLs (starting with: www, http, https, ftp, ftps, sftp and sftps) and email addresses are automatically turned into clickable links:</p>
  147. <pre>
  148. http://www.redmine.org, someone@foo.bar
  149. </pre>
  150. <p>會顯示成: <a class="external" href="http://www.redmine.org">http://www.redmine.org</a>, <a href="mailto:someone@foo.bar" class="email">someone@foo.bar</a></p>
  151. <p>若您想要顯示指定的文字而非該 URL ,您可以使用下列標準的 textile 語法:</p>
  152. <pre>
  153. "Redmine web site":http://www.redmine.org
  154. </pre>
  155. <p>會顯示成: <a href="http://www.redmine.org" class="external">Redmine web site</a></p>
  156. <h2><a name="5" class="wiki-page"></a>文字格式設定</h2>
  157. <p>對於諸如標題、粗體、表格、清單等項目, Redmine 支援使用 Textile 語法。可參考 <a class="external" href="http://en.wikipedia.org/wiki/Textile_%28markup_language%29">http://en.wikipedia.org/wiki/Textile_(markup_language)</a> 中關於使用這些格式化功能的說明資訊。 下面包含了一些使用範例,但格式化引擎的處理能力遠多於這些簡單的使用範例。</p>
  158. <h3><a name="6" class="wiki-page"></a>字型樣式</h3>
  159. <pre>
  160. * *粗體*
  161. * _斜體_
  162. * _*粗斜體*_
  163. * +底線+
  164. * -刪除線-
  165. </pre>
  166. <p>會顯示成:</p>
  167. <ul>
  168. <li><strong>粗體</strong></li>
  169. <li><em>斜體</em></li>
  170. <li><em><strong>粗斜體</strong></em></li>
  171. <li><ins>底線</ins></li>
  172. <li><del>刪除線</del></li>
  173. </ul>
  174. <h3><a name="7" class="wiki-page"></a>內嵌圖像</h3>
  175. <ul>
  176. <li><strong>!image_url!</strong> 顯示一個位於 image_url 位址的圖像 (textile 語法)</li>
  177. <li><strong>!&gt;image_url!</strong> 右側浮動圖像</li>
  178. <li>若您附加了一個圖像到 Wiki 頁面中,可以使用他的檔案名稱來顯示成內嵌圖像: <strong>!attached_image.png!</strong></li>
  179. <li>Images in your computer's clipboard can be pasted directly using Ctrl-v or Command-v (note that Internet Explorer is not supported).</li>
  180. <li>Image files can be dragged onto the text area in order to be uploaded and embedded.</li>
  181. </ul>
  182. <h3><a name="8" class="wiki-page"></a>標題</h3>
  183. <pre>
  184. h1. 標題
  185. h2. 次標題
  186. h3. 次次標題
  187. </pre>
  188. <p>Redmine 為每一種標題指定一個 HTML 錨定 (anchor) ,因此您可使用 "#標題" 、 "#次標題" 等方式連結至這些標題。</p>
  189. <h3><a name="9" class="wiki-page"></a>段落</h3>
  190. <pre>
  191. p&gt;. 靠右對齊
  192. p=. 置中對齊
  193. </pre>
  194. <p style="text-align:center;">這是一個置中對齊的段落。</p>
  195. <h3><a name="10" class="wiki-page"></a>區塊引述</h3>
  196. <p>使用 <strong>bq.</strong> 啟動一個區塊引述的段落。</p>
  197. <pre>
  198. bq. Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.
  199. To go live, all you need to add is a database and a web server.
  200. </pre>
  201. <p>顯示為:</p>
  202. <blockquote>
  203. <p>Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.<br />To go live, all you need to add is a database and a web server.</p>
  204. </blockquote>
  205. <h3><a name="11" class="wiki-page"></a>目錄</h3>
  206. <pre>
  207. {{toc}} =&gt; 靠左對齊目錄
  208. {{&gt;toc}} =&gt; 靠右對齊目錄
  209. </pre>
  210. <h3><a name="14" class="wiki-page"></a>水平線</h3>
  211. <pre>
  212. ---
  213. </pre>
  214. <h2><a name="12" class="wiki-page"></a>巨集</h2>
  215. <p>Redmine 內建下列巨集:</p>
  216. <p>
  217. <dl>
  218. <dt><code>hello_world</code></dt>
  219. <dd><p>範例巨集。</p></dd>
  220. <dt><code>macro_list</code></dt>
  221. <dd><p>顯示所有可用巨集的清單,若巨集有提供說明也會一併顯示。</p></dd>
  222. <dt><code>child_pages</code></dt>
  223. <dd><p>顯示子頁面的清單。若未指定參數,它將會顯示目前 Wiki 頁面的子頁面清單。範例:</p>
  224. <pre><code>{{child_pages}} -- 僅可於某 Wiki 頁面中被使用
  225. {{child_pages(depth=2)}} -- 僅顯示兩層巢狀層次</code></pre></dd>
  226. <dt><code>include</code></dt>
  227. <dd><p>引入一個 wiki 頁面。範例:</p>
  228. <pre><code>{{include(Foo)}}</code></pre>
  229. <p>或用以引入某特定專案的 Wiki 頁面:</p>
  230. <pre><code>{{include(projectname:Foo)}}</code></pre></dd>
  231. <dt><code>collapse</code></dt>
  232. <dd><p>插入一個摺疊的文字區塊。範例:</p>
  233. <pre><code>{{collapse(View details...)
  234. This is a block of text that is collapsed by default.
  235. It can be expanded by clicking a link.
  236. }}</code></pre></dd>
  237. <dt><code>thumbnail</code></dt>
  238. <dd><p>顯示可被點擊的附加圖像之縮圖。範例:</p>
  239. <pre>{{thumbnail(image.png)}}
  240. {{thumbnail(image.png, size=300, title=Thumbnail)}}</pre></dd>
  241. <dt><code>issue</code></dt>
  242. <dd><p>Inserts a link to an issue with flexible text. Examples:</p>
  243. <pre>{{issue(123)}} -- Issue #123: Enhance macro capabilities
  244. {{issue(123, project=true)}} -- Andromeda - Issue #123:Enhance macro capabilities
  245. {{issue(123, tracker=false)}} -- #123: Enhance macro capabilities
  246. {{issue(123, subject=false, project=true)}} -- Andromeda - Issue #123</pre></dd>
  247. </dl>
  248. </p>
  249. <h2><a name="13" class="wiki-page"></a>程式碼醒目提示</h2>
  250. <p>Default code highlighting relies on <a href="http://rouge.jneen.net/" class="external">Rouge</a>, a pure Ruby code highlighter. Rouge supports many commonly used languages such as <strong>c</strong>, <strong>cpp</strong> (c++), <strong>csharp</strong> (c#, cs), <strong>css</strong>, <strong>diff</strong> (patch, udiff), <strong>go</strong> (golang), <strong>groovy</strong>, <strong>html</strong>, <strong>java</strong>, <strong>javascript</strong> (js), <strong>kotlin</strong>, <strong>objective_c</strong> (objc), <strong>perl</strong> (pl), <strong>php</strong>, <strong>python</strong> (py), <strong>r</strong>, <strong>ruby</strong> (rb), <strong>sass</strong>, <strong>scala</strong>, <strong>shell</strong> (bash, zsh, ksh, sh), <strong>sql</strong>, <strong>swift</strong>, <strong>xml</strong> and <strong>yaml</strong> (yml) languages - the names inside parentheses are aliases. Please refer to the <a href="<%= help_code_highlighting_path %>" target="_blank">list of languages supported by Redmine code highlighter</a>.</p>
  251. <p>您可載任何支援 Wiki 格式設定的地方,使用這個語法來醒目提示程式碼 (注意語言與其別名的名稱不須區分大小寫):</p>
  252. <pre>
  253. &lt;pre&gt;&lt;code class="ruby"&gt;
  254. 將程式碼放在這裡。
  255. &lt;/code&gt;&lt;/pre&gt;
  256. </pre>
  257. <p>範例:</p>
  258. <pre><code class="ruby syntaxhl"><span class="c1"># The Greeter class</span>
  259. <span class="k">class</span> <span class="nc">Greeter</span>
  260. <span class="k">def</span> <span class="nf">initialize</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
  261. <span class="vi">@name</span> <span class="o">=</span> <span class="nb">name</span><span class="p">.</span><span class="nf">capitalize</span>
  262. <span class="k">end</span>
  263. <span class="k">def</span> <span class="nf">salute</span>
  264. <span class="nb">puts</span> <span class="s2">"Hello </span><span class="si">#{</span><span class="vi">@name</span><span class="si">}</span><span class="s2">!"</span>
  265. <span class="k">end</span>
  266. <span class="k">end</span>
  267. </code></pre>
  268. </body>
  269. </html>