You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

wiki_syntax_detailed_textile.html 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  3. <head>
  4. <title>RedmineWikiFormatting</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. <link rel="stylesheet" type="text/css" href="../wiki_syntax_detailed.css" />
  7. </head>
  8. <body>
  9. <h1><a name="1" class="wiki-page"></a>Wiki 文本格式</h1>
  10. <h2><a name="2" class="wiki-page"></a>链接</h2>
  11. <h3><a name="3" class="wiki-page"></a>Redmine 链接</h3>
  12. <p>在任何使用文本格式的地方,Redmine都允许在资源(问题、变更、wiki页面...)间建立超链接。</p>
  13. <ul>
  14. <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>
  15. <li>Link to an issue including tracker name and subject: <strong>##124</strong> (displays <a href="#" class="issue" title="bulk edit doesn't change the category or fixed version properties (New)">Bug #124</a>: bulk edit doesn't change the category or fixed version properties)</li>
  16. <li>链接至一个问题的说明: <strong>#124-6</strong>, 或者 <strong>#124#note-6</strong></li>
  17. <li>Link to an issue note within the same issue: <strong>#note-6</strong></li>
  18. </ul>
  19. <p>Wiki链接</p>
  20. <ul>
  21. <li><strong>[[Guide]]</strong> 显示一个页面名为'Guide'的链接: <a href="#" class="wiki-page">Guide</a></li>
  22. <li><strong>[[Guide#further-reading]]</strong> 链接到页面内的"further-reading"标签. 每个标题都会自动绑定一个标签,方便您进行链接: <a href="#" class="wiki-page">Guide</a></li>
  23. <li><strong>[[#further-reading]]</strong> link to the anchor "further-reading" of the current page: <a href="#" class="wiki-page">#further-reading</a></li>
  24. <li><strong>[[Guide|User manual]]</strong> 使用不同的文字来显示一个页面名称为'Guide'的链接: <a href="#" class="wiki-page">User manual</a></li>
  25. </ul>
  26. <p>您也可以链接到其他项目的Wiki页面(使用项目标识):</p>
  27. <ul>
  28. <li><strong>[[sandbox:some page]]</strong> 显示Sandbox项目wiki页面的一个名为'Some page'的链接</li>
  29. <li><strong>[[sandbox:]]</strong> 显示Sandbox项目wiki首页的链接</li>
  30. </ul>
  31. <p>当页面不存在的时候,Wiki链接会以红色来显示,例如: <a href="#" class="wiki-page new">Nonexistent page</a>.</p>
  32. <p>链接至其他资源:</p>
  33. <ul>
  34. <li>文档:
  35. <ul>
  36. <li><strong>document#17</strong> (链接到id为17的文档)</li>
  37. <li><strong>document:Greetings</strong> (链接到标题为“Greeting”的文档)</li>
  38. <li><strong>document:"Some document"</strong> (文档标题包含空格时使用双引号来表示)</li>
  39. <li><strong>sandbox:document:"Some document"</strong> (链接至sandbox项目中标题为“Some document”的文档)</li>
  40. </ul></li>
  41. </ul>
  42. <ul>
  43. <li>版本:
  44. <ul>
  45. <li><strong>version#3</strong> (链接至id为3的版本)</li>
  46. <li><strong>version:1.0.0</strong> (链接到名称为“1.0.0”的版本)</li>
  47. <li><strong>version:"1.0 beta 2"</strong>(版本名称包含空格时使用双引号来表示)</li>
  48. <li><strong>sandbox:version:1.0.0</strong> (连接至sandbox项目中的“1.0.0”版本)</li>
  49. </ul></li>
  50. </ul>
  51. <ul>
  52. <li>附件:
  53. <ul>
  54. <li><strong>attachment:file.zip</strong> (链接至当前页面下名为file.zip的附件)</li>
  55. <li>目前,只有当前页面下的附件能够被引用(如果您在一个问题中,则仅可以引用此问题下的附件)</li>
  56. </ul></li>
  57. </ul>
  58. <ul>
  59. <li>变更集:
  60. <ul>
  61. <li><strong>r758</strong> (链接至一个变更集)</li>
  62. <li><strong>commit:c6f4d0fd</strong> (链接至一个非数字哈希的变更集)</li>
  63. <li><strong>svn1|r758</strong> (链接至指定版本库中的变更集,用于使用多个版本库的项目)</li>
  64. <li><strong>commit:hg|c6f4d0fd</strong> (链接至指定版本库中,使用非数字哈希的变更集,此例子中是"hg"版本库下的哈希变更集)</li>
  65. <li><strong>sandbox:r758</strong> (链接至其他项目的变更集)</li>
  66. <li><strong>sandbox:commit:c6f4d0fd</strong> (链接至其他项目中,使用非数字哈希的变更集)</li>
  67. </ul></li>
  68. </ul>
  69. <ul>
  70. <li>版本库文件:
  71. <ul>
  72. <li><strong>source:some/file</strong> (链接至项目版本库中位于/some/file的文件)</li>
  73. <li><strong>source:some/file@52</strong> (链接至此文件的第52版)</li>
  74. <li><strong>source:some/file#L120</strong> (链接至此文件的第120行)</li>
  75. <li><strong>source:some/file@52#L120</strong> (链接至此文件的第52版的第120行)</li>
  76. <li><strong>source:"some file@52#L120"</strong> (当URL中包含空格时使用双引号来表示)</li>
  77. <li><strong>export:some/file</strong> (强制下载此文件,而不是在页面上查看)</li>
  78. <li><strong>source:svn1|some/file</strong> (链接至指定版本库中的文件, 用于使用多个版本库的项目)</li>
  79. <li><strong>sandbox:source:some/file</strong> (链接至"sandbox"项目的版本库中位于/some/file的文件)</li>
  80. <li><strong>sandbox:export:some/file</strong> (强制下载"sandbox"项目的版本库中位于/some/file的文件,而不是在页面上查看)</li>
  81. </ul></li>
  82. </ul>
  83. <ul>
  84. <li>论坛:
  85. <ul>
  86. <li><strong>forum#1</strong> (链接至id为2的论坛)</li>
  87. <li><strong>forum:Support</strong> (链接至名称为"Support"的论坛)</li>
  88. <li><strong>forum:"Technical Support"</strong> (论坛名称包含空格时使用双引号表示)</li>
  89. </ul></li>
  90. </ul>
  91. <ul>
  92. <li>论坛消息:
  93. <ul>
  94. <li><strong>message#1218</strong> (链接至id为1218的论坛消息)</li>
  95. </ul></li>
  96. </ul>
  97. <ul>
  98. <li>项目:
  99. <ul>
  100. <li><strong>project#3</strong> (链接至id为3的项目)</li>
  101. <li><strong>project:someproject</strong> (链接至名称为"someproject"的项目)</li>
  102. <li><strong>project:"Some Project"</strong> (项目名称包含空格时,使用双引号来表示)</li>
  103. </ul></li>
  104. </ul>
  105. <ul>
  106. <li>新闻:
  107. <ul>
  108. <li><strong>news#2</strong> (链接至id为1的新闻)</li>
  109. <li><strong>news:Greetings</strong> (链接至名称为"Greetings"的新闻)</li>
  110. <li><strong>news:"First Release"</strong> (新闻名称包含空格时,使用双引号来表示)</li>
  111. </ul></li>
  112. </ul>
  113. <ul>
  114. <li>Users:
  115. <ul>
  116. <li><strong>user#2</strong> (link to user with id 2)</li>
  117. <li><strong>user:jsmith</strong> (Link to user with login jsmith)</li>
  118. <li><strong>@jsmith</strong> (Link to user with login jsmith)</li>
  119. </ul>
  120. </li>
  121. </ul>
  122. <p>转义字符:</p>
  123. <ul>
  124. <li>您可以在文本的前面加上感叹号(!)来避免该文本被解析成Redmine链接</li>
  125. </ul>
  126. <h3><a name="4" class="wiki-page"></a>外部链接</h3>
  127. <p>URLs (starting with: www, http, https, ftp, ftps, sftp and sftps) and email addresses are automatically turned into clickable links:</p>
  128. <pre>
  129. http://www.redmine.org, someone@foo.bar
  130. </pre>
  131. <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>
  132. <p>如果您想要显示指定的文本而不是链接,您可以通过下列标准的 textile 语法:</p>
  133. <pre>
  134. "Redmine 官网":http://www.redmine.org
  135. </pre>
  136. <p>显示为: <a href="http://www.redmine.org" class="external">Redmine 官网</a></p>
  137. <h2><a name="5" class="wiki-page"></a>字体格式</h2>
  138. <p>对于像是标题、粗体、表格、列表等文字格式, Redmine 支持使用 <a class="external" href="http://en.wikipedia.org/wiki/Textile_%28markup_language%29">http://en.wikipedia.org/wiki/Textile_(markup_language)</a> 查找关于使用这些特性的信息。下面将展示其中的一些常用的语法。</p>
  139. <h3><a name="6" class="wiki-page"></a>字体风格</h3>
  140. <pre>
  141. * *粗体*
  142. * _斜体_
  143. * _*粗体 斜体*_
  144. * +下划线+
  145. * -中划线-
  146. </pre>
  147. <p>显示为:</p>
  148. <ul>
  149. <li><strong>粗体</strong></li>
  150. <li><em>斜体</em></li>
  151. <li><em><strong>粗体 斜体</strong></em></li>
  152. <li><ins>下划线</ins></li>
  153. <li><del>中划线</del></li>
  154. </ul>
  155. <h3><a name="7" class="wiki-page"></a>内嵌图片</h3>
  156. <ul>
  157. <li><strong>!image_url!</strong> displays an image located at image_url (textile syntax)</li>
  158. <li><strong>!&gt;image_url!</strong> right floating image</li>
  159. <li>你可以上传图片附件到 wiki 页面,然后使用它的文件名作为路径: <strong>!已上传的图片.png!</strong></li>
  160. <li>Images in your computer's clipboard can be pasted directly using Ctrl-v or Command-v.</li>
  161. <li>Image files can be dragged onto the text area in order to be uploaded and embedded.</li>
  162. </ul>
  163. <h3><a name="8" class="wiki-page"></a>标题</h3>
  164. <pre>
  165. h1. 一级标题
  166. h2. 二级标题
  167. h3. 三级标题
  168. </pre>
  169. <p>你可以使用“#一级标题”、“#二级标题”等等来链接到这些标题</p>
  170. <h3><a name="9" class="wiki-page"></a>段落</h3>
  171. <pre>
  172. p&gt;. 向右对齐
  173. p=. 居中
  174. </pre>
  175. <p style="text-align:center;">这是一个居中对齐的段落</p>
  176. <h3><a name="10" class="wiki-page"></a>引用文字</h3>
  177. <p>在段落前加上 <strong>bq.</strong></p>
  178. <pre>
  179. bq. Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.
  180. To go live, all you need to add is a database and a web server.
  181. </pre>
  182. <p>显示为:</p>
  183. <blockquote>
  184. <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>
  185. </blockquote>
  186. <h3><a name="11" class="wiki-page"></a>目录</h3>
  187. <pre>
  188. {{toc}} =&gt; 靠左对齐目录
  189. {{&gt;toc}} =&gt; 靠右对齐目录
  190. </pre>
  191. <h3><a name="14" class="wiki-page"></a>水平线</h3>
  192. <pre>
  193. ---
  194. </pre>
  195. <h2><a name="12" class="wiki-page"></a>宏</h2>
  196. <p>Redmine内建了以下宏:</p>
  197. <p>
  198. <dl>
  199. <dt><code>hello_world</code></dt>
  200. <dd><p>宏示例.</p></dd>
  201. <dt><code>macro_list</code></dt>
  202. <dd><p>显示所有可用的宏列表,如果该宏有提供说明也会一并显示。</p></dd>
  203. <dt><code>child_pages</code></dt>
  204. <dd><p>显示一个子页面列表。默认显示当前Wiki页面的所有子页面。 示例:</p>
  205. <pre><code>{{child_pages}} -- 只能在Wiki页面调用
  206. {{child_pages(depth=2)}} -- 显示两级子页面</code></pre></dd>
  207. <dt><code>include</code></dt>
  208. <dd><p>引用一个Wiki页面。示例:</p>
  209. <pre><code>{{include(Foo)}}</code></pre>
  210. <p>或者引用一个指定项目的Wiki页面:</p>
  211. <pre><code>{{include(projectname:Foo)}}</code></pre></dd>
  212. <dt><code>collapse</code></dt>
  213. <dd><p>插入一个折叠文本块。示例:</p>
  214. <pre><code>{{collapse(View details...)
  215. 这是一个默认折叠的文本块。
  216. 点击链接后将会展开此文本块.
  217. }}</code></pre></dd>
  218. <dt><code>thumbnail</code></dt>
  219. <dd><p>显示一个图像附件的可点击缩略图。示例:</p>
  220. <pre>{{thumbnail(image.png)}}
  221. {{thumbnail(image.png, size=300, title=Thumbnail)}}</pre></dd>
  222. <dt><code>issue</code></dt>
  223. <dd><p>Inserts a link to an issue with flexible text. Examples:</p>
  224. <pre>{{issue(123)}} -- Issue #123: Enhance macro capabilities
  225. {{issue(123, project=true)}} -- Andromeda - Issue #123:Enhance macro capabilities
  226. {{issue(123, tracker=false)}} -- #123: Enhance macro capabilities
  227. {{issue(123, subject=false, project=true)}} -- Andromeda - Issue #123</pre></dd>
  228. </dl>
  229. </p>
  230. <h2><a name="13" class="wiki-page"></a>代码高亮</h2>
  231. <p>Default code highlightment relies on <a href="http://rouge.jneen.net/" class="external">Rouge</a>, a syntax highlighting library written in pure Ruby. It supports many commonly used languages such as <strong>c</strong>, <strong>cpp</strong> (c++), <strong>csharp</strong> (c#, cs), <strong>css</strong>, <strong>diff</strong> (patch, udiff), <strong>go</strong> (golang), <strong>groovy</strong>, <strong>html</strong>, <strong>java</strong>, <strong>javascript</strong> (js), <strong>kotlin</strong>, <strong>objective_c</strong> (objc), <strong>perl</strong> (pl), <strong>php</strong>, <strong>python</strong> (py), <strong>r</strong>, <strong>ruby</strong> (rb), <strong>sass</strong>, <strong>scala</strong>, <strong>shell</strong> (bash, zsh, ksh, sh), <strong>sql</strong>, <strong>swift</strong>, <strong>xml</strong> and <strong>yaml</strong> (yml) languages, where the names inside parentheses are aliases. Please refer to <a href="https://www.redmine.org/projects/redmine/wiki/RedmineCodeHighlightingLanguages" class="external">https://www.redmine.org/projects/redmine/wiki/RedmineCodeHighlightingLanguages</a> for the full list of supported languages.</p>
  232. <p>You can highlight code at any place that supports wiki formatting using this syntax (note that the language name or alias is case-insensitive):</p>
  233. <pre>
  234. &lt;pre&gt;&lt;code class="ruby"&gt;
  235. 这里写 Ruby 代码
  236. &lt;/code&gt;&lt;/pre&gt;
  237. </pre>
  238. <p>示例:</p>
  239. <pre><code class="ruby syntaxhl"><span class="c1"># The Greeter class</span>
  240. <span class="k">class</span> <span class="nc">Greeter</span>
  241. <span class="k">def</span> <span class="nf">initialize</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
  242. <span class="vi">@name</span> <span class="o">=</span> <span class="nb">name</span><span class="p">.</span><span class="nf">capitalize</span>
  243. <span class="k">end</span>
  244. <span class="k">def</span> <span class="nf">salute</span>
  245. <span class="nb">puts</span> <span class="s2">"Hello </span><span class="si">#{</span><span class="vi">@name</span><span class="si">}</span><span class="s2">!"</span>
  246. <span class="k">end</span>
  247. <span class="k">end</span>
  248. </code></pre>
  249. </body>
  250. </html>