Project

General

Profile

SimplifiedChineseWikiFormatting » History » Revision 4

Revision 3 (justim chan, 2014-11-28 07:55) → Revision 4/18 (chigeon null, 2015-06-09 03:51)

h1. 文本格式 

 {{>TOC}} 

 h2. 链接 

 h3. Redmine 链接 

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

 * 链接至一个问题: *!#124* (显示 #124,若该问题已结束则会用删除线来表示) 
 * 链接至一个问题的说明: *!#124-6*, or *!#124!#note-6* 
 * 链接至一个一个变更集: *!r758* (显示r758) 
 * 链接至一个使用非数字哈希码的变更集: *commit:c6f4d0fd* (显示 c6f4d0fd) 

 Wiki链接 

 * *[[Guide]]* 显示一个页面名为'Guide'的链接: [[Guide]] 
 * *[[Guide|User manual]]* 使用不同的文字显示同一个页面的链接: [[Guide|User manual]] 
 * *[[Guide#User-guide|User guide]]* 使用不同的文字显示相同页面中某个标题的链接: [[Guide#User-guide|User guide]] 

 您也可以链接到其他项目的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"* (版本名称包含空格时使用双引号来表示)(double quotes can be used when version name contains spaces) 
 * *!sandbox:version:1.0.0* (连接至sandbox项目中的“1.0.0”版本) 

 * 附件: 

 * *!attachment:file.zip* (链接至当前页面下名为file.zip的附件) 
 * *!attachment:"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包含空格时使用双引号来表示)  
 * *!source:repo_identifier|some/file* (链接至其他配置库中的文件) 
 * *!source:"repo_identifier|some file"* (连接至其他配置库中的文件,URL包含空格时用双引号表示) 
 * *!export:some/file* (强制下载此文件,而不是在页面上查看) 

 * 论坛: 

 * *!forum#2* (链接至id为2的论坛) 
 * *!forum:Discussion* (链接至名称为"Discussion"的论坛) 
 * *!forum:"Help and more"* (论坛名称包含空格时使用双引号表示) 

 * 论坛消息: 

 * *!message#1218* (链接至id为1218的论坛消息) 

 * 新闻 

 * *!news#1* (链接至id为1的新闻) 
 * *!news:Greetings* (链接至名称为"Greetings"的新闻) 
 * *!news:"eCookbook first release !"* (新闻名称包含空格时,使用双引号来表示) 

 * 项目 

 * *!project#3* (链接至id为3的项目) 
 * *!project:someproject* (链接至名称为"someproject"的项目) 
 * *!project:"Multiple words project"* (项目名称包含空格时,使用双引号来表示) 

 转义字符: 

 * 您可以在文本的前面加上感叹号(!)来避免该文本被解析成Redmine链接 

 h3. 外部链接 

 HTTP链接和Email地址可以被自动转换成可点击的链接:  
 * *http://www.redmine.org* -- 外部链接至redmine官网: http://www.redmine.org 
 * *someone@foo.bar* -- 链接至一个Email地址: someone@foo.bar 

 HTTP链接也可以使用不同的文本来显示: 
 * *"Redmine官网":http://www.redmine.org* -- 以不同的文本显示Redmine官网的外部链接:http://www.redmine.org 
 * *!http://www.redmine.org/attachments/7069/Redmine_logo.png(Redmine web site)!:http://www.redmine.org* -- 用带标题的外部图片来表示一个外部链接: 

 p=. !http://www.redmine.org/attachments/7069/Redmine_logo.png(Redmine web site)!:http://www.redmine.org 

 h3. Email地址 

 Email地址能够被自动转换成可点击的链接: 

 * *"Email someone":mailto:someone@foo.bar* -- 用不同的文本显示Email链接: "Email someone":mailto:someone@foo.bar 

 还可以将更加复杂的指令添加到Email链接中。可以设置默认的主题、正文和抄送地址。但请注意,这些字段里的空格都要编码成%20(详细可参考URL编码)。 
 * *"Email webmaster and admin":mailto:webmaster@foo.bar?cc=admin@foo.bar* -- Email给webmaster,抄送给admin: "Email webmaster and admin":mailto:webmaster@foo.bar?cc=admin@foo.bar 
 * *"Email someone for help":mailto:someone@foo.bar?subject=Website%20Help* -- 主题为"Website Help"的Email链接: "Email someone for help":mailto:someone@foo.bar?subject=Website%20Help 
 * *"Email someone for help":mailto:someone@foo.bar?subject=Website%20Help&body=My%20problem%20is%20* -- 主题为"Website Help",正文为"Website Help"的Email链接: "Email someone for help":mailto:someone@foo.bar?subject=Website%20Help&body=My%20problem%20is%20 

 h2. 文本格式 

 For things such as headlines, bold, tables, lists, Redmine supports "Textile syntax":http://en.wikipedia.org/wiki/Textile_%28markup_language%29. See http://redcloth.org/hobix.com/textile/ for information on using any of these features. A few samples are included below, but the engine is capable of much more of that. 

 *持续更新中……* 
 h2. 文字格式 

 对于像标题、粗体、表格、列表这些文字格式, Redmine 支持 "Textile syntax":http://en.wikipedia.org/wiki/Textile_%28markup_language%29 格式引擎。 可以到 http://redcloth.org/hobix.com/textile/ 查找关于使用这些特性的信息。 下面的内容包括一些简单的示例,不过这个引擎带有的功能会更多。 

 h3. 首字母缩写 

 <pre> 
 JPL(Jean-Philippe Lang) 
 </pre> 

 显示为: 

 JPL(Jean-Philippe Lang) 

 h3. 字体风格 

 <pre><code>* *粗体* 
 * _斜体_ 
 * *_粗体 斜体_* 
 * +下划线+ 
 * -中划线- 
 * 文字 ^上标^ 
 * 文字 ~下标~ 
 * @inline monospace@ 
 * <notextile>正常字体 *粗体* _斜体_ 正常字体;E=mc ^2^</notextile> 
 * <notextile>正常字体<notextile></notextile>*粗体*<notextile></notextile>_斜体_<notextile></notextile>正常字体;E=mc<notextile></notextile>^2^</notextile> 
 * <notextile>抑制转义: <notextile>*粗体* _斜体_ @inlinemono(等宽字体)@</notextile> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    或者使用 HTML 代码:&#42;粗体&#42; &#95;斜体&#95; &#64;inlinemono(等宽字体)&#64;</notextile> 
 * <notextile><pre>*一些文字*        "一个外部链接":http://www.redmine.org</pre></notextile> 
 * <notextile><pre><notextile></notextile>*一些文字*        "一个外部链接":http://www.redmine.org</pre></notextile> 
 </code></pre> 

 显示为: 

  * *粗体* 
  * _斜体_ 
  * *_粗体 斜体_* 
  * +下划线+ 
  * -中划线- 
  * 文字 ^上标^ 
  * 文字 ~下标~ 
  * @inline monospace(等宽字体)@ 
  * 正常字体 *粗体* _斜体_ 正常字体;E=mc ^2^ 
  * 正常字体<notextile></notextile>*粗体*<notextile></notextile>_斜体_<notextile></notextile>正常字体;E=mc<notextile></notextile>^2^ 
  * 转义: <notextile>*粗体* _斜体_ @inlinemono(等宽字体)@</notextile> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 或者用 HTML 代码替代: &#42;粗体&#42; &#95;斜体&#95; &#64;inlinemono(等宽字体)&#64; 
  * <pre>*一些文字*        "一个外部链接":http://www.redmine.org</pre> 
  * <pre><notextile></notextile>*一些文字*        "一个外部链接":http://www.redmine.org</pre> 

 h3. Color 

 <pre><code><notextile>* %{color:red}红色% %{color:green}绿色% %{color:yellow}黄色% %{color:#82B6E1}蓝色% 
 * %{color:red}红色%<notextile></notextile>%{color:green}绿色%<notextile></notextile>%{color:yellow}黄色%<notextile></notextile>%{color:#82B6E1}蓝色% 
 * %{background:lightgreen}淡绿背景% %{background:yellow}黄色背景% 
 * %{background:lightgreen}淡绿背景%<notextile></notextile>%{background:yellow}黄色背景% 
 </notextile></code></pre> 

 显示为: 

  * %{color:red}红色% %{color:green}绿色% %{color:yellow}黄色% %{color:#82B6E1}蓝色% 
  * %{color:red}红色%<notextile></notextile>%{color:green}绿色%<notextile></notextile>%{color:yellow}黄色%<notextile></notextile>%{color:#82B6E1}蓝色% 
  * %{background:lightgreen}淡绿背景% %{background:yellow}黄色背景% 
  * %{background:lightgreen}淡绿背景%<notextile></notextile>%{background:yellow}黄色背景% 

 h3. 内嵌图片 

 * *&#33;image_url&#33;* 显示位于“image_url”路径的图片 
 * *&#33;>image_url&#33;* 使图片在页面右侧显示 
 * *&#33;image_url(图片名称)&#33;* 改变图片显示的名称为“图片名称” 
 * *&#33;image_url&#33;:URL* 显示位于“image_url”路径的图片, 并给图片加上超链接“URL” 

 你可以上传图片附件到 wiki 页面,然后使用它的文件名作为路径: *!已上传的图片.png!* 

 h3. 标题 

 <pre><code>h1. 一级标题 

 h2. 二级标题 

 h3. 三级标题 
 </code></pre> 

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

 h3. 段落 

 <pre><code>p. 向左对齐 

   p(. 向右缩进一个字母的距离 

     p((. 向右缩进两个字母的距离 
     (也会对这一行以及接下来的每一行起到作用) 

                                                                                    p>. 向右对齐 

                                                                         p)))>. 向右缩进三个字母的距离 

                            p=. 这一行位于中央 
 </code></pre> 

 h3. 水平线 

 @----@ 
 显示为: 

 ---- 

 h3. 抑制保留字符 

 <pre> <pre> *这里的文字不会被加粗* </pre> </pre> 
 显示为: 

 <pre> *这里的文字不会被加粗* </pre> 

 h3. 块引用 

 在段落前加上 *bq.*: 

 <pre><code>bq. Rails 是应用了 MVC 设计模式的功能完善的框架,用于开发拥有后台数据库的网页应用程序 
 要使用 Rails,你需要增加的只是一个数据库还有一个网页服务器。 
 </code></pre> 

 显示为: 

 bq. Rails 是应用了 MVC 设计模式的功能完善的框架,用于开发拥有后台数据库的网页应用程序 
 要使用 Rails,你需要增加的只是一个数据库还有一个网页服务器。 

 你也可以在每一行开头加上 > 来实现引用,并且可以继续叠加 > 作为二级引用 

 <pre> 
 >> Rails 是应用了 MVC 设计模式的功能完善的框架,用于开发拥有后台数据库的网页应用程序 
 >> 要使用 Rails,你需要增加的只是一个数据库还有一个网页服务器。 
 > 很好! 
 </pre> 

 显示为: 

 >> Rails 是应用了 MVC 设计模式的功能完善的框架,用于开发拥有后台数据库的网页应用程序 
 >> 要使用 Rails,你需要增加的只是一个数据库还有一个网页服务器。 
 > 很好! 

 h3. 无序列表 

 <pre> 
 * 条目 1 
 * 条目 2 
 ** 条目 21 
 ** 条目 22 
 * 条目 3 
 </pre> 

 显示为: 

 * 条目 1 
 * 条目 2 
 ** 条目 21 
 ** 条目 22 
 * 条目 3 

 h3. 有序列表 

 <pre> 
 # 条目 1 
 # 条目 2 
 # 条目 3 
 ## 条目 3.1 
 ## 条目 3.2 
 </pre> 

 显示为: 

 # 条目 1 
 # 条目 2 
 # 条目 3 
 ## 条目 3.1 
 ## 条目 3.2 

 h3. 表格 

 <pre> 
 |_.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      | 
 </pre> 

 显示为: 
 (多个空格会被 Textile 识别为单个空格) 

 |_.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      | 

 要在表格中使用“|”字符(比如 Wiki 链接),你需要使用 <notextile></notextile> 的格式,以防止“|”被 Textile 识别为列分割符。 

 |_.输入 |_. 输出| 
 |*<notextile><notextile>|</notextile></notextile>*|<notextile>|</notextile>| 

 h2. 代码高亮显示 

 Redmine 应用的代码高亮显示依赖于"CodeRay":http://coderay.rubychan.de/ 。CodeRay 是完全用 Ruby 语言写的快速代码高亮库,现在支持的语言包括 C、C++、CSS、Delphi、Diff、Groovy、HTML、Java、Javascript、JSON、Nitro-XHTML、PHP、Python、RHTML、Ruby、Scheme、SQL、XML 和 YAML。 

 使用下面的格式来实现代码高亮显示: 

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

 示例: 

 <pre><code class="ruby"> 
 # The Greeter class 
 class Greeter 
   def initialize(name) 
     @name = name.capitalize 
   end 
 
   def salute 
     puts "Hello #{@name}!" 
   end 
 end 
 </code></pre>