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_markdown.html 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  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 (Markdown)</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 formatting (Markdown)</h1>
  10. <h2><a name="2" class="wiki-page"></a>Links</h2>
  11. <h3><a name="3" class="wiki-page"></a>Redmine links</h3>
  12. <p>Redmine allows hyperlinking between resources (issues, changesets, wiki pages...) from anywhere wiki formatting is used.</p>
  13. <ul>
  14. <li>Link to an issue: <strong>#124</strong> (displays <del><a href="#" class="issue" title="bulk edit doesn't change the category or fixed version properties (Closed)">#124</a></del>, link is striked-through if the issue is closed)</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>Link to an issue note: <strong>#124-6</strong>, or <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 links:</p>
  20. <ul>
  21. <li><strong>[[Guide]]</strong> displays a link to the page named 'Guide': <a href="#" class="wiki-page">Guide</a></li>
  22. <li><strong>[[Guide#further-reading]]</strong> takes you to the anchor "further-reading". Headings get automatically assigned anchors so that you can refer to them: <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> displays a link to the same page but with a different text: <a href="#" class="wiki-page">User manual</a></li>
  25. </ul>
  26. <p>You can also link to pages of an other project wiki:</p>
  27. <ul>
  28. <li><strong>[[sandbox:some page]]</strong> displays a link to the page named 'Some page' of the Sandbox wiki</li>
  29. <li><strong>[[sandbox:]]</strong> displays a link to the Sandbox wiki main page</li>
  30. </ul>
  31. <p>Wiki links are displayed in red if the page doesn't exist yet, eg: <a href="#" class="wiki-page new">Nonexistent page</a>.</p>
  32. <p>Links to other resources:</p>
  33. <ul>
  34. <li>Documents:
  35. <ul>
  36. <li><strong>document#17</strong> (link to document with id 17)</li>
  37. <li><strong>document:Greetings</strong> (link to the document with title "Greetings")</li>
  38. <li><strong>document:"Some document"</strong> (double quotes can be used when document title contains spaces)</li>
  39. <li><strong>sandbox:document:"Some document"</strong> (link to a document with title "Some document" in other project "sandbox")</li>
  40. </ul>
  41. </li>
  42. </ul>
  43. <ul>
  44. <li>Versions:
  45. <ul>
  46. <li><strong>version#3</strong> (link to version with id 3)</li>
  47. <li><strong>version:1.0.0</strong> (link to version named "1.0.0")</li>
  48. <li><strong>version:"1.0 beta 2"</strong></li>
  49. <li><strong>sandbox:version:1.0.0</strong> (link to version "1.0.0" in the project "sandbox")</li>
  50. </ul>
  51. </li>
  52. </ul>
  53. <ul>
  54. <li>Attachments:
  55. <ul>
  56. <li><strong>attachment:file.zip</strong> (link to the attachment of the current object named file.zip)</li>
  57. <li>For now, attachments of the current object can be referenced only (if you're on an issue, it's possible to reference attachments of this issue only)</li>
  58. </ul>
  59. </li>
  60. </ul>
  61. <ul>
  62. <li>Changesets:
  63. <ul>
  64. <li><strong>r758</strong> (link to a changeset)</li>
  65. <li><strong>commit:c6f4d0fd</strong> (link to a changeset with a non-numeric hash)</li>
  66. <li><strong>svn1|r758</strong> (link to a changeset of a specific repository, for projects with multiple repositories)</li>
  67. <li><strong>commit:hg|c6f4d0fd</strong> (link to a changeset with a non-numeric hash of a specific repository)</li>
  68. <li><strong>sandbox:r758</strong> (link to a changeset of another project)</li>
  69. <li><strong>sandbox:commit:c6f4d0fd</strong> (link to a changeset with a non-numeric hash of another project)</li>
  70. </ul>
  71. </li>
  72. </ul>
  73. <ul>
  74. <li>Repository files:
  75. <ul>
  76. <li><strong>source:some/file</strong> (link to the file located at /some/file in the project's repository)</li>
  77. <li><strong>source:some/file@52</strong> (link to the file's revision 52)</li>
  78. <li><strong>source:some/file#L120</strong> (link to line 120 of the file)</li>
  79. <li><strong>source:some/file@52#L120</strong> (link to line 120 of the file's revision 52)</li>
  80. <li><strong>source:"some file@52#L120"</strong> (use double quotes when the URL contains spaces</li>
  81. <li><strong>export:some/file</strong> (force the download of the file)</li>
  82. <li><strong>source:svn1|some/file</strong> (link to a file of a specific repository, for projects with multiple repositories)</li>
  83. <li><strong>sandbox:source:some/file</strong> (link to the file located at /some/file in the repository of the project "sandbox")</li>
  84. <li><strong>sandbox:export:some/file</strong> (force the download of the file)</li>
  85. </ul>
  86. </li>
  87. </ul>
  88. <ul>
  89. <li>Forums:
  90. <ul>
  91. <li><strong>forum#1</strong> (link to forum with id 1</li>
  92. <li><strong>forum:Support</strong> (link to forum named Support)</li>
  93. <li><strong>forum:"Technical Support"</strong> (use double quotes if forum name contains spaces)</li>
  94. </ul>
  95. </li>
  96. </ul>
  97. <ul>
  98. <li>Forum messages:
  99. <ul>
  100. <li><strong>message#1218</strong> (link to message with id 1218)</li>
  101. </ul>
  102. </li>
  103. </ul>
  104. <ul>
  105. <li>Projects:
  106. <ul>
  107. <li><strong>project#3</strong> (link to project with id 3)</li>
  108. <li><strong>project:some-project</strong> (link to project with name or slug of "some-project")</li>
  109. <li><strong>project:"Some Project"</strong> (use double quotes for project name containing spaces)</li>
  110. </ul>
  111. </li>
  112. </ul>
  113. <ul>
  114. <li>News:
  115. <ul>
  116. <li><strong>news#2</strong> (link to news item with id 2)</li>
  117. <li><strong>news:Greetings</strong> (link to news item named "Greetings")</li>
  118. <li><strong>news:"First Release"</strong> (use double quotes if news item name contains spaces)</li>
  119. </ul>
  120. </li>
  121. </ul>
  122. <ul>
  123. <li>Users:
  124. <ul>
  125. <li><strong>user#2</strong> (link to user with id 2)</li>
  126. <li><strong>user:jsmith</strong> (Link to user with login jsmith)</li>
  127. <li><strong>@jsmith</strong> (Link to user with login jsmith)</li>
  128. </ul>
  129. </li>
  130. </ul>
  131. <p>Escaping:</p>
  132. <ul>
  133. <li>You can prevent Redmine links from being parsed by preceding them with an exclamation mark: !</li>
  134. </ul>
  135. <h3><a name="4" class="wiki-page"></a>External links</h3>
  136. <p>URLs (starting with: www, http, https, ftp, ftps, sftp and sftps) and email addresses are automatically turned into clickable links:</p>
  137. <pre>
  138. http://www.redmine.org, someone@foo.bar
  139. </pre>
  140. <p>displays: <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>
  141. <p>If you want to display a specific text instead of the URL, you can use the standard markdown syntax:</p>
  142. <pre>
  143. [Redmine web site](http://www.redmine.org)
  144. </pre>
  145. <p>displays: <a href="http://www.redmine.org" class="external">Redmine web site</a></p>
  146. <h2><a name="5" class="wiki-page"></a>Text formatting</h2>
  147. <p>For things such as headlines, bold, tables, lists, Redmine supports Markdown syntax. See <a class="external" href="http://daringfireball.net/projects/markdown/syntax">http://daringfireball.net/projects/markdown/syntax</a> for information on using any of these features. A few samples are included below, but the engine is capable of much more of that.</p>
  148. <h3><a name="6" class="wiki-page"></a>Font style</h3>
  149. <pre>
  150. * **bold**
  151. * *Italic*
  152. * ***bold italic***
  153. * _underline_
  154. * ~~strike-through~~
  155. </pre>
  156. <p>Display:</p>
  157. <ul>
  158. <li><strong>bold</strong></li>
  159. <li><em>italic</em></li>
  160. <li><em><strong>bold italic</strong></em></li>
  161. <li><u>underline</u></li>
  162. <li><del>strike-through</del></li>
  163. </ul>
  164. <h3><a name="7" class="wiki-page"></a>Inline images</h3>
  165. <ul>
  166. <li><strong>![](image_url)</strong> displays an image located at image_url (markdown syntax)</li>
  167. <li>If you have an image attached to your wiki page, it can be displayed inline using its filename: <strong>![](attached_image)</strong></li>
  168. <li>Images in your computer's clipboard can be pasted directly using Ctrl-v or Command-v.</li>
  169. <li>Image files can be dragged onto the text area in order to be uploaded and embedded.</li>
  170. </ul>
  171. <h3><a name="8" class="wiki-page"></a>Headings</h3>
  172. <pre>
  173. # Heading
  174. ## Subheading
  175. ### Subsubheading
  176. </pre>
  177. <p>Redmine assigns an anchor to each of those headings thus you can link to them with "#Heading", "#Subheading" and so forth.</p>
  178. <h3><a name="10" class="wiki-page"></a>Blockquotes</h3>
  179. <p>Start the paragraph with <strong>&gt;</strong></p>
  180. <pre>
  181. &gt; Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.
  182. To go live, all you need to add is a database and a web server.
  183. </pre>
  184. <p>Display:</p>
  185. <blockquote>
  186. <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>
  187. </blockquote>
  188. <h3><a name="11" class="wiki-page"></a>Table of content</h3>
  189. <pre>
  190. {{toc}} =&gt; left aligned toc
  191. {{&gt;toc}} =&gt; right aligned toc
  192. </pre>
  193. <h3><a name="14" class="wiki-page"></a>Horizontal Rule</h3>
  194. <pre>
  195. ---
  196. </pre>
  197. <h2><a name="12" class="wiki-page"></a>Macros</h2>
  198. <p>Redmine has the following builtin macros:</p>
  199. <p>
  200. <dl>
  201. <dt><code>hello_world</code></dt>
  202. <dd><p>Sample macro.</p></dd>
  203. <dt><code>macro_list</code></dt>
  204. <dd><p>Displays a list of all available macros, including description if available.</p></dd>
  205. <dt><code>child_pages</code></dt>
  206. <dd><p>Displays a list of child pages. With no argument, it displays the child pages of the current wiki page. Examples:</p>
  207. <pre><code>{{child_pages}} -- can be used from a wiki page only
  208. {{child_pages(depth=2)}} -- display 2 levels nesting only</code></pre></dd>
  209. <dt><code>include</code></dt>
  210. <dd><p>Include a wiki page. Example:</p>
  211. <pre><code>{{include(Foo)}}</code></pre>
  212. <p>or to include a page of a specific project wiki:</p>
  213. <pre><code>{{include(projectname:Foo)}}</code></pre></dd>
  214. <dt><code>collapse</code></dt>
  215. <dd><p>Inserts of collapsed block of text. Example:</p>
  216. <pre><code>{{collapse(View details...)
  217. This is a block of text that is collapsed by default.
  218. It can be expanded by clicking a link.
  219. }}</code></pre></dd>
  220. <dt><code>thumbnail</code></dt>
  221. <dd><p>Displays a clickable thumbnail of an attached image. Examples:</p>
  222. <pre>{{thumbnail(image.png)}}
  223. {{thumbnail(image.png, size=300, title=Thumbnail)}}</pre></dd>
  224. <dt><code>issue</code></dt>
  225. <dd><p>Inserts a link to an issue with flexible text. Examples:</p>
  226. <pre>{{issue(123)}} -- Issue #123: Enhance macro capabilities
  227. {{issue(123, project=true)}} -- Andromeda - Issue #123:Enhance macro capabilities
  228. {{issue(123, tracker=false)}} -- #123: Enhance macro capabilities
  229. {{issue(123, subject=false, project=true)}} -- Andromeda - Issue #123</pre></dd>
  230. </dl>
  231. </p>
  232. <h2><a name="13" class="wiki-page"></a>Code highlighting</h2>
  233. <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>
  234. <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>
  235. <pre>
  236. ``` ruby
  237. Place your code here.
  238. ```
  239. </pre>
  240. <p>Example:</p>
  241. <pre><code class="ruby syntaxhl"><span class="c1"># The Greeter class</span>
  242. <span class="k">class</span> <span class="nc">Greeter</span>
  243. <span class="k">def</span> <span class="nf">initialize</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
  244. <span class="vi">@name</span> <span class="o">=</span> <span class="nb">name</span><span class="p">.</span><span class="nf">capitalize</span>
  245. <span class="k">end</span>
  246. <span class="k">def</span> <span class="nf">salute</span>
  247. <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>
  248. <span class="k">end</span>
  249. <span class="k">end</span>
  250. </code></pre>
  251. </body>
  252. </html>