Project

General

Profile

RedmineTextFormattingMarkdown » History » Version 14

Hans Ginzel, 2016-02-04 20:09
Links to Repositories

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