Wiki 文本格式
链接
Redmine 链接
在任何使用文本格式的地方,Redmine都允许在资源(问题、变更、wiki页面...)间建立超链接。
- 链接至一个问题: #124 (显示
#124,若该问题已结束则会用删除线来表示)
- Link to an issue including tracker name and subject: ##124 (displays Bug #124: bulk edit doesn't change the category or fixed version properties)
- 链接至一个问题的说明: #124-6, 或者 #124#note-6
- Link to an issue note within the same issue: #note-6
Wiki链接
- [[Guide]] 显示一个页面名为'Guide'的链接: Guide
- [[Guide#further-reading]] 链接到页面内的"further-reading"标签. 每个标题都会自动绑定一个标签,方便您进行链接: Guide
- [[#further-reading]] link to the anchor "further-reading" of the current page: #further-reading
- [[Guide|User manual]] 使用不同的文字来显示一个页面名称为'Guide'的链接: User manual
您也可以链接到其他项目的Wiki页面(使用项目标识):
- [[sandbox:some page]] 显示Sandbox项目wiki页面的一个名为'Some page'的链接
- [[sandbox:]] 显示Sandbox项目wiki首页的链接
当页面不存在的时候,Wiki链接会以红色来显示,例如: Nonexistent page.
链接至其他资源:
- 文档:
- document#17 (链接到id为17的文档)
- document:Greetings (链接到标题为“Greeting”的文档)
- document:"Some document" (文档标题包含空格时使用双引号来表示)
- sandbox:document:"Some document" (链接至sandbox项目中标题为“Some document”的文档)
- 版本:
- version#3 (链接至id为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的附件)
- 目前,只有当前页面下的附件能够被引用(如果您在一个问题中,则仅可以引用此问题下的附件)
- 变更集:
- r758 (链接至一个变更集)
- commit:c6f4d0fd (链接至一个非数字哈希的变更集)
- svn1|r758 (链接至指定版本库中的变更集,用于使用多个版本库的项目)
- commit:hg|c6f4d0fd (链接至指定版本库中,使用非数字哈希的变更集,此例子中是"hg"版本库下的哈希变更集)
- 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中包含空格时使用双引号来表示)
- export:some/file (强制下载此文件,而不是在页面上查看)
- source:svn1|some/file (链接至指定版本库中的文件, 用于使用多个版本库的项目)
- sandbox:source:some/file (链接至"sandbox"项目的版本库中位于/some/file的文件)
- sandbox:export:some/file (强制下载"sandbox"项目的版本库中位于/some/file的文件,而不是在页面上查看)
- 论坛:
- forum#1 (链接至id为2的论坛)
- forum:Support (链接至名称为"Support"的论坛)
- forum:"Technical Support" (论坛名称包含空格时使用双引号表示)
- 论坛消息:
- message#1218 (链接至id为1218的论坛消息)
- 项目:
- project#3 (链接至id为3的项目)
- project:someproject (链接至名称为"someproject"的项目)
- project:"Some Project" (项目名称包含空格时,使用双引号来表示)
- 新闻:
- news#2 (链接至id为1的新闻)
- news:Greetings (链接至名称为"Greetings"的新闻)
- news:"First Release" (新闻名称包含空格时,使用双引号来表示)
- Users:
- user#2 (link to user with id 2)
- user:jsmith (Link to user with login jsmith)
- @jsmith (Link to user with login jsmith)
转义字符:
- 您可以在文本的前面加上感叹号(!)来避免该文本被解析成Redmine链接
外部链接
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) 查找关于使用这些特性的信息。下面将展示其中的一些常用的语法。
字体风格
* *粗体*
* _斜体_
* _*粗体 斜体*_
* +下划线+
* -中划线-
显示为:
内嵌图片
- !image_url! displays an image located at image_url (textile syntax)
- !>image_url! right floating image
- 你可以上传图片附件到 wiki 页面,然后使用它的文件名作为路径: !已上传的图片.png!
- Images in your computer's clipboard can be pasted directly using Ctrl-v or Command-v.
- Image files can be dragged onto the text area in order to be uploaded and embedded.
标题
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 Rouge, a syntax highlighting library written in pure Ruby. It supports many commonly used languages such as c, cpp (c++), csharp (c#, cs), css, diff (patch, udiff), go (golang), groovy, html, java, javascript (js), kotlin, objective_c (objc), perl (pl), php, python (py), r, ruby (rb), sass, scala, shell (bash, zsh, ksh, sh), sql, swift, xml and yaml (yml) languages, where the names inside parentheses are aliases. Please refer to https://www.redmine.org/projects/redmine/wiki/RedmineCodeHighlightingLanguages for the full list of supported languages.
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