Project

General

Profile

RedmineTextFormattingMarkdown » History » Version 31

Piotr Robert Konopelko, 2021-09-24 19:47
Added information about how to patch Redmine to allow HTML tags in Markdown in all the places where it should be mentioned

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 21 Go MAEDA
URLs (http, https, ftp and ftps) 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 21 Go MAEDA
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 22 Ivan Tsybanenko
* *[![Redmine web site](http://www.redmine.org/attachments/7069/Redmine_logo.png)](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 19 Hiroo Hayashi
* normal<strong>bold</strong><em>italic</em>normal;E=mc<sup>2</sup>
59 17 Hiroo Hayashi
* 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 23 Go MAEDA
 * 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 19 Hiroo Hayashi
**Note:** HTML tags need to be allowed to use the HTML tags (<strong>, <em>, <ins>, <del>, <sup>, <sub>).  See #15520-16 and #15520-17 for details.
81 31 Piotr Robert Konopelko
More explicitly, you need to patch redmine, as explained in "this post":https://www.redmine.org/boards/2/topics/56096?r=57052#message-57052
82 1 Hans Ginzel
83 17 Hiroo Hayashi
h3. Color
84
85
<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>
86
* <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>
87
* <span style="background-color:lightgreen">Lightgreen Background</span> <span style="background-color:yellow">Yellow Background</span>
88
* <span style="background-color:lightgreen">Lightgreen Background</span><span style="background-color:yellow">Yellow Background</span>
89 1 Hans Ginzel
</notextile></code></pre>
90
91 17 Hiroo Hayashi
displays:
92 1 Hans Ginzel
93
 * %{color:red}red% %{color:green}green% %{color:yellow}yellow% %{color:#82B6E1}blue'ish%
94
 * %{color:red}red%<notextile></notextile>%{color:green}green%<notextile></notextile>%{color:yellow}yellow%<notextile></notextile>%{color:#82B6E1}blue'ish%
95
 * %{background:lightgreen}Lightgreen Background% %{background:yellow}Yellow Background%
96
 * %{background:lightgreen}Lightgreen Background%<notextile></notextile>%{background:yellow}Yellow Background%
97
98
**Note:** HTML tags need to be allowed to use the HTML tag (<span>).  See #15520-16 and #15520-17 for details.
99 31 Piotr Robert Konopelko
More explicitly, you need to patch redmine, as explained in "this post":https://www.redmine.org/boards/2/topics/56096?r=57052#message-57052
100 26 Tuan-Tu Tran
101 17 Hiroo Hayashi
102 1 Hans Ginzel
h3. Inline images
103
104
* *![](image_url)* displays an image located at image_url (textile syntax)
105 17 Hiroo Hayashi
* *![alt text](image_url "optional title")* displays an image with an alt/title attribute
106
* *[![](image_url)](URL)* displays an image located at image_url with link URL added
107 1 Hans Ginzel
108 17 Hiroo Hayashi
If you have an image attached to your wiki page, it can be displayed inline using its filename: *![](attached_image.png)*.
109 1 Hans Ginzel
110 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.
111 1 Hans Ginzel
112 17 Hiroo Hayashi
* <img style="float:right" src="URL"/>
113
* <img style="width:100%" src="attached_image.png"/>
114
115 1 Hans Ginzel
**Note:** HTML tags need to be allowed to use the HTML tag (<img>).  See #15520-16 and #15520-17 for details.
116 31 Piotr Robert Konopelko
More explicitly, you need to patch redmine, as explained in "this post":https://www.redmine.org/boards/2/topics/56096?r=57052#message-57052
117 17 Hiroo Hayashi
118
119 1 Hans Ginzel
h3. Headings
120
121
<pre><code># Heading
122
123
## Subheading
124
125
### Subheading
126
127
or
128
129
Heading
130
=======
131
132
Subheading
133
----------
134
</code></pre>
135
136
Redmine assigns an anchor to each of those headings thus you can link to them with "#Heading", "#Subheading" and so forth.
137
138
h3. Paragraphs
139
140 17 Hiroo Hayashi
Markdown does not support alignment of a paragraph.  Use &lt;div> tags if you need it.
141 1 Hans Ginzel
142 17 Hiroo Hayashi
<pre><code>left aligned
143
<div style="padding-left:1em;">
144
left ident 1em
145
</div>
146 1 Hans Ginzel
147 17 Hiroo Hayashi
<div style="padding-left:2em;">
148
left ident 2em
149
as well as for following lines
150
</div>
151 1 Hans Ginzel
152 17 Hiroo Hayashi
<div style="text-align:right;">
153
right aligned
154
</div>
155 1 Hans Ginzel
156 17 Hiroo Hayashi
<div style="padding-right:3em;text-align:right;">
157
right ident 3em
158
</div>
159 1 Hans Ginzel
160 17 Hiroo Hayashi
<div style="text-align:center;">
161
This is centered paragraph.
162
</div></code></pre>
163 1 Hans Ginzel
164 17 Hiroo Hayashi
displays;
165 1 Hans Ginzel
166 17 Hiroo Hayashi
p. left aligned
167 1 Hans Ginzel
168 17 Hiroo Hayashi
p(. left ident 1em
169 1 Hans Ginzel
170 17 Hiroo Hayashi
p((. left ident 2em
171
as well as for following lines
172 1 Hans Ginzel
173 17 Hiroo Hayashi
p>. right aligned
174 1 Hans Ginzel
175 17 Hiroo Hayashi
p)))>. right ident 3em
176 1 Hans Ginzel
177 17 Hiroo Hayashi
p=. This is centered paragraph.
178 1 Hans Ginzel
179
**Note:** HTML tags need to be allowed to use the HTML tags (<div>).  See #15520-16 and #15520-17 for details.
180 31 Piotr Robert Konopelko
More explicitly, you need to patch redmine, as explained in "this post":https://www.redmine.org/boards/2/topics/56096?r=57052#message-57052
181 1 Hans Ginzel
182 17 Hiroo Hayashi
h3. Horizontal rule 
183 1 Hans Ginzel
184 17 Hiroo Hayashi
@----@
185 1 Hans Ginzel
186 17 Hiroo Hayashi
displays: 
187 1 Hans Ginzel
188 17 Hiroo Hayashi
----
189 1 Hans Ginzel
190 17 Hiroo Hayashi
h3. Preformatted Text
191 1 Hans Ginzel
192 17 Hiroo Hayashi
<pre> <pre>**Your text won't become bold**</pre> </pre>
193
194
displays:
195
196
<pre>**Your text won't become bold**</pre>
197
198
h3. Blockquotes
199
200
You can use > at the beginning of each line and stack them for nested quotes:
201
202 1 Hans Ginzel
<pre>
203
>> Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.
204
>> To go live, all you need to add is a database and a web server.
205
> Great!
206
</pre>
207
208 17 Hiroo Hayashi
displays:
209 1 Hans Ginzel
210
>>  Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.
211 8 Hans Ginzel
>>  To go live, all you need to add is a database and a web server.
212
> Great!
213 1 Hans Ginzel
214
h3. Unordered lists
215
216 17 Hiroo Hayashi
Unordered lists use asterisks (@*@), pluses (@+@), and hyphens (@-@) as list markers
217
218 1 Hans Ginzel
<pre>
219
* Item 1
220
* Item 2
221
  * Item 21 (two spaces indentation)
222
  * Item 22
223
* Item 3
224
</pre>
225
226
displays:
227
228
* Item 1
229
* Item 2
230
** Item 21
231 10 Hans Ginzel
** Item 22
232
* Item 3
233 1 Hans Ginzel
234
h3. Ordered lists
235
236 29 Jan K.
Ordered lists use numbers followed by periods. 
237 17 Hiroo Hayashi
238 1 Hans Ginzel
<pre>
239 17 Hiroo Hayashi
1. Item 1
240
3. Item 2
241
2. Item 3
242
  1. Item 3.1 (two spaces)
243 1 Hans Ginzel
  1. Item 3.2
244 29 Jan K.
</pre>
245
246
247 1 Hans Ginzel
248
displays:
249
250
# Item 1
251
# Item 2
252
# Item 3
253
## Item 3.1
254
## Item 3.2
255
256 17 Hiroo Hayashi
Note that the actual numbers you use to mark the list have no effect on the output.
257
258 1 Hans Ginzel
h3. Tables
259
260 27 Go MAEDA
<pre>
261
|UserID (align right)|Name (align left)|Group (align center)|
262
|-------------------:|:----------------|:------------------:|
263
|2                   |John Smith       |                    |
264
|3                   |Dave Lopper      |A Team              |
265
|4                   |Robert Hill      |B Team              |
266
</pre>
267 1 Hans Ginzel
268 27 Go MAEDA
displays (all multiple spaces are replaced by 1 space):
269 1 Hans Ginzel
270 27 Go MAEDA
|_>. UserID (align right)|_<. Name (align left)|_=. Group (align center)|
271
|>. 2                    |<. John Smith        |                        |
272
|>. 3                    |<. Dave Lopper       |_=. A Team              |
273
|>. 4                    |<. Robert Hill       |_=. B Team              |
274 17 Hiroo Hayashi
275 1 Hans Ginzel
276
h3. Table of content
277
278
<pre><code>{{toc}} => left aligned toc
279
{{>toc}} => right aligned toc
280
</code></pre>
281
282 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.
283 1 Hans Ginzel
284 11 Hans Ginzel
Example:
285
286 17 Hiroo Hayashi
<pre><code>h1. headLineOne
287 11 Hans Ginzel
288
h2. something
289 1 Hans Ginzel
290
{{toc}}
291
292 11 Hans Ginzel
h2. something more
293
</code></pre>
294
295 20 Dietmar H
h3. Footnotes
296
297
A footnote works very much like a reference-style link: it consists of a marker next to the text, e.g. <pre>This is a sentence.[^1]</pre> and a footnote definition on its own line anywhere within the document, e.g. <pre>[^1]: This is a footnote.</pre>
298
299
300 1 Hans Ginzel
h2. Macros
301
302
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:
303
304
{{macro_list}}
305
306
h2. Code highlighting
307
308 24 Go MAEDA
Default code highlightment relies on "Rouge":http://rouge.jneen.net/, 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 [[RedmineCodeHighlightingLanguages]] for the full list of supported languages.
309 1 Hans Ginzel
310
You can highlight code in your wiki page using this syntax:
311
312
<pre><code>``` ruby
313
Place your code here.
314
```</code></pre>
315
316
Example:
317
318
<pre><code class="ruby">
319
# The Greeter class
320
class Greeter
321
  def initialize(name)
322
    @name = name.capitalize
323
  end
324
 
325
  def salute
326
    puts "Hello #{@name}!"
327
  end
328
end
329
</code></pre>
330
331
h2. Translation
332
333
Note that the following translations may not be up to date. Please refer to the original english documentation if needed.
334
335
* [[BrRedmineWikiFormatting|Português Brasileiro]]
336
* [[RusRedmineTextFormatting|Русский]]
337
* [[FrRedmineWikiFormatting|French]]
338 28 C S
* [[DeRedmineTextFormattingMarkdown|Deutsch]]
339 1 Hans Ginzel
* [[KoreanWikiFormatting|Korean]]
340
* [[TurkishWikiFormatting|Türkçe]]
341
* [[TraditionalChineseWikiFormatting|繁體中文]]
342
* [[SimplifiedChineseWikiFormatting|简体中文]]