Wiki 文本格式

链接

Redmine 链接

在任何使用文本格式的地方,Redmine都允许在资源(问题、变更、wiki页面...)间建立超链接。

Wiki链接

您也可以链接到其他项目的Wiki页面(使用项目标识):

当页面不存在的时候,Wiki链接会以红色来显示,例如: Nonexistent page.

链接至其他资源:

转义字符:

外部链接

URLs (starting with: www, http, https, ftp, ftps, sftp and sftps) and email addresses are automatically turned into clickable links:

http://www.redmine.org, someone@foo.bar

显示为: http://www.redmine.org, someone@foo.bar

如果您想要显示指定的文本而不是链接,您可以通过下列标准的 textile 语法:

"Redmine 官网":http://www.redmine.org

显示为: Redmine 官网

字体格式

对于像是标题、粗体、表格、列表等文字格式, Redmine 支持使用 http://en.wikipedia.org/wiki/Textile_(markup_language) 查找关于使用这些特性的信息。下面将展示其中的一些常用的语法。

字体风格

* *粗体*
* _斜体_
* _*粗体 斜体*_
* +下划线+
* -中划线-

显示为:

内嵌图片

标题

h1. 一级标题
h2. 二级标题
h3. 三级标题

你可以使用“#一级标题”、“#二级标题”等等来链接到这些标题

段落

p>. 向右对齐
p=. 居中

这是一个居中对齐的段落

引用文字

在段落前加上 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 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.

目录

{{toc}} => 靠左对齐目录
{{>toc}} => 靠右对齐目录

水平线

---

Redmine内建了以下宏:

hello_world

宏示例.

macro_list

显示所有可用的宏列表,如果该宏有提供说明也会一并显示。

child_pages

显示一个子页面列表。默认显示当前Wiki页面的所有子页面。 示例:

{{child_pages}} -- 只能在Wiki页面调用
{{child_pages(depth=2)}} -- 显示两级子页面
include

引用一个Wiki页面。示例:

{{include(Foo)}}

或者引用一个指定项目的Wiki页面:

{{include(projectname:Foo)}}
collapse

插入一个折叠文本块。示例:

{{collapse(View details...)
这是一个默认折叠的文本块。
点击链接后将会展开此文本块.
}}
thumbnail

显示一个图像附件的可点击缩略图。示例:

{{thumbnail(image.png)}}
{{thumbnail(image.png, size=300, title=Thumbnail)}}

代码高亮

Default code highlightment relies on CodeRay, a fast syntax highlighting library written completely in Ruby. It currently supports 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) languages, where the names inside parentheses are aliases.

You can highlight code at any place that supports wiki formatting using this syntax (note that the language name or alias is case-insensitive):

<pre><code class="ruby">
  这里写 Ruby 代码
</code></pre>

示例:

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

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