Project

General

Profile

RedmineTextFormattingMarkdown » History » Version 4

Hans Ginzel, 2015-12-07 15:04
Text formatting first paragraph converted 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 3 Hans Ginzel
* *[Email someone](mailto:someone@foo.bar)* -- Email link with different text: "Email someone":mailto:someone@foo.bar
117 1 Hans Ginzel
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 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
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 1 Hans Ginzel
123
h2. Text formatting
124
125 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.
126 1 Hans Ginzel
127
h3. Acronym
128 4 Hans Ginzel
129
?? in Markdown
130 1 Hans Ginzel
131
<pre>
132
JPL(Jean-Philippe Lang)
133
</pre>
134
135
Display:
136
137
JPL(Jean-Philippe Lang)
138
139
h3. Font style
140
141
<pre><code>* *bold*
142
* _italic_
143
* *_bold italic_*
144
* +underline+
145
* -strike-through-
146
* Plain ^superscript^
147
* Plain ~subscript~
148
* @inline monospace@
149
* <notextile>normal *bold* _italic_ normal;E=mc ^2^</notextile>
150
* <notextile>normal<notextile></notextile>*bold*<notextile></notextile>_italic_<notextile></notextile>normal;E=mc<notextile></notextile>^2^</notextile>
151
* <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>
152
* <notextile><pre>*some lines*      some "link":http://www.redmine.org</pre></notextile>
153
* <notextile><pre><notextile></notextile>*some lines*      some "link":http://www.redmine.org</pre></notextile>
154
</code></pre>
155
156
Display:
157
158
 * *bold*
159
 * _italic_
160
 * *_bold italic_*
161
 * +underline+
162
 * -strike-through-
163
 * Plain ^superscript^
164
 * Plain ~subscript~
165
 * @inline monospace@
166
 * normal *bold* _italic_ normal;E=mc ^2^
167
 * normal<notextile></notextile>*bold*<notextile></notextile>_italic_<notextile></notextile>normal;E=mc<notextile></notextile>^2^
168
 * Escaping: <notextile>*bold* _italic_ @inlinemono@</notextile> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Alternative using HTML-codes: &#42;bold&#42; &#95;italic&#95; &#64;inlinemono&#64;
169
 * <pre>*some lines*      some "link":http://www.redmine.org</pre>
170
 * <pre><notextile></notextile>*some lines*      some "link":http://www.redmine.org</pre>
171
172
h3. Colour
173
174
<pre><code><notextile>* %{color:red}red% %{color:green}green% %{color:yellow}yellow% %{color:#82B6E1}blue'ish%
175
* %{color:red}red%<notextile></notextile>%{color:green}green%<notextile></notextile>%{color:yellow}yellow%<notextile></notextile>%{color:#82B6E1}blue'ish%
176
* %{background:lightgreen}Lightgreen Background% %{background:yellow}Yellow Background%
177
* %{background:lightgreen}Lightgreen Background%<notextile></notextile>%{background:yellow}Yellow Background%
178
</notextile></code></pre>
179
180
Display:
181
182
 * %{color:red}red% %{color:green}green% %{color:yellow}yellow% %{color:#82B6E1}blue'ish%
183
 * %{color:red}red%<notextile></notextile>%{color:green}green%<notextile></notextile>%{color:yellow}yellow%<notextile></notextile>%{color:#82B6E1}blue'ish%
184
 * %{background:lightgreen}Lightgreen Background% %{background:yellow}Yellow Background%
185
 * %{background:lightgreen}Lightgreen Background%<notextile></notextile>%{background:yellow}Yellow Background%
186
187
h3. Inline images
188
189
* *&#33;image_url&#33;* displays an image located at image_url (textile syntax)
190
* *&#33;>image_url&#33;* right floating image
191
* *&#33;image_url(Image title)&#33;* displays an image with an alt/title attribute
192
* *&#33;image_url&#33;:URL* displays an image located at image_url with link URL added
193
194
If you have an image attached to your wiki page, it can be displayed inline using its filename: *&#33;attached_image.png&#33;*
195
196
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.
197
198
h3. Headings
199
200
<pre><code>h1. Heading
201
202
h2. Subheading
203
204
h3. Subheading
205
</code></pre>
206
207
Redmine assigns an anchor to each of those headings thus you can link to them with "#Heading", "#Subheading" and so forth.
208
209
h3. Paragraphs
210
211
<pre><code>p. left aligned
212
213
  p(. left ident 1em
214
215
    p((. left ident 2em
216
    as well as for following lines
217
218
                                                                                   p>. right aligned
219
220
                                                                        p)))>. right ident 3em
221
222
                           p=. This is centered paragraph.
223
</code></pre>
224
225
h3. Horizontal rule 
226
227
@----@
228
Display: 
229
230
----
231
232
233
h3. Predefined
234
235
To escape wiki syntax
236
<pre> <pre> *Your text won't become bold* </pre> </pre>
237
Display:
238
239
<pre> *Your text won't become bold* </pre>
240
241
h3. Blockquotes
242
243
Start the paragraph with *bq.*:
244
245
<pre><code>bq. Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.
246
To go live, all you need to add is a database and a web server.
247
</code></pre>
248
249
Displays:
250
251
bq. Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.
252
To go live, all you need to add is a database and a web server.
253
254
You can also use > at the beginning of each line and stack them for nested quotes:
255
256
<pre>
257
>> 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
> Great!
260
</pre>
261
262
Displays:
263
264
>>  Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.
265
>>  To go live, all you need to add is a database and a web server.
266
> Great!
267
268
h3. Unordered lists
269
270
<pre>
271
* Item 1
272
* Item 2
273
** Item 21
274
** Item 22
275
* Item 3
276
</pre>
277
278
displays:
279
280
* Item 1
281
* Item 2
282
** Item 21
283
** Item 22
284
* Item 3
285
286
h3. Ordered lists
287
288
<pre>
289
# Item 1
290
# Item 2
291
# Item 3
292
## Item 3.1
293
## Item 3.2
294
</pre>
295
296
displays:
297
298
# Item 1
299
# Item 2
300
# Item 3
301
## Item 3.1
302
## Item 3.2
303
304
h3. Tables
305
306
<pre>
307
|_.UserID      |_.Name          |_.Group     |_. attribute list   |
308
|Starting with | a              |   simple   |row                 |
309
|\3=.IT                                      |<. align left       |
310
|1             |Artur Pirozhkov |/2.Users    |>. align right      |
311
|2             |Vasya Rogov     |=. center   |
312
|3             |John Smith      |Admin
313
                                 (root)      |^. valign top       |
314
|4             |-               |Nobody
315
                                 (anonymous) |~. valign bottom    |
316
</pre>
317
318
displays (all multiple spaces are replaced by 1 space):
319
320
|_.UserID      |_.Name          |_.Group     |_. attribute list   |
321
|Starting with | a              |   simple   |row                 |
322
|\3=.IT                                      |<. align left       |
323
|1             |Artur Pirozhkov |/2.Users    |>. align right      |
324
|2             |Vasya Rogov     |=. center   |
325
|3             |John Smith      |Admin
326
                                 (root)      |^. valign top       |
327
|4             |-               |Nobody
328
                                 (anonymous) |~. valign bottom    |
329
330
If you want to include pipe characters inside your table (e.g. for Wiki links), you need to prevent textile from interpreting them:
331
332
|_.Input |_. Output|
333
|*<notextile><notextile>|</notextile></notextile>*|<notextile>|</notextile>|
334
335
h3. Table of content
336
337
<pre><code>{{toc}} => left aligned toc
338
{{>toc}} => right aligned toc
339
</code></pre>
340
341
Please keep in mind, that the toc-tag needs an empty line above and underneath it and no other text before and after it.
342
343
Example:
344
345
<pre><code>
346
h1. headLineOne
347
348
h2. something
349
350
{{toc}}
351
352
h2. something more
353
</code></pre>
354
355
h2. Macros
356
357
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:
358
359
{{macro_list}}
360
361
h2. Code highlighting
362
363
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.
364
365
You can highlight code in your wiki page using this syntax:
366
367
<pre><code><pre><code class="ruby">
368
  Place your code here.
369
</code></pre>
370
</code></pre>
371
372
Example:
373
374
<pre><code class="ruby">
375
# The Greeter class
376
class Greeter
377
  def initialize(name)
378
    @name = name.capitalize
379
  end
380
 
381
  def salute
382
    puts "Hello #{@name}!"
383
  end
384
end
385
</code></pre>
386
387
h2. Textile formatting
388
389
Redmine supports textile formatting. For details see "Textile syntax":http://en.wikipedia.org/wiki/Textile_%28markup_language%29
390
391
Additional supported textiles:
392
* *<notextile>%</notextile>{background:lightgreen}Green Background%* displays %{background:lightgreen}Green Background%
393
394
h2. Translation
395
396
Note that the following translations may not be up to date. Please refer to the original english documentation if needed.
397
398
* [[BrRedmineWikiFormatting|Português Brasileiro]]
399
* [[RusRedmineTextFormatting|Русский]]
400
* [[FrRedmineWikiFormatting|French]]
401
* [[KoreanWikiFormatting|Korean]]
402
* [[TurkishWikiFormatting|Türkçe]]
403
* [[TraditionalChineseWikiFormatting|繁體中文]]
404
* [[SimplifiedChineseWikiFormatting|简体中文]]