專案

一般

設定檔

動作

文字格式設定

連結

Redmine 連結

在 Redmine 中任何可以使用文字格式設定的地方,都允許在資源(議題、變更集、Wiki 頁面...)之間建立超連結。

  • 連結至一個議題: #1 (顯示 #1,如果該議題已結束,則會使用刪除線來顯示連結)
  • 連結至一個議題的筆記: #124-6,或 #124#note-6
  • 連結至一個變更集: r758 (顯示 r758)
  • 連結至一個使用非數字雜湊碼的變更集: commit:c6f4d0fd (顯示 c6f4d0fd)。

Wiki 連結

  • [[指南]] 顯示一個頁面名稱為 '指南' 的連結: 指南
  • [[指南|使用者手冊]] 使用不同的文字來顯示相同頁面的連結: 使用者手冊
  • [[指南#使用者指南|使用者指南]] 使用不同的文字來顯示相同頁面中某個標題的連結: 使用者指南

您也可以連結至其他專案的 Wiki 頁面(使用專案的代碼):

  • [[sandbox:某個頁面]] 顯示 Sandbox 專案 wiki 頁面的一個名為 '某個頁面' 的連結
  • [[sandbox:]] 顯示 Sandbox 專案 wiki 首頁的連結

當頁面不存在的時候,Wiki 連結會以紅色的方式顯示,例如: 不存在的頁面

連結至其他資源:

  • 檔案:
    • document#17 (連結到編號為 17 的檔案)
    • document:問候語 (連結至標題為 "問候語" 的檔案)
    • document:"某個文件" (文件標題包含空白字元時,可以使用雙引號來標示)
    • sandbox:document:"某個文件" (連結至 "sandbox" 專案中,標題為 "某個文件" 的檔案)
  • 版本:
    • version#3 (連結至編號為 3 的版本)
    • version:1.0.0 (連結至名稱為 "1.0.0" 的版本)
    • version:"1.0 beta 2" (版本名稱包含空白字元時,可以使用雙引號來標示)
    • sandbox:version:1.0.0 (連結至 "sandbox" 專案中,名稱為 "1.0.0" 的版本)
  • 附件:
    • attachment:file.zip (連結至目前物件中,名稱為 file.zip 的附件)
    • attachment:"某個檔案.zip" (檔案名稱包含空白字元時,可以使用雙引號來標示)
    • 目前,僅提供參考到目前物件中的附件(如果您正位於一個議題中,僅可參考位於此議題中的附件)
  • 變更集:
    • r758 (連結至一個變更集)
    • commit:c6f4d0fd (連結至一個使用非數字雜湊的變更集)
    • svn1|r758 (連結至指定版本庫中的變更集,用於使用多個版本庫的專案)
    • commit:hg|c6f4d0fd (連結至指定版本庫中,使用非數字雜湊的變更集)
    • sandbox:r758 (連結至其他專案的變更集)
    • sandbox:commit:c6f4d0fd (連結至其他專案中,使用非數字雜湊的變更集)
  • 版本庫中的檔案:
    • source:some/file (連結至專案版本庫中,位於 /some/file 的檔案)
    • source:some/file@52 (連結至此檔案的 52 版次)
    • source:some/file#L120 (連結至此檔案的第 120 行)
    • source:some/file@52#L120 (連結至此檔案的 52 版次中的第 120 行)
    • source:"some file@52#L120" (當 URL 包含空白字元時,可以使用雙引號來標示)
      (連結至指定版本庫中的此檔案,用於專案使用多個版本庫時的情況)
    • source:repo_identifier|some/file (連結至其他版本庫中的檔案,用於使用多個版本庫的專案)
    • source:"repo_identifier|some file" (連結至其他版本庫中的檔案,有空白字元的檔名)
    • export:some/file (強制下載此檔案)
  • 論壇:
    • forum#2 (連結至編號為 2 的論壇)
    • forum:討論區 (連結至名稱為「討論區」的論壇)
    • forum:"說明與更多" (當論壇名稱包含空白字元時,可以使用雙引號來標示)
  • 論壇訊息:
    • message#1218 (連結至編號為 1218 的訊息)
  • 新聞項目:
    • news#1 (連結至編號為 1 的新聞項目)
    • news:問候語 (連結至名稱為「問候語」的新聞項目)
    • news:"eCookbook 首次發佈!" (當新聞項目名稱包含空白字元時,可以使用雙引號來標示)
  • 專案:
    • project#3 (連結至編號為 3 的專案)
    • project:某個專案 (連結至名稱為「某個專案」的專案)
    • project:"多個字詞的專案" (當專案名稱包含空白字元時,可以使用雙引號來標示)

跳脫字元:

  • 您可以在文字的前面加上驚嘆號(!)來避免該文字被剖析成 Remine 連結

外部連結

HTTP 連結與電子郵件地址會自動被轉換成可點擊的連結:

HTTP 連結也可以使用不同的文字來顯示:

  • "Redmine 網站":https://redmine.dev.org.tw -- 使用不同文字的外部連結(標準的 textile 語法): Redmine 網站
  • !https://redmine.dev.org.tw/attachments/7069/Redmine_logo.png(Redmine 網站)!:https://redmine.dev.org.tw -- 顯示一個帶有標題並連結至 URL 的外部影像:

Redmine web site

電子郵件地址

電子郵件地址被自動轉為可點擊的連結:

更複雜的電子郵件指令可以被加入到電子郵件連結。可以定義一個預設的主旨、預設的內文和 CC 資訊。請注意,在這些欄位中的任何空白字元需要替換為 %20。

  • "寄送電子郵件給某人尋求幫助":mailto:someone@foo.bar?subject=網站%20協助&body=我的%20問題%20是%20 -- 帶有主旨「網站協助」和預設內文的電子郵件連結: 寄送電子郵件給某人尋求幫助

文字格式設定

對於像是標題、粗體字、表格、清單等項目,Redmine 支援使用 Textile 語法 http://redcloth.org/hobix.com/textile/ 關於使用這些格式化功能的說明資訊。下面包含了一些使用範例,但格式化引擎的處理能力遠多於這些簡單的使用範例。

首字母縮寫字

JPL(Jean-Philippe Lang)

顯示:

JPL

字型樣式

* *bold*
* _italic_
* *_bold italic_*
* +underline+
* -strike-through-
* Plain ^superscript^
* Plain ~subscript~
* @inline monospace@
* normal *bold* _italic_ normal;E=mc ^2^
* normal<notextile></notextile>*bold*<notextile></notextile>_italic_<notextile></notextile>normal;E=mc<notextile></notextile>^2^
* Escaping: <notextile>*bold* _italic_ @inlinemono@</notextile> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Alternative using HTML-codes: &#42;bold&#42; &#95;italic&#95; &#64;inlinemono&#64;
* <pre>*some lines*      some "link":https://redmine.dev.org.tw</pre>
* <pre><notextile></notextile>*some lines*      some "link":https://redmine.dev.org.tw</pre>

顯示:

  • 粗體
  • 斜體
  • 粗斜體
  • 底線
  • 刪除線
  • 一般 上標
  • 一般 下標
  • inline 等寬字體
  • 一般 粗體 斜體 一般;E=mc 2
  • 一般粗體斜體一般;E=mc2
  • 跳脫:*粗體* _斜體_ @inline 等寬字體@       使用 HTML 代碼的替代方案:*粗體* _斜體_ @inline 等寬字體@
  • *some lines*      some "link":https://redmine.dev.org.tw
  • some lines      some link

顏色

* %{color:red}red% %{color:green}green% %{color:yellow}yellow% %{color:#82B6E1}blue'ish%
* %{color:red}red%<notextile></notextile>%{color:green}green%<notextile></notextile>%{color:yellow}yellow%<notextile></notextile>%{color:#82B6E1}blue'ish%
* %{background:lightgreen}Lightgreen Background% %{background:yellow}Yellow Background%
* %{background:lightgreen}Lightgreen Background%<notextile></notextile>%{background:yellow}Yellow Background%

顯示:

  • 紅色 綠色 黃色 藍色
  • 紅色綠色黃色藍色
  • 淺綠色背景 黃色背景
  • 淺綠色背景黃色背景

Inline 影像

  • !image_url! 顯示位於 image_url 的影像(textile 語法)
  • !>image_url! 向右浮動的影像
  • !image_url(影像標題)! 顯示具有 alt/title 屬性的影像
  • !image_url!:URL 顯示位於 image_url 的影像,並加入 URL 連結

如果您有影像檔附加到您的 wiki 頁面,可以使用它的檔案名稱來 inline 顯示: !attached_image.png!

您也可以套用 CSS 樣式到影像,與套用樣式到 SPAN 相同。程式碼 !{width: 100%}attached_image.png! 將影像的大小調整為父元素的寬度。

標題

h1. Heading

h2. Subheading

h3. Subheading

Redmine 為每一種標題指定一個 HTML 錨點 (anchor),因此您可使用「#標題」、「#副標題」等方式連結至這些標題。

段落

p. left aligned

  p(. left ident 1em

    p((. left ident 2em
    as well as for following lines

                                                                                   p>. right aligned

                                                                        p)))>. right ident 3em

                           p=. This is centered paragraph.

水平線

----

顯示:


預定義格式

若要跳脫 wiki 語法

 <pre> *您的文字將不會變成粗體字* </pre> 

顯示:

 *您的文字將不會變成粗體字* 

引用文字

使用 bq. 開始一個引文段落:

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.

顯示:

Rails 是一個全端框架,用於根據模型 - 視圖 - 控制器模式開發資料庫支援的網路應用程式。
要上線,您只需要添加一個資料庫和一個網路伺服器。

您也可以在每一行的開頭使用 >,然後堆疊它們進行巢狀的引用:

>> 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.
> Great!

顯示:

Rails 是一個全端框架,用於根據模型 - 視圖 - 控制器模式開發資料庫支援的網路應用程式。
要上線,您只需要添加一個資料庫和一個網路伺服器。

太好了!

項目清單

* Item 1
* Item 2
** Item 21
** Item 22
* Item 3

顯示:

  • 項目 1
  • 項目 2
    • 項目 2.1
    • 項目 2.2
  • 項目 3

編號清單

# Item 1
# Item 2
# Item 3
## Item 3.1
## Item 3.2

顯示:

  1. 項目 1
  2. 項目 2
  3. 項目 3
    1. 項目 3.1
    2. 項目 3.2

表格

|_.UserID      |_.Name          |_.Group     |_. attribute list   |
|Starting with | a              |   simple   |row                 |
|\3=.IT                                      |<. align left       |
|1             |Artur Pirozhkov |/2.Users    |>. align right      |
|2             |Vasya Rogov     |=. center   |
|3             |John Smith      |Admin
                                 (root)      |^. valign top       |
|4             |-               |Nobody
                                 (anonymous) |~. valign bottom    |

顯示(所有多個空白字元將被取代為一個空白):

使用者 ID 姓名 群組 屬性清單
從…開始 一個 簡單的
IT 靠左對齊
1 Artur Pirozhkov 使用者 靠右對齊
2 Vasya Rogov 置中
3 John Smith 管理員
(根目錄)
頂端對齊
4 - 沒有人
(匿名使用者)
底部對齊

如果您要在表格中(例如,wiki 連結)包含管線字元 (|),您必須防止 textile 解譯它們:

輸入 輸出
<notextile>|</notextile> |

目錄

{{toc}} => 靠左對齊目錄
{{>toc}} => 靠右對齊目錄

請記得,toc 標記的上一行和下一行必須是空白行,而且它的前後不能有其它文字。

範例:


h1. headLineOne

h2. something

{{toc}}

h2. something more

巨集

Redmine 包含一個巨集系統,允許您加入自訂函數,以在格式化文字中插入動態內容。您可以學習編寫您自己的巨集,在 RedmineMacros。Redmine 已包含幾個內建巨集:

hello_world
Sample macro.
macro_list
Displays a list of all available macros, including description if available.
child_pages
Displays a list of child pages. With no argument, it displays the child pages of the current wiki page. Examples:

{{child_pages}} -- can be used from a wiki page only
{{child_pages(depth=2)}} -- display 2 levels nesting only
{{child_pages(Foo)}} -- lists all children of page Foo
{{child_pages(Foo, parent=1)}} -- same as above with a link to page Foo
include
Includes a wiki page. Examples:

{{include(Foo)}}
{{include(projectname:Foo)}} -- to include a page of a specific project wiki
collapse
Inserts of collapsed block of text. Examples:

{{collapse
This is a block of text that is collapsed by default.
It can be expanded by clicking a link.
}}

{{collapse(View details...)
With custom link text.
}}
thumbnail
Displays a clickable thumbnail of an attached image.
Default size is 200 pixels. Examples:

{{thumbnail(image.png)}}
{{thumbnail(image.png, size=300, title=Thumbnail)}} -- with custom title and size
issue
Displays an issue link including additional information. Examples:

{{issue(123)}}                              -- Issue #123: Enhance macro capabilities
{{issue(123, project=true)}}                -- Andromeda - Issue #123: Enhance macro capabilities
{{issue(123, tracker=false)}}               -- #123: Enhance macro capabilities
{{issue(123, subject=false, project=true)}} -- Andromeda - Issue #123
sample_macro
Sample macro

程式碼高亮度顯示

程式碼高亮度顯示依賴 CodeRay Ruby 所編寫的。它目前支援 C、C++、CSS、Delphi、Diff、Groovy、HTML、Java、Javascript、JSON、Nitro-XHTML、PHP、Python、RHTML、Ruby、Scheme、SQL、XML 和 YAML 程式碼。

您可以在您的 wiki 頁面中高亮度顯示程式碼,使用以下的語法:

<pre><code class="ruby">
  Place your code here.
</code></pre>

範例:

# The Greeter class
class Greeter
  def initialize(name)
    @name = name.capitalize
  end

  def salute
    puts "Hello #{@name}!" 
  end
end

Textile 格式化

Redmine 支援 textile 格式化。詳細資訊請參閱 Textile 語法

額外支援的 textiles:
  • %{background:lightgreen}綠色背景% 顯示 綠色背景

chigeon null大約 9 年 前更新 · 2 個版本