Project

General

Profile

RedmineTextFormattingMarkdown » History » Version 12

pierre pignede, 2016-01-21 12:14

1 1 Hans Ginzel
h1. Markdown formatting
2
3
Below is copy of *Textile* formatting that needs to be updated to *Markdown* formatting. Please help.
4 9 Hans Ginzel
For *Markdown* formatting see #15520, #16373 and #21443.
5 1 Hans Ginzel
6
{{>TOC}}
7
8
h2. Links
9
10
h3. Redmine links
11
12
Redmine allows hyperlinking between resources (issues, changesets, wiki pages...) from anywhere text formatting is used.
13
14
* Link to an issue: *!#124* (displays #124, link is striked-through if the issue is closed)
15
* Link to an issue note: *!#124-6*, or *!#124!#note-6*
16
* Link to a changeset: *!r758* (displays r758)
17
* Link to a changeset with a non-numeric hash: *commit:c6f4d0fd* (displays c6f4d0fd).
18
19
Wiki links:
20
21
* *[[Guide]]* displays a link to the page named 'Guide': [[Guide]]
22
* *[[Guide|User manual]]* displays a link to the same page but with different text: [[Guide|User manual]]
23
* *[[Guide#User-guide|User guide]]* displays a link to the header on the same page with different text: [[Guide#User-guide|User guide]]
24
25
You can also link to pages of another project's wiki (using the project identifier):
26
27
* *[[sandbox:some page]]* displays a link to the page named 'Some page' of the Sandbox wiki
28
* *[[sandbox:]]* displays a link to the Sandbox wiki main page
29
30
Wiki links are displayed in red if the page doesn't exist yet, eg: [[Nonexistent page]].
31
32
Links to others resources:
33
34
* Documents:
35
36
  * *!document#17* (link to document with id 17)
37
  * *!document:Greetings* (link to the document with title "Greetings")
38
  * *!document:"Some document"* (double quotes can be used when document title contains spaces)
39
  * *!sandbox:document:"Some document"* (link to a document with title "Some document" in project identifier "sandbox")
40
41 12 pierre pignede
* Files:
42
43
  * *file#17* (link to files with id 17)
44
45 1 Hans Ginzel
* Versions:
46
47
  * *!version#3* (link to version with id 3)
48
  * *!version:1.0.0* (link to version named "1.0.0")
49
  * *!version:"1.0 beta 2"* (double quotes can be used when version name contains spaces)
50
  * *!sandbox:version:1.0.0* (link to version "1.0.0" in the project identifier "sandbox")
51
52
* Attachments:
53
  
54
  * *!attachment:file.zip* (link to the attachment of the current object named file.zip)
55
  * *!attachment:"file.zip"* (double quotes can be used when the filename contains non word characters)
56
  * 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)
57
58
* Changesets:
59
60
  * *!r758* (link to a changeset)
61
  * *!commit:c6f4d0fd* (link to a changeset with a non-numeric hash)
62
  * *!svn1|r758* (link to a changeset of a specific repository, for projects with multiple repositories)
63
  * *!commit:hg|c6f4d0fd* (link to a changeset with a non-numeric hash of a specific repository)
64
  * *!sandbox:r758* (link to a changeset of another project)
65
  * *!sandbox:commit:c6f4d0fd* (link to a changeset with a non-numeric hash of another project identifier)
66
67
* Repository files:
68
69
  * *!source:some/file*           -- Link to the file located at /some/file in the project's repository
70
  * *!source:some/file@52*        -- Link to the file's revision 52
71
  * *!source:some/file#L120*      -- Link to line 120 of the file
72
  * *!source:some/file@52#L120*   -- Link to line 120 of the file's revision 52
73
  * *!source:"some file@52#L120"* -- Double quotes can be used when the URL contains spaces  
74
  * *!source:repo_identifier|some/file* -- Link to a file in a repository other than the project default repository. 
75
  * *!source:"repo_identifier|some file"* -- Link to a file in a repository other than the project default repository, with spaces in the path. 
76
  * *!export:some/file*           -- Force the download of the file
77
 
78
* Forums:
79
80
  * *!forum#2* (link to forum with id 2)
81
  * *!forum:Discussion* (link to forum with name "Discussion")
82
  * *!forum:"Help and more"* (double quotes can be used when forum name contains spaces)
83
84
* Forum messages:
85
86
  * *!message#1218* (link to message with id 1218)
87
88
* News items
89
90
  * *!news#1* (link to news item with id 1)
91
  * *!news:Greetings* (link to news item with name "Greetings")
92
  * *!news:"eCookbook first release !"* (double quotes can be used when news item name contains spaces)
93
94
* Projects:
95
96
  * *!project#3* (link to project with id 3)
97
  * *!project:someproject* (link to project with name "someproject")
98
  * *!project:"Multiple words project"* (double quotes can be used when project name contains spaces)
99
100
Escaping:
101
102
* You can prevent Redmine links from being parsed by preceding them with an exclamation mark: !
103
104
h3. External links
105
106
HTTP URLs are automatically turned into clickable links: 
107
* *http://www.redmine.org* -- External link to the redmine website: http://www.redmine.org
108
* *someone@foo.bar* -- Link to an email address: someone@foo.bar
109
110
HTTP URLs can also use different text than the link itself:
111 2 Hans Ginzel
* *[Redmine web site](http://www.redmine.org)* -- External link with different text: "Redmine web site":http://www.redmine.org
112
* *[![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: 
113 1 Hans Ginzel
114
p=. !http://www.redmine.org/attachments/7069/Redmine_logo.png(Redmine web site)!:http://www.redmine.org
115
116
h3. Email addresses
117
118
Email addresses are automatically turned into clickable links:
119
120 3 Hans Ginzel
* *[Email someone](mailto:someone@foo.bar)* -- Email link with different text: "Email someone":mailto:someone@foo.bar
121 1 Hans Ginzel
122
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.
123 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
124
* *[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
125
* *[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
126 1 Hans Ginzel
127
h2. Text formatting
128
129 4 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.
130 1 Hans Ginzel
131
h3. Acronym
132 4 Hans Ginzel
133
?? in Markdown
134 1 Hans Ginzel
135
<pre>
136
JPL(Jean-Philippe Lang)
137
</pre>
138
139
Display:
140
141
JPL(Jean-Philippe Lang)
142
143
h3. Font style
144
145 5 Hans Ginzel
<pre><code>* **bold** __bold__
146
* *italic* _italic_
147
* ***bold italic*** ___bold italic___
148
* <ins>underline</ins>
149
* <del>strike through</del>
150
* Plain <sup>superscript</sup>
151
* Plain <sub>subscript</sub>
152
* `inline monospace`
153
* normal **bold** _italic_ normal;E=mc<sup>2</sup>
154 1 Hans Ginzel
* <notextile>normal<notextile></notextile>*bold*<notextile></notextile>_italic_<notextile></notextile>normal;E=mc<notextile></notextile>^2^</notextile>
155
* <notextile>Escaping: <notextile>*bold* _italic_ @inlinemono@</notextile> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Alternative using HTML-codes: &#42;bold&#42; &#95;italic&#95; &#64;inlinemono&#64;</notextile>
156
* <notextile><pre>*some lines*      some "link":http://www.redmine.org</pre></notextile>
157
* <notextile><pre><notextile></notextile>*some lines*      some "link":http://www.redmine.org</pre></notextile>
158
</code></pre>
159
160
Display:
161
162 5 Hans Ginzel
 * *bold* *bold*
163
 * _italic_ _italic_
164
 * *_bold italic_* *_bold italic_*
165 1 Hans Ginzel
 * +underline+
166
 * -strike-through-
167
 * Plain ^superscript^
168
 * Plain ~subscript~
169
 * @inline monospace@
170
 * normal *bold* _italic_ normal;E=mc ^2^
171
 * normal<notextile></notextile>*bold*<notextile></notextile>_italic_<notextile></notextile>normal;E=mc<notextile></notextile>^2^
172
 * Escaping: <notextile>*bold* _italic_ @inlinemono@</notextile> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Alternative using HTML-codes: &#42;bold&#42; &#95;italic&#95; &#64;inlinemono&#64;
173
 * <pre>*some lines*      some "link":http://www.redmine.org</pre>
174
 * <pre><notextile></notextile>*some lines*      some "link":http://www.redmine.org</pre>
175
176
h3. Colour
177
178
<pre><code><notextile>* %{color:red}red% %{color:green}green% %{color:yellow}yellow% %{color:#82B6E1}blue'ish%
179
* %{color:red}red%<notextile></notextile>%{color:green}green%<notextile></notextile>%{color:yellow}yellow%<notextile></notextile>%{color:#82B6E1}blue'ish%
180
* %{background:lightgreen}Lightgreen Background% %{background:yellow}Yellow Background%
181
* %{background:lightgreen}Lightgreen Background%<notextile></notextile>%{background:yellow}Yellow Background%
182
</notextile></code></pre>
183
184
Display:
185
186
 * %{color:red}red% %{color:green}green% %{color:yellow}yellow% %{color:#82B6E1}blue'ish%
187
 * %{color:red}red%<notextile></notextile>%{color:green}green%<notextile></notextile>%{color:yellow}yellow%<notextile></notextile>%{color:#82B6E1}blue'ish%
188
 * %{background:lightgreen}Lightgreen Background% %{background:yellow}Yellow Background%
189
 * %{background:lightgreen}Lightgreen Background%<notextile></notextile>%{background:yellow}Yellow Background%
190
191
h3. Inline images
192
193 6 Hans Ginzel
* *![](image_url)* displays an image located at image_url (textile syntax)
194
* *![](image_url)* right floating image, see http://stackoverflow.com/questions/255170/markdown-and-image-alignment
195
* *![Image title](image_url)* displays an image with an alt/title attribute
196 1 Hans Ginzel
* *&#33;image_url&#33;:URL* displays an image located at image_url with link URL added
197
198
If you have an image attached to your wiki page, it can be displayed inline using its filename: *&#33;attached_image.png&#33;*
199
200
You can also apply a CSS style to the image in the same ways as styling SPANs. The code *&#33;{width: 100%}attached_image.png&#33;* will make the image adjusts to the parent's width.
201
202
h3. Headings
203
204 7 Hans Ginzel
<pre><code># Heading
205 1 Hans Ginzel
206 7 Hans Ginzel
## Subheading
207 1 Hans Ginzel
208 7 Hans Ginzel
### Subheading
209
210
or
211
212
Heading
213
=======
214
215
Subheading
216
----------
217 1 Hans Ginzel
</code></pre>
218
219
Redmine assigns an anchor to each of those headings thus you can link to them with "#Heading", "#Subheading" and so forth.
220
221
h3. Paragraphs
222
223
<pre><code>p. left aligned
224
225
  p(. left ident 1em
226
227
    p((. left ident 2em
228
    as well as for following lines
229
230
                                                                                   p>. right aligned
231
232
                                                                        p)))>. right ident 3em
233
234
                           p=. This is centered paragraph.
235
</code></pre>
236
237
h3. Horizontal rule 
238
239
@----@
240
Display: 
241
242
----
243
244
245
h3. Predefined
246
247
To escape wiki syntax
248
<pre> <pre> *Your text won't become bold* </pre> </pre>
249
Display:
250
251
<pre> *Your text won't become bold* </pre>
252
253
h3. Blockquotes
254
255
Start the paragraph with *bq.*:
256
257
<pre><code>bq. Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.
258
To go live, all you need to add is a database and a web server.
259
</code></pre>
260
261
Displays:
262
263
bq. Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.
264
To go live, all you need to add is a database and a web server.
265
266
You can also use > at the beginning of each line and stack them for nested quotes:
267
268
<pre>
269
>> Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.
270
>> To go live, all you need to add is a database and a web server.
271
> Great!
272
</pre>
273
274
Displays:
275
276
>>  Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.
277
>>  To go live, all you need to add is a database and a web server.
278
> Great!
279
280
h3. Unordered lists
281
282
<pre>
283
* Item 1
284
* Item 2
285 8 Hans Ginzel
  * Item 21 (two spaces indentation)
286
  * Item 22
287 1 Hans Ginzel
* Item 3
288
</pre>
289
290
displays:
291
292
* Item 1
293
* Item 2
294
** Item 21
295
** Item 22
296
* Item 3
297
298
h3. Ordered lists
299
300
<pre>
301
# Item 1
302
# Item 2
303
# Item 3
304 10 Hans Ginzel
  # Item 3.1 (two spaces)
305
  # Item 3.2
306 1 Hans Ginzel
</pre>
307
308
displays:
309
310
# Item 1
311
# Item 2
312
# Item 3
313
## Item 3.1
314
## Item 3.2
315
316
h3. Tables
317
318
<pre>
319
|_.UserID      |_.Name          |_.Group     |_. attribute list   |
320
|Starting with | a              |   simple   |row                 |
321
|\3=.IT                                      |<. align left       |
322
|1             |Artur Pirozhkov |/2.Users    |>. align right      |
323
|2             |Vasya Rogov     |=. center   |
324
|3             |John Smith      |Admin
325
                                 (root)      |^. valign top       |
326
|4             |-               |Nobody
327
                                 (anonymous) |~. valign bottom    |
328
</pre>
329
330
displays (all multiple spaces are replaced by 1 space):
331
332
|_.UserID      |_.Name          |_.Group     |_. attribute list   |
333
|Starting with | a              |   simple   |row                 |
334
|\3=.IT                                      |<. align left       |
335
|1             |Artur Pirozhkov |/2.Users    |>. align right      |
336
|2             |Vasya Rogov     |=. center   |
337
|3             |John Smith      |Admin
338
                                 (root)      |^. valign top       |
339
|4             |-               |Nobody
340
                                 (anonymous) |~. valign bottom    |
341
342
If you want to include pipe characters inside your table (e.g. for Wiki links), you need to prevent textile from interpreting them:
343
344
|_.Input |_. Output|
345
|*<notextile><notextile>|</notextile></notextile>*|<notextile>|</notextile>|
346
347
h3. Table of content
348
349
<pre><code>{{toc}} => left aligned toc
350
{{>toc}} => right aligned toc
351
</code></pre>
352
353
Please keep in mind, that the toc-tag needs an empty line above and underneath it and no other text before and after it.
354
355
Example:
356
357
<pre><code>
358
h1. headLineOne
359
360
h2. something
361
362
{{toc}}
363
364
h2. something more
365
</code></pre>
366
367
h2. Macros
368
369
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:
370
371
{{macro_list}}
372
373 11 Hans Ginzel
h2.
374
 Code highlighting
375 1 Hans Ginzel
376 11 Hans Ginzel
Code highlighting relies on "CodeRay":http://coderay.rubychan.de/, a 
377
fast syntax highlighting library written completely in Ruby. It 
378
currently supports C, C++, CSS, Delphi, Diff, Groovy, HTML, Java, 
379
Javascript, JSON, Nitro-XHTML, PHP, Python, RHTML, Ruby, Scheme, SQL, 
380
XML and YAML code.
381 1 Hans Ginzel
382
You can highlight code in your wiki page using this syntax:
383
384 11 Hans Ginzel
<pre><code>``` ruby
385
Place your code here.
386
```</code></pre>
387 1 Hans Ginzel
388
Example:
389
390
<pre><code class="ruby">
391
# The Greeter class
392
class Greeter
393
  def initialize(name)
394
    @name = name.capitalize
395
  end
396
 
397
  def salute
398
    puts "Hello #{@name}!"
399
  end
400
end
401
</code></pre>
402
403
h2. Textile formatting
404
405
Redmine supports textile formatting. For details see "Textile syntax":http://en.wikipedia.org/wiki/Textile_%28markup_language%29
406
407
Additional supported textiles:
408
* *<notextile>%</notextile>{background:lightgreen}Green Background%* displays %{background:lightgreen}Green Background%
409
410
h2. Translation
411
412
Note that the following translations may not be up to date. Please refer to the original english documentation if needed.
413
414
* [[BrRedmineWikiFormatting|Português Brasileiro]]
415
* [[RusRedmineTextFormatting|Русский]]
416
* [[FrRedmineWikiFormatting|French]]
417
* [[KoreanWikiFormatting|Korean]]
418
* [[TurkishWikiFormatting|Türkçe]]
419
* [[TraditionalChineseWikiFormatting|繁體中文]]
420
* [[SimplifiedChineseWikiFormatting|简体中文]]