Project

General

Profile

RedmineTextFormattingMarkdown » History » Version 2

Hans Ginzel, 2015-12-07 13:40
External links rewritten to Markdown

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