<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>RedmineWikiFormatting</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <style type="text/css"> body { font:80% Verdana,Tahoma,Arial,sans-serif; } h1, h2, h3, h4 { font-family: Trebuchet MS,Georgia,"Times New Roman",serif; } pre, code { font-size:120%; } pre code { font-size:100%; } pre { margin: 1em 1em 1em 1.6em; padding: 2px; background-color: #fafafa; border: 1px solid #e2e2e2; width: auto; overflow-x: auto; overflow-y: hidden; } a.new { color: #b73535; } .syntaxhl .class { color:#258; font-weight:bold } .syntaxhl .comment { color:#385; } .syntaxhl .delimiter { color:black } .syntaxhl .function { color:#06B; font-weight:bold } .syntaxhl .inline { background-color: hsla(0,0%,0%,0.07); color: black } .syntaxhl .inline-delimiter { font-weight: bold; color: #666 } .syntaxhl .instance-variable { color:#33B } .syntaxhl .keyword { color:#939; font-weight:bold } .syntaxhl .string .content { color: #46a } .syntaxhl .string .delimiter { color:#46a } </style> </head> <body> <h1><a name="1" class="wiki-page"></a>Wiki 格式設定</h1> <h2><a name="2" class="wiki-page"></a>連結</h2> <h3><a name="3" class="wiki-page"></a>Redmine 連結</h3> <p>在任何可以使用 Wiki 格式設定的地方, Redmine 都允許在資源 (議題、變更集、 Wiki 頁面...) 間建立超連結。</p> <ul> <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> <li>連結至一個議題的筆記: <strong>#124-6</strong>, 或 <strong>#124#note-6</strong></li> </ul> <p>Wiki 連結:</p> <ul> <li><strong>[[Guide]]</strong> 顯示一個頁面名稱為 'Guide' 的連結: <a href="#" class="wiki-page">Guide</a></li> <li><strong>[[Guide#further-reading]]</strong> 會顯示連結至一個 "further-reading" 的 HTML 錨定 (anchor) 。每個標題文字都會被自動指定一個 HTML 錨定,以便您可以用來連結它們: <a href="#" class="wiki-page">Guide</a></li> <li><strong>[[Guide|User manual]]</strong> 使用不同的文字來顯示一個頁面名稱為 'Guide' 的連結: <a href="#" class="wiki-page">User manual</a></li> </ul> <p>您也可以連結至其他專案的 Wiki 頁面:</p> <ul> <li><strong>[[sandbox:some page]]</strong> 顯示一個 Sanbox wiki 中頁面名稱為 'Some page' 的連結</li> <li><strong>[[sandbox:]]</strong> 顯示 Sandbox wiki 首頁頁面的連結</li> </ul> <p>當頁面不存在的時候, Wiki 連結會以紅色的方式顯示,例如: <a href="#" class="wiki-page new">Nonexistent page</a>.</p> <p>連結至其他資源:</p> <ul> <li>文件: <ul> <li><strong>document#17</strong> (連結到編號為 17 的文件)</li> <li><strong>document:Greetings</strong> (連結至文件標題為 "Greetings" 的文件)</li> <li><strong>document:"Some document"</strong> (文件標題包含空白字元時可以使用雙引號來標示)</li> <li><strong>sandbox:document:"Some document"</strong> (連結至另外一個 "sandbox" 專案中,文件標題為 "Some document" 的文件)</li> </ul></li> </ul> <ul> <li>版本: <ul> <li><strong>version#3</strong> (連結至編號為 3 的版本)</li> <li><strong>version:1.0.0</strong> (連結至名稱為 "1.0.0" 的版本)</li> <li><strong>version:"1.0 beta 2"</strong> (版本名稱包含空白字元時可以使用雙引號來標示)</li> <li><strong>sandbox:version:1.0.0</strong> (連結至 "sandbox" 專案中,名稱為 "1.0.0" 的版本)</li> </ul></li> </ul> <ul> <li>附加檔案: <ul> <li><strong>attachment:file.zip</strong> (連結至目前物件中,名稱為 file.zip 的附加檔案)</li> <li>目前僅提供參考到目前物件中的附加檔案 (若您正位於一個議題中,僅可參考位於此議題中之附加檔案)</li> </ul></li> </ul> <ul> <li>變更集: <ul> <li><strong>r758</strong> (連結至一個變更集)</li> <li><strong>commit:c6f4d0fd</strong> (使用雜湊碼連結至一個變更集)</li> <li><strong>svn1|r758</strong> (連結至指定儲存機制中之變更集,用於專案使用多個儲存機制時之情況)</li> <li><strong>commit:hg|c6f4d0fd</strong> (使用某特定儲存機制中的雜湊碼連結至一個變更集)</li> <li><strong>sandbox:r758</strong> (連結至其他專案的變更集)</li> <li><strong>sandbox:commit:c6f4d0fd</strong> (使用其他專案的雜湊碼連結至一個變更集)</li> </ul></li> </ul> <ul> <li>儲存機制中之檔案: <ul> <li><strong>source:some/file</strong> (連結至專案儲存機制中,位於 /some/file 的檔案)</li> <li><strong>source:some/file@52</strong> (連結至該檔案的 52 版次)</li> <li><strong>source:some/file#L120</strong> (連結至該檔案的第 120 行)</li> <li><strong>source:some/file@52#L120</strong> (連結至該檔案的 52 版次中之第 120 行)</li> <li><strong>source:"some file@52#L120"</strong> (當 URL 中包含空白字元時,使用雙引號來標示)</li> <li><strong>export:some/file</strong> (強制下載該檔案)</li> <li><strong>source:svn1|some/file</strong> (連結至指定儲存機制中的該檔案,用於專案使用多個儲存機制時之情況)</li> <li><strong>sandbox:source:some/file</strong> (連結至 "sandbox" 專案的儲存機制中,位於 /some/file 的檔案)</li> <li><strong>sandbox:export:some/file</strong> (強迫下載該檔案)</li> </ul></li> </ul> <ul> <li>論壇: <ul> <li><strong>forum#1</strong> (連結至編號為 1 的論壇)</li> <li><strong>forum:Support</strong> (連結至名稱為 Support 的論壇)</li> <li><strong>forum:"Technical Support"</strong> (當論壇名稱中包含空白字元時,使用雙引號來標示)</li> </ul></li> </ul> <ul> <li>論壇訊息: <ul> <li><strong>message#1218</strong> (連結至編號為 1218 的訊息)</li> </ul></li> </ul> <ul> <li>專案: <ul> <li><strong>project#3</strong> (連結至編號為 3 的專案)</li> <li><strong>project:someproject</strong> (連結至名稱為 "someproject" 的專案)</li> <li><strong>project:"some project"</strong> (當專案名稱中包含空白字元時,使用雙引號來標示)</li> </ul></li> </ul> <ul> <li>新聞: <ul> <li><strong>news#2</strong> (連結至編號為 2 的新聞項目)</li> <li><strong>news:Greetings</strong> (連結至名稱為 "Greetings" 的新聞項目)</li> <li><strong>news:"First Release"</strong> (當新聞項目名稱中包含空白字元時,使用雙引號來標示)</li> </ul></li> </ul> <p>逸出字元:</p> <ul> <li>您可以在文字的前面加上驚嘆號 (!) 來避免該文字被剖析成 Redmine 連結</li> </ul> <h3><a name="4" class="wiki-page"></a>外部連結</h3> <p>HTTP URLs 與電子郵件地址會自動被轉換成可被點擊的連結:</p> <pre> http://www.redmine.org, someone@foo.bar </pre> <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> <p>若您想要顯示指定的文字而非該 URL ,您可以使用下列標準的 textile 語法:</p> <pre> "Redmine web site":http://www.redmine.org </pre> <p>會顯示成: <a href="http://www.redmine.org" class="external">Redmine web site</a></p> <h2><a name="5" class="wiki-page"></a>文字格式設定</h2> <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> <h3><a name="6" class="wiki-page"></a>字型樣式</h3> <pre> * *粗體* * _斜體_ * _*粗斜體*_ * +底線+ * -刪除線- </pre> <p>會顯示成:</p> <ul> <li><strong>粗體</strong></li> <li><em>斜體</em></li> <li><em><strong>粗斜體</strong></em></li> <li><ins>底線</ins></li> <li><del>刪除線</del></li> </ul> <h3><a name="7" class="wiki-page"></a>內嵌圖像</h3> <ul> <li><strong>!image_url!</strong> 顯示一個位於 image_url 位址的圖像 (textile 語法)</li> <li><strong>!>image_url!</strong> 右側浮動圖像</li> <li>若您附加了一個圖像到 Wiki 頁面中,可以使用他的檔案名稱來顯示成內嵌圖像: <strong>!attached_image.png!</strong></li> </ul> <h3><a name="8" class="wiki-page"></a>標題</h3> <pre> h1. 標題 h2. 次標題 h3. 次次標題 </pre> <p>Redmine 為每一種標題指定一個 HTML 錨定 (anchor) ,因此您可使用 "#標題" 、 "#次標題" 等方式連結至這些標題。</p> <h3><a name="9" class="wiki-page"></a>段落</h3> <pre> p>. 靠右對齊 p=. 置中對齊 </pre> <p style="text-align:center;">這是一個置中對齊的段落。</p> <h3><a name="10" class="wiki-page"></a>區塊引述</h3> <p>使用 <strong>bq.</strong> 啟動一個區塊引述的段落。</p> <pre> bq. Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern. To go live, all you need to add is a database and a web server. </pre> <p>顯示為:</p> <blockquote> <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> </blockquote> <h3><a name="11" class="wiki-page"></a>目錄</h3> <pre> {{toc}} => 靠左對齊目錄 {{>toc}} => 靠右對齊目錄 </pre> <h3><a name="14" class="wiki-page"></a>水平線</h3> <pre> --- </pre> <h2><a name="12" class="wiki-page"></a>巨集</h2> <p>Redmine 內建下列巨集:</p> <p> <dl> <dt><code>hello_world</code></dt> <dd><p>範例巨集。</p></dd> <dt><code>macro_list</code></dt> <dd><p>顯示所有可用巨集的清單,若巨集有提供說明也會一併顯示。</p></dd> <dt><code>child_pages</code></dt> <dd><p>顯示子頁面的清單。若未指定參數,它將會顯示目前 Wiki 頁面的子頁面清單。範例:</p> <pre><code>{{child_pages}} -- 僅可於某 Wiki 頁面中被使用 {{child_pages(depth=2)}} -- 僅顯示兩層巢狀層次</code></pre></dd> <dt><code>include</code></dt> <dd><p>引入一個 wiki 頁面。範例:</p> <pre><code>{{include(Foo)}}</code></pre> <p>或用以引入某特定專案的 Wiki 頁面:</p> <pre><code>{{include(projectname:Foo)}}</code></pre></dd> <dt><code>collapse</code></dt> <dd><p>插入一個摺疊的文字區塊。範例:</p> <pre><code>{{collapse(View details...) This is a block of text that is collapsed by default. It can be expanded by clicking a link. }}</code></pre></dd> <dt><code>thumbnail</code></dt> <dd><p>顯示可被點擊的附加圖像之縮圖。範例:</p> <pre>{{thumbnail(image.png)}} {{thumbnail(image.png, size=300, title=Thumbnail)}}</pre></dd> </dl> </p> <h2><a name="13" class="wiki-page"></a>程式碼醒目提示</h2> <p>預設使用 <a href="http://coderay.rubychan.de/" class="external">CodeRay</a> 作為程式碼醒目提示的機制,它是一個使用 Ruby 撰寫的語法醒目提示函式庫。目前支援 c, clojure, cpp (c++, cplusplus), css, delphi (pascal), diff (patch), erb (eruby, rhtml), go, groovy, haml, html (xhtml), java, javascript (ecmascript, ecma_script, java_script, js), json, lua, php, python, ruby (irb), sass, sql, taskpaper, text (plain, plaintext), xml and yaml (yml) 等語言,括弧中的名稱是該語言的別名。</p> <p>您可載任何支援 Wiki 格式設定的地方,使用這個語法來醒目提示程式碼 (注意語言與其別名的名稱不須區分大小寫):</p> <pre> <pre><code class="ruby"> 將程式碼放在這裡。 </code></pre> </pre> <p>範例:</p> <pre><code class="ruby syntaxhl"><span class="CodeRay"><span class="comment"># The Greeter class</span> <span class="keyword">class</span> <span class="class">Greeter</span> <span class="keyword">def</span> <span class="function">initialize</span>(name) <span class="instance-variable">@name</span> = name.capitalize <span class="keyword">end</span> <span class="keyword">def</span> <span class="function">salute</span> puts <span class="string"><span class="delimiter">"</span><span class="content">Hello </span><span class="inline"><span class="inline-delimiter">#{</span><span class="instance-variable">@name</span><span class="inline-delimiter">}</span></span><span class="content">!</span><span class="delimiter">"</span></span> <span class="keyword">end</span> <span class="keyword">end</span></span></code> </pre> </body> </html>