RedmineTextFormattingMarkdown » History » Version 18
Hiroo Hayashi, 2016-07-30 05:10
remove unnecessary line-breaks
| 1 | 1 | Hans Ginzel | h1. Markdown formatting |
|---|---|---|---|
| 2 | |||
| 3 | 17 | Hiroo Hayashi | Below is *Markdown* formatting. For *Textile* formatting see [[RedmineTextFormattingTextile|Textile formatting]]. |
| 4 | Currently HTML tags are not allowed by default. See #15520 and #20497 for details. For other limitations of the current *Markdown* formatting see #16373 and #21443. |
||
| 5 | 1 | Hans Ginzel | |
| 6 | {{>TOC}} |
||
| 7 | |||
| 8 | h2. Links |
||
| 9 | |||
| 10 | h3. Redmine links |
||
| 11 | |||
| 12 | 16 | Hiroo Hayashi | {{include(RedmineTextFormattingRedmineLinks)}} |
| 13 | 1 | Hans Ginzel | |
| 14 | h3. External links |
||
| 15 | |||
| 16 | HTTP URLs are automatically turned into clickable links: |
||
| 17 | 17 | Hiroo Hayashi | |
| 18 | 1 | Hans Ginzel | * *http://www.redmine.org* -- External link to the redmine website: http://www.redmine.org |
| 19 | |||
| 20 | HTTP URLs can also use different text than the link itself: |
||
| 21 | 17 | Hiroo Hayashi | |
| 22 | 2 | Hans Ginzel | * *[Redmine web site](http://www.redmine.org)* -- External link with different text: "Redmine web site":http://www.redmine.org |
| 23 | * *[](http://www.redmine.org)* -- External image with a title that links to an URL: |
||
| 24 | 1 | Hans Ginzel | |
| 25 | p=. !http://www.redmine.org/attachments/7069/Redmine_logo.png(Redmine web site)!:http://www.redmine.org |
||
| 26 | |||
| 27 | h3. Email addresses |
||
| 28 | |||
| 29 | Email addresses are automatically turned into clickable links: |
||
| 30 | |||
| 31 | 17 | Hiroo Hayashi | * *someone@foo.bar* -- Link to an email address: someone@foo.bar |
| 32 | 3 | Hans Ginzel | * *[Email someone](mailto:someone@foo.bar)* -- Email link with different text: "Email someone":mailto:someone@foo.bar |
| 33 | 1 | Hans Ginzel | |
| 34 | More complex email instructions can be added to an email link. A default subject, default body and CC information can be defined. Note that spaces in any of these fields need to be replaced with the code %20. |
||
| 35 | 3 | Hans Ginzel | * *[Email webmaster and admin](mailto:webmaster@foo.bar?cc=admin@foo.bar)* -- Email to webmaster, CC admin: "Email webmaster and admin":mailto:webmaster@foo.bar?cc=admin@foo.bar |
| 36 | * *[Email someone for help](mailto:someone@foo.bar?subject=Website%20Help)* -- Email link with the subject "Website Help": "Email someone for help":mailto:someone@foo.bar?subject=Website%20Help |
||
| 37 | * *[Email someone for help](mailto:someone@foo.bar?subject=Website%20Help&body=My%20problem%20is%20)* -- Email link with the subject "Website Help" and a default body: "Email someone for help":mailto:someone@foo.bar?subject=Website%20Help&body=My%20problem%20is%20 |
||
| 38 | 1 | Hans Ginzel | |
| 39 | h2. Text formatting |
||
| 40 | 4 | Hans Ginzel | |
| 41 | 1 | Hans Ginzel | For things such as headlines, bold, tables, lists, Redmine supports "Markdown syntax":http://en.wikipedia.org/wiki/Markdown. See http://daringfireball.net/projects/markdown/syntax, http://agea.github.io/tutorial.md/, http://stackoverflow.com/editing-help for information on using any of these features. A few samples are included below, but the engine is capable of much more of that. For conversions see "Pandoc":http://pandoc.org. The "Redcarpet formatter":https://github.com/alminium/redmine_redcarpet_formatter is used. |
| 42 | |||
| 43 | h3. Acronym |
||
| 44 | |||
| 45 | 17 | Hiroo Hayashi | Not supported by Markdown |
| 46 | 1 | Hans Ginzel | |
| 47 | h3. Font style |
||
| 48 | |||
| 49 | <pre><code>* **bold** __bold__ |
||
| 50 | * *italic* _italic_ |
||
| 51 | * ***bold italic*** ___bold italic___ |
||
| 52 | 5 | Hans Ginzel | * <ins>underline</ins> |
| 53 | * <del>strike through</del> |
||
| 54 | * Plain <sup>superscript</sup> |
||
| 55 | * Plain <sub>subscript</sub> |
||
| 56 | * `inline monospace` |
||
| 57 | 1 | Hans Ginzel | * normal **bold** _italic_ normal;E=mc<sup>2</sup> |
| 58 | 17 | Hiroo Hayashi | * <notextile>normal<notextile></notextile>**bold**<notextile></notextile>_italic_<notextile></notextile>normal;E=mc<sup>2</sup></notextile> |
| 59 | * Escaping: \*\*bold\*\* \_italic\_ \`inlinemono\` |
||
| 60 | * <notextile><pre>**some lines** some [link](http://www.redmine.org)</pre></notextile> |
||
| 61 | * <notextile><pre>\*\*some lines\*\* some \[link](http\://www\.redmine\.org)</pre></notextile> |
||
| 62 | 1 | Hans Ginzel | </code></pre> |
| 63 | |||
| 64 | 17 | Hiroo Hayashi | displays: |
| 65 | 1 | Hans Ginzel | |
| 66 | * *bold* *bold* |
||
| 67 | * _italic_ _italic_ |
||
| 68 | * *_bold italic_* *_bold italic_* |
||
| 69 | 5 | Hans Ginzel | * +underline+ |
| 70 | * -strike-through- |
||
| 71 | 1 | Hans Ginzel | * Plain ^superscript^ |
| 72 | * Plain ~subscript~ |
||
| 73 | * @inline monospace@ |
||
| 74 | 17 | Hiroo Hayashi | * normal *bold* _italic_ normal;E=mc<notextile></notextile>^2^ |
| 75 | 1 | Hans Ginzel | * normal<notextile></notextile>*bold*<notextile></notextile>_italic_<notextile></notextile>normal;E=mc<notextile></notextile>^2^ |
| 76 | 17 | Hiroo Hayashi | * Escaping: <notextile>*bold* _italic_ `inlinemono`</notextile> |
| 77 | 1 | Hans Ginzel | * <pre><notextile></notextile>*some lines* some "link":http://www.redmine.org</pre> |
| 78 | 17 | Hiroo Hayashi | * <pre>**some lines** some [link](http://www.redmine.org)</pre> |
| 79 | 1 | Hans Ginzel | |
| 80 | 17 | Hiroo Hayashi | **Note:** HTML tags need to be allowed to use the HTML tags (<ins>, <del>, <sup>, <sub>). See #15520-16 and #15520-17 for details. |
| 81 | 1 | Hans Ginzel | |
| 82 | 17 | Hiroo Hayashi | h3. Color |
| 83 | |||
| 84 | <pre><code><notextile>* <span style="color:red">red</span> <span style="color:green">green</span> <span style="color:yellow">yellow</span> <span style="color:#82B6E1">blue'ish</span> |
||
| 85 | * <span style="color:red">red</span><span style="color:green">green</span><span style="color:yellow">yellow</span><span style="color:#82B6E1">blue'ish</span> |
||
| 86 | * <span style="background-color:lightgreen">Lightgreen Background</span> <span style="background-color:yellow">Yellow Background</span> |
||
| 87 | * <span style="background-color:lightgreen">Lightgreen Background</span><span style="background-color:yellow">Yellow Background</span> |
||
| 88 | 1 | Hans Ginzel | </notextile></code></pre> |
| 89 | |||
| 90 | 17 | Hiroo Hayashi | displays: |
| 91 | 1 | Hans Ginzel | |
| 92 | * %{color:red}red% %{color:green}green% %{color:yellow}yellow% %{color:#82B6E1}blue'ish% |
||
| 93 | * %{color:red}red%<notextile></notextile>%{color:green}green%<notextile></notextile>%{color:yellow}yellow%<notextile></notextile>%{color:#82B6E1}blue'ish% |
||
| 94 | * %{background:lightgreen}Lightgreen Background% %{background:yellow}Yellow Background% |
||
| 95 | * %{background:lightgreen}Lightgreen Background%<notextile></notextile>%{background:yellow}Yellow Background% |
||
| 96 | |||
| 97 | 17 | Hiroo Hayashi | **Note:** HTML tags need to be allowed to use the HTML tag (<span>). See #15520-16 and #15520-17 for details. |
| 98 | |||
| 99 | 1 | Hans Ginzel | h3. Inline images |
| 100 | |||
| 101 | * ** displays an image located at image_url (textile syntax) |
||
| 102 | 17 | Hiroo Hayashi | * ** displays an image with an alt/title attribute |
| 103 | * *[](URL)* displays an image located at image_url with link URL added |
||
| 104 | 1 | Hans Ginzel | |
| 105 | 17 | Hiroo Hayashi | If you have an image attached to your wiki page, it can be displayed inline using its filename: **. |
| 106 | 1 | Hans Ginzel | |
| 107 | 17 | Hiroo Hayashi | As of this writing, Markdown has no syntax for specifying the dimensions of an image; if this is important to you, you can use regular HTML <img> tags. |
| 108 | 1 | Hans Ginzel | |
| 109 | 17 | Hiroo Hayashi | * <img style="float:right" src="URL"/> |
| 110 | * <img style="width:100%" src="attached_image.png"/> |
||
| 111 | |||
| 112 | **Note:** HTML tags need to be allowed to use the HTML tag (<img>). See #15520-16 and #15520-17 for details. |
||
| 113 | |||
| 114 | |||
| 115 | 1 | Hans Ginzel | h3. Headings |
| 116 | |||
| 117 | <pre><code># Heading |
||
| 118 | |||
| 119 | ## Subheading |
||
| 120 | |||
| 121 | ### Subheading |
||
| 122 | |||
| 123 | or |
||
| 124 | |||
| 125 | Heading |
||
| 126 | ======= |
||
| 127 | |||
| 128 | Subheading |
||
| 129 | ---------- |
||
| 130 | </code></pre> |
||
| 131 | |||
| 132 | Redmine assigns an anchor to each of those headings thus you can link to them with "#Heading", "#Subheading" and so forth. |
||
| 133 | |||
| 134 | h3. Paragraphs |
||
| 135 | |||
| 136 | 17 | Hiroo Hayashi | Markdown does not support alignment of a paragraph. Use <div> tags if you need it. |
| 137 | 1 | Hans Ginzel | |
| 138 | 17 | Hiroo Hayashi | <pre><code>left aligned |
| 139 | <div style="padding-left:1em;"> |
||
| 140 | left ident 1em |
||
| 141 | </div> |
||
| 142 | 1 | Hans Ginzel | |
| 143 | 17 | Hiroo Hayashi | <div style="padding-left:2em;"> |
| 144 | left ident 2em |
||
| 145 | as well as for following lines |
||
| 146 | </div> |
||
| 147 | 1 | Hans Ginzel | |
| 148 | 17 | Hiroo Hayashi | <div style="text-align:right;"> |
| 149 | right aligned |
||
| 150 | </div> |
||
| 151 | 1 | Hans Ginzel | |
| 152 | 17 | Hiroo Hayashi | <div style="padding-right:3em;text-align:right;"> |
| 153 | right ident 3em |
||
| 154 | </div> |
||
| 155 | 1 | Hans Ginzel | |
| 156 | 17 | Hiroo Hayashi | <div style="text-align:center;"> |
| 157 | This is centered paragraph. |
||
| 158 | </div></code></pre> |
||
| 159 | 1 | Hans Ginzel | |
| 160 | 17 | Hiroo Hayashi | displays; |
| 161 | 1 | Hans Ginzel | |
| 162 | 17 | Hiroo Hayashi | p. left aligned |
| 163 | 1 | Hans Ginzel | |
| 164 | 17 | Hiroo Hayashi | p(. left ident 1em |
| 165 | 1 | Hans Ginzel | |
| 166 | 17 | Hiroo Hayashi | p((. left ident 2em |
| 167 | as well as for following lines |
||
| 168 | 1 | Hans Ginzel | |
| 169 | 17 | Hiroo Hayashi | p>. right aligned |
| 170 | 1 | Hans Ginzel | |
| 171 | 17 | Hiroo Hayashi | p)))>. right ident 3em |
| 172 | 1 | Hans Ginzel | |
| 173 | 17 | Hiroo Hayashi | p=. This is centered paragraph. |
| 174 | 1 | Hans Ginzel | |
| 175 | 17 | Hiroo Hayashi | **Note:** HTML tags need to be allowed to use the HTML tags (<div>). See #15520-16 and #15520-17 for details. |
| 176 | 1 | Hans Ginzel | |
| 177 | 17 | Hiroo Hayashi | h3. Horizontal rule |
| 178 | 1 | Hans Ginzel | |
| 179 | 17 | Hiroo Hayashi | @----@ |
| 180 | 1 | Hans Ginzel | |
| 181 | 17 | Hiroo Hayashi | displays: |
| 182 | 1 | Hans Ginzel | |
| 183 | 17 | Hiroo Hayashi | ---- |
| 184 | 1 | Hans Ginzel | |
| 185 | 17 | Hiroo Hayashi | h3. Preformatted Text |
| 186 | 1 | Hans Ginzel | |
| 187 | 17 | Hiroo Hayashi | <pre> <pre>**Your text won't become bold**</pre> </pre> |
| 188 | |||
| 189 | displays: |
||
| 190 | |||
| 191 | <pre>**Your text won't become bold**</pre> |
||
| 192 | |||
| 193 | h3. Blockquotes |
||
| 194 | |||
| 195 | You can use > at the beginning of each line and stack them for nested quotes: |
||
| 196 | |||
| 197 | 1 | Hans Ginzel | <pre> |
| 198 | >> Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern. |
||
| 199 | >> To go live, all you need to add is a database and a web server. |
||
| 200 | > Great! |
||
| 201 | </pre> |
||
| 202 | |||
| 203 | 17 | Hiroo Hayashi | displays: |
| 204 | 1 | Hans Ginzel | |
| 205 | >> Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern. |
||
| 206 | 8 | Hans Ginzel | >> To go live, all you need to add is a database and a web server. |
| 207 | > Great! |
||
| 208 | 1 | Hans Ginzel | |
| 209 | h3. Unordered lists |
||
| 210 | |||
| 211 | 17 | Hiroo Hayashi | Unordered lists use asterisks (@*@), pluses (@+@), and hyphens (@-@) as list markers |
| 212 | |||
| 213 | 1 | Hans Ginzel | <pre> |
| 214 | * Item 1 |
||
| 215 | * Item 2 |
||
| 216 | * Item 21 (two spaces indentation) |
||
| 217 | * Item 22 |
||
| 218 | * Item 3 |
||
| 219 | </pre> |
||
| 220 | |||
| 221 | displays: |
||
| 222 | |||
| 223 | * Item 1 |
||
| 224 | * Item 2 |
||
| 225 | ** Item 21 |
||
| 226 | 10 | Hans Ginzel | ** Item 22 |
| 227 | * Item 3 |
||
| 228 | 1 | Hans Ginzel | |
| 229 | h3. Ordered lists |
||
| 230 | |||
| 231 | 17 | Hiroo Hayashi | Ordered lists use numbers followed by periods. |
| 232 | |||
| 233 | 1 | Hans Ginzel | <pre> |
| 234 | 17 | Hiroo Hayashi | 1. Item 1 |
| 235 | 3. Item 2 |
||
| 236 | 2. Item 3 |
||
| 237 | 1. Item 3.1 (two spaces) |
||
| 238 | 1. Item 3.2 |
||
| 239 | 1 | Hans Ginzel | </pre> |
| 240 | |||
| 241 | displays: |
||
| 242 | |||
| 243 | # Item 1 |
||
| 244 | # Item 2 |
||
| 245 | # Item 3 |
||
| 246 | ## Item 3.1 |
||
| 247 | ## Item 3.2 |
||
| 248 | |||
| 249 | 17 | Hiroo Hayashi | Note that the actual numbers you use to mark the list have no effect on the output. |
| 250 | |||
| 251 | 1 | Hans Ginzel | h3. Tables |
| 252 | |||
| 253 | 17 | Hiroo Hayashi | Markdown does not have syntax for a table. Use an HTML table to write a table. |
| 254 | 1 | Hans Ginzel | |
| 255 | 17 | Hiroo Hayashi | <pre><code><table> |
| 256 | <tr><td style="text-align:center;"><strong>UserID</strong></td><td style="text-align:center;"><strong>Name</strong></td><td style="text-align:center;"><strong>Group</strong></td><td style="text-align:center;"><strong>attribute list</strong></td></tr> |
||
| 257 | <tr><td>Starting with</td><td>a</td><td>simple</td><td>row</td></tr> |
||
| 258 | <tr><td style="text-align:center;" colspan="3">IT</td><td>align left</td></tr> |
||
| 259 | <tr><td>1</td><td>Artur Pirozhkov</td><td rowspan="2">Users</td><td style="text-align:right;">align right</td></tr> |
||
| 260 | <tr><td>2</td><td>Vasya Rogov</td><td style="text-align:center;">center</td></tr> |
||
| 261 | <tr><td rowspan="2">3</td><td rowspan="2">John Smith</td><td>Admin</td><td style="vertical-align:top;" rowspan="2">valign top</td></tr> |
||
| 262 | <tr><td>(root)</td></tr> |
||
| 263 | <tr><td rowspan="2">4</td><td rowspan="2">-</td><td>Nobody</td><td style="vertical-align:bottom;" rowspan="2">valign bottom</td></tr> |
||
| 264 | <tr><td>(anonymous)</td></tr> |
||
| 265 | </table> |
||
| 266 | </code></pre> |
||
| 267 | 1 | Hans Ginzel | |
| 268 | 17 | Hiroo Hayashi | displays; |
| 269 | |||
| 270 | |=. *UserID* |=. *Name* |=. *Group* |=. *attribute list* | |
||
| 271 | 1 | Hans Ginzel | |Starting with | a | simple |row | |
| 272 | |\3=.IT |<. align left | |
||
| 273 | |1 |Artur Pirozhkov |/2.Users |>. align right | |
||
| 274 | |2 |Vasya Rogov |=. center | |
||
| 275 | |3 |John Smith |Admin |
||
| 276 | (root) |^. valign top | |
||
| 277 | |4 |- |Nobody |
||
| 278 | (anonymous) |~. valign bottom | |
||
| 279 | |||
| 280 | 17 | Hiroo Hayashi | **Note:** HTML tags need to be allowed to use the HTML tags (<table>, <tr>, <td>). See #15520-16 and #15520-17 for details. |
| 281 | 1 | Hans Ginzel | |
| 282 | h3. Table of content |
||
| 283 | |||
| 284 | <pre><code>{{toc}} => left aligned toc |
||
| 285 | {{>toc}} => right aligned toc |
||
| 286 | </code></pre> |
||
| 287 | |||
| 288 | 15 | Hugues C. | Please keep in mind, that the toc-tag needs an empty line above and underneath it and no other text before and after it. |
| 289 | 1 | Hans Ginzel | |
| 290 | 11 | Hans Ginzel | Example: |
| 291 | |||
| 292 | 17 | Hiroo Hayashi | <pre><code>h1. headLineOne |
| 293 | 11 | Hans Ginzel | |
| 294 | h2. something |
||
| 295 | 1 | Hans Ginzel | |
| 296 | {{toc}} |
||
| 297 | |||
| 298 | 11 | Hans Ginzel | h2. something more |
| 299 | </code></pre> |
||
| 300 | |||
| 301 | 1 | Hans Ginzel | h2. Macros |
| 302 | |||
| 303 | Redmine includes a macros system that lets you add custom functions to insert dynamic content in formatted text. You can learn about writing your own macros in [[RedmineMacros]]. Redmine also includes a few builtin macros: |
||
| 304 | |||
| 305 | {{macro_list}} |
||
| 306 | |||
| 307 | h2. Code highlighting |
||
| 308 | |||
| 309 | 18 | Hiroo Hayashi | Code highlighting relies on "CodeRay":http://coderay.rubychan.de/, a fast syntax highlighting library written completely in Ruby. It currently supports C, C++, CSS, Delphi, Diff, Groovy, HTML, Java, Javascript, JSON, Nitro-XHTML, PHP, Python, RHTML, Ruby, Scheme, SQL, XML and YAML code. |
| 310 | 1 | Hans Ginzel | |
| 311 | You can highlight code in your wiki page using this syntax: |
||
| 312 | |||
| 313 | <pre><code>``` ruby |
||
| 314 | Place your code here. |
||
| 315 | ```</code></pre> |
||
| 316 | |||
| 317 | Example: |
||
| 318 | |||
| 319 | <pre><code class="ruby"> |
||
| 320 | # The Greeter class |
||
| 321 | class Greeter |
||
| 322 | def initialize(name) |
||
| 323 | @name = name.capitalize |
||
| 324 | end |
||
| 325 | |||
| 326 | def salute |
||
| 327 | puts "Hello #{@name}!" |
||
| 328 | end |
||
| 329 | end |
||
| 330 | </code></pre> |
||
| 331 | |||
| 332 | h2. Translation |
||
| 333 | |||
| 334 | Note that the following translations may not be up to date. Please refer to the original english documentation if needed. |
||
| 335 | |||
| 336 | * [[BrRedmineWikiFormatting|Português Brasileiro]] |
||
| 337 | * [[RusRedmineTextFormatting|Русский]] |
||
| 338 | * [[FrRedmineWikiFormatting|French]] |
||
| 339 | * [[KoreanWikiFormatting|Korean]] |
||
| 340 | * [[TurkishWikiFormatting|Türkçe]] |
||
| 341 | * [[TraditionalChineseWikiFormatting|繁體中文]] |
||
| 342 | * [[SimplifiedChineseWikiFormatting|简体中文]] |