Project

General

Profile

RedmineTextFormatting » History » Version 120

Toshi MARUYAMA, 2015-11-02 13:03
rollback to previous version (#20987)

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