Project

General

Profile

RedmineTextFormattingTextile » History » Version 17

Csaba Nyéki, 2025-05-08 00:36

1 1 Hans Ginzel
h1. Textile formatting
2
3 3 Hiroo Hayashi
Below is *Textile* formatting. For *Markdown* formatting see [[RedmineTextFormattingMarkdown]].
4
For limitations of current Textile support see #6269, #10078 (Definition Lists).
5 1 Hans Ginzel
6
{{>TOC}}
7
8
h2. Links
9
10
h3. Redmine links
11
12 4 Hiroo Hayashi
{{include(RedmineTextFormattingRedmineLinks)}}
13 1 Hans Ginzel
14
h3. External links
15
16 7 Go MAEDA
URLs (http, https, ftp and ftps) are automatically turned into clickable links: 
17 1 Hans Ginzel
* *http://www.redmine.org* -- External link to the redmine website: http://www.redmine.org
18
19 7 Go MAEDA
URLs can also use different text than the link itself:
20 1 Hans Ginzel
* *"Redmine web site":http://www.redmine.org* -- External link with different text: "Redmine web site":http://www.redmine.org
21
* *!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: 
22
23
p=. !http://www.redmine.org/attachments/7069/Redmine_logo.png(Redmine web site)!:http://www.redmine.org
24
25 6 Seung Soo Mun
File URI can be used to link UNC path:
26
* *"\\server\share$":file://///server/share%24* -- File URI showing UNC path: "\\server\share$":file://///server/share%24
27
You should "URL Encodings":http://www.w3schools.com/tags/ref_urlencode.asp for special characters like empty space, $, á, é, í, ó, ú, etc.
28
29 1 Hans Ginzel
h3. Email addresses
30
31
Email addresses are automatically turned into clickable links:
32
33 3 Hiroo Hayashi
* *someone@foo.bar* -- Link to an email address: someone@foo.bar
34 1 Hans Ginzel
* *"Email someone":mailto:someone@foo.bar* -- Email link with different text: "Email someone":mailto:someone@foo.bar
35
36
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.
37
* *"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
38
* *"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
39 10 Charles Sun
* *"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: "My problem is ":mailto:someone@foo.bar?subject=Website%20Help&body=My%20problem%20is%20
40 1 Hans Ginzel
41
h2. Text formatting
42
43
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.
44
45
h3. Acronym
46
47
<pre>
48
JPL(Jean-Philippe Lang)
49
</pre>
50
51 3 Hiroo Hayashi
displays:
52 1 Hans Ginzel
53
JPL(Jean-Philippe Lang)
54
55
h3. Font style
56
57
<pre><code>* *bold*
58
* _italic_
59
* *_bold italic_*
60
* +underline+
61
* -strike-through-
62
* Plain ^superscript^
63
* Plain ~subscript~
64
* @inline monospace@
65
* <notextile>normal *bold* _italic_ normal;E=mc ^2^</notextile>
66
* <notextile>normal<notextile></notextile>*bold*<notextile></notextile>_italic_<notextile></notextile>normal;E=mc<notextile></notextile>^2^</notextile>
67
* <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>
68
* <notextile><pre>*some lines*      some "link":http://www.redmine.org</pre></notextile>
69
* <notextile><pre><notextile></notextile>*some lines*      some "link":http://www.redmine.org</pre></notextile>
70
</code></pre>
71
72 3 Hiroo Hayashi
displays:
73 1 Hans Ginzel
74
 * *bold*
75
 * _italic_
76
 * *_bold italic_*
77
 * +underline+
78
 * -strike-through-
79
 * Plain ^superscript^
80
 * Plain ~subscript~
81
 * @inline monospace@
82
 * normal *bold* _italic_ normal;E=mc ^2^
83
 * normal<notextile></notextile>*bold*<notextile></notextile>_italic_<notextile></notextile>normal;E=mc<notextile></notextile>^2^
84
 * Escaping: <notextile>*bold* _italic_ @inlinemono@</notextile> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Alternative using HTML-codes: &#42;bold&#42; &#95;italic&#95; &#64;inlinemono&#64;
85
 * <pre>*some lines*      some "link":http://www.redmine.org</pre>
86
 * <pre><notextile></notextile>*some lines*      some "link":http://www.redmine.org</pre>
87
88 3 Hiroo Hayashi
h3. Color
89 1 Hans Ginzel
90
<pre><code><notextile>* %{color:red}red% %{color:green}green% %{color:yellow}yellow% %{color:#82B6E1}blue'ish%
91
* %{color:red}red%<notextile></notextile>%{color:green}green%<notextile></notextile>%{color:yellow}yellow%<notextile></notextile>%{color:#82B6E1}blue'ish%
92
* %{background:lightgreen}Lightgreen Background% %{background:yellow}Yellow Background%
93
* %{background:lightgreen}Lightgreen Background%<notextile></notextile>%{background:yellow}Yellow Background%
94
</notextile></code></pre>
95
96 3 Hiroo Hayashi
displays:
97 1 Hans Ginzel
98
 * %{color:red}red% %{color:green}green% %{color:yellow}yellow% %{color:#82B6E1}blue'ish%
99
 * %{color:red}red%<notextile></notextile>%{color:green}green%<notextile></notextile>%{color:yellow}yellow%<notextile></notextile>%{color:#82B6E1}blue'ish%
100
 * %{background:lightgreen}Lightgreen Background% %{background:yellow}Yellow Background%
101
 * %{background:lightgreen}Lightgreen Background%<notextile></notextile>%{background:yellow}Yellow Background%
102
103
h3. Inline images
104
105
* *&#33;image_url&#33;* displays an image located at image_url (textile syntax)
106
* *&#33;>image_url&#33;* right floating image
107
* *&#33;image_url(Image title)&#33;* displays an image with an alt/title attribute
108
* *&#33;image_url&#33;:URL* displays an image located at image_url with link URL added
109
110
If you have an image attached to your wiki page, it can be displayed inline using its filename: *&#33;attached_image.png&#33;*
111
112
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.
113
114
h3. Headings
115
116
<pre><code>h1. Heading
117
118
h2. Subheading
119
120
h3. Subheading
121
</code></pre>
122
123
Redmine assigns an anchor to each of those headings thus you can link to them with "#Heading", "#Subheading" and so forth.
124
125
h3. Paragraphs
126
127
<pre><code>p. left aligned
128
129 5 Hiroo Hayashi
p(. left ident 1em
130 1 Hans Ginzel
131 5 Hiroo Hayashi
p((. left ident 2em
132
as well as for following lines
133 1 Hans Ginzel
134 5 Hiroo Hayashi
p>. right aligned
135 1 Hans Ginzel
136 5 Hiroo Hayashi
p)))>. right ident 3em
137 1 Hans Ginzel
138 5 Hiroo Hayashi
p=. This is centered paragraph.
139 1 Hans Ginzel
</code></pre>
140
141 5 Hiroo Hayashi
displays;
142
143
p. left aligned
144
145
p(. left ident 1em
146
147
p((. left ident 2em
148
as well as for following lines
149
150
p>. right aligned
151
152
p)))>. right ident 3em
153
154
p=. This is centered paragraph.
155
156 1 Hans Ginzel
h3. Horizontal rule 
157 3 Hiroo Hayashi
158 1 Hans Ginzel
@----@
159 3 Hiroo Hayashi
160 1 Hans Ginzel
displays:
161
162
----
163
164 5 Hiroo Hayashi
h3. Preformatted Text
165 1 Hans Ginzel
166 5 Hiroo Hayashi
<pre> <pre>*Your text won't become bold*</pre> </pre>
167 1 Hans Ginzel
168 3 Hiroo Hayashi
displays:
169
170 1 Hans Ginzel
<pre> *Your text won't become bold* </pre>
171
172
h3. Blockquotes
173
174
Start the paragraph with *bq.*:
175
176
<pre><code>bq. Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.
177
To go live, all you need to add is a database and a web server.
178
</code></pre>
179
180 3 Hiroo Hayashi
displays:
181 1 Hans Ginzel
182
bq. Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.
183
To go live, all you need to add is a database and a web server.
184
185
You can also use > at the beginning of each line and stack them for nested quotes:
186
187
<pre>
188
>> Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.
189
>> To go live, all you need to add is a database and a web server.
190
> Great!
191
</pre>
192
193 3 Hiroo Hayashi
displays:
194 1 Hans Ginzel
195
>>  Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.
196
>>  To go live, all you need to add is a database and a web server.
197
> Great!
198
199
h3. Unordered lists
200
201
<pre>
202
* Item 1
203
* Item 2
204
** Item 21
205
** Item 22
206
* Item 3
207
</pre>
208
209
displays:
210
211
* Item 1
212
* Item 2
213
** Item 21
214
** Item 22
215
* Item 3
216
217
h3. Ordered lists
218
219
<pre>
220
# Item 1
221
# Item 2
222
# Item 3
223
## Item 3.1
224
## Item 3.2
225
</pre>
226
227
displays:
228
229
# Item 1
230
# Item 2
231
# Item 3
232
## Item 3.1
233
## Item 3.2
234
235
h3. Tables
236
237
<pre>
238
|_.UserID      |_.Name          |_.Group     |_. attribute list   |
239
|Starting with | a              |   simple   |row                 |
240
|\3=.IT                                      |<. align left       |
241
|1             |Artur Pirozhkov |/2.Users    |>. align right      |
242
|2             |Vasya Rogov     |=. center   |
243
|3             |John Smith      |Admin
244
                                 (root)      |^. valign top       |
245
|4             |-               |Nobody
246
                                 (anonymous) |~. valign bottom    |
247
</pre>
248
249
displays (all multiple spaces are replaced by 1 space):
250
251
|_.UserID      |_.Name          |_.Group     |_. attribute list   |
252
|Starting with | a              |   simple   |row                 |
253
|\3=.IT                                      |<. align left       |
254
|1             |Artur Pirozhkov |/2.Users    |>. align right      |
255
|2             |Vasya Rogov     |=. center   |
256
|3             |John Smith      |Admin
257
                                 (root)      |^. valign top       |
258
|4             |-               |Nobody
259
                                 (anonymous) |~. valign bottom    |
260
261
If you want to include pipe characters inside your table (e.g. for Wiki links), you need to prevent textile from interpreting them:
262
263
|_.Input |_. Output|
264
|*<notextile><notextile>|</notextile></notextile>*|<notextile>|</notextile>|
265
266 8 David Lukas Müller
If you want to specify the width of the table, you need to put *table{width:100%}.* just before your table definition:
267
268
<pre>
269
table{width:100%}.
270
| This table will use
271
all horizontal space |
272
</pre>
273
274
This way the table will extend to the whole page width ...
275
276
table{width:100%}.
277
| This table will use
278
all horizontal space |
279
280
... compared with the standard width:
281
282
| This table will use
283
only the required space |
284
285 16 Csaba Nyéki
h4. Special table control sequences
286
287
The order of the table control sequences is fixed. If two order are equal then the precedence of the sequences is equal.
288
If the table control sequences are used in the wrong order, they will not be interpreted.
289
290
|_.Sequence|_.Ord|_.Function|
291
|_|1|Highlight the contents of the cell|
292
|\n|2|Merge _n_ cells horizontally|
293
|/n|2|Merge _n_ cells vertically|
294
|<|3|Allign text to left|
295
|=|3|Allign text to center|
296
|>|3|Allign text to right|
297
|^|3|Allign text to top|
298 1 Hans Ginzel
|~|3|Allign text to bottom|
299 17 Csaba Nyéki
|.|4|Control sequence terminator|
300 16 Csaba Nyéki
301 1 Hans Ginzel
h3. Table of content
302
303
<pre><code>{{toc}} => left aligned toc
304
{{>toc}} => right aligned toc
305
</code></pre>
306
307
Please keep in mind, that the toc-tag needs an empty line above and underneath it and no other text before and after it.
308
309
Example:
310
311
<pre><code>
312
h1. headLineOne
313
314
h2. something
315
316
{{toc}}
317
318
h2. something more
319
</code></pre>
320 13 Andrea Ludin
321
h3. Footnotes
322
323
Marker:
324
325
<pre>
326
This is a first word[1] with a footnote.
327
328
This is a second word[2] with a footnote.
329
</pre>
330
331
*Note:* Marker directly attached to word (no space, no dot or any thing else in between). 
332
333
334
Definition:
335
336 1 Hans Ginzel
<pre>
337 14 Andrea Ludin
fn1. Footnote for the first word
338 13 Andrea Ludin
339 14 Andrea Ludin
fn2. Footnote for the second word
340 13 Andrea Ludin
</pre>
341
342
*Note:* Each definition on its own line anywhere within the document. Empty lines between definitions.
343
344
displays:
345
346
This is a first word[1] with a footnote.
347 1 Hans Ginzel
348
This is a second word[2] with a footnote.
349 13 Andrea Ludin
350 14 Andrea Ludin
fn1. Footnote for the first word
351 13 Andrea Ludin
352 14 Andrea Ludin
fn2. Footnote for the second word
353 1 Hans Ginzel
354
h2. Macros
355
356
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:
357
358
{{macro_list}}
359
360
h2. Code highlighting
361
362 11 Go MAEDA
Default code highlightment relies on "Rouge":http://rouge.jneen.net/, a syntax highlighting library written in pure Ruby. It supports many commonly used languages such as *c*, *cpp* (c++), *csharp* (c#, cs), *css*, *diff* (patch, udiff), *go* (golang), *groovy*, *html*, *java*, *javascript* (js), *kotlin*, *objective_c* (objc), *perl* (pl), *php*, *python* (py), *r*, *ruby* (rb), *sass*, *scala*, *shell* (bash, zsh, ksh, sh), *sql*, *swift*, *xml* and *yaml* (yml) languages, where the names inside parentheses are aliases. Please refer to [[RedmineCodeHighlightingLanguages]] for the full list of supported languages.
363 1 Hans Ginzel
364
You can highlight code in your wiki page using this syntax:
365
366
<pre><code><pre><code class="ruby">
367
  Place your code here.
368
</code></pre>
369
</code></pre>
370
371
Example:
372
373
<pre><code class="ruby">
374
# The Greeter class
375
class Greeter
376
  def initialize(name)
377
    @name = name.capitalize
378
  end
379
 
380
  def salute
381
    puts "Hello #{@name}!"
382
  end
383
end
384
</code></pre>
385
386 9 Go MAEDA
h2. Styling text using CSS
387
388
Textile can style text using CSS. Examples as follows:
389
390
<pre>
391
Three primary colors of light are %{color: #f00}red%, %{color: #0f0}green% and %{color: #00f}blue%.
392
393
p{border: solid 1px #000; padding: 0.5em;}. The quick brown fox jumps over the lazy dog.
394
395
table{width: 100%}.
396
|={width: 30%; background-color: #aaf;}. column 1 |={width: 70%}. column 2 |
397
</pre>
398
399
displays:
400
401
Three primary colors of light are %{color: #f00}red%, %{color: #0f0}green% and %{color: #00f}blue%.
402
403
p{border: solid 1px #000; padding: 0.5em;}. The quick brown fox jumps over the lazy dog.
404
405
table{width: 100%}.
406
|={width: 30%; background-color: #aaf;}. column 1 |={width: 70%}. column 2 |
407
408
h3. Allowed CSS properties
409
410
Redmine allows the following properties. Other properties are not allowed for security reasons (see r2192).
411
412
* background
413
* background-*
414
* border
415
* border-*
416
* color
417
* float
418
* font
419
* font-*
420
* height
421
* margin
422
* margin-*
423
* max-height
424
* max-width
425
* min-height
426
* min-width
427
* padding
428
* padding-*
429
* text
430
* text-*
431
* width
432
433 1 Hans Ginzel
h2. Translation
434
435
Note that the following translations may not be up to date. Please refer to the original english documentation if needed.
436
437
* [[BrRedmineWikiFormatting|Português Brasileiro]]
438
* [[RusRedmineTextFormatting|Русский]]
439
* [[FrRedmineWikiFormatting|French]]
440 15 Joony Kim
* [[KoreanWikiFormatting|한글(Korean)]]
441 1 Hans Ginzel
* [[TurkishWikiFormatting|Türkçe]]
442
* [[TraditionalChineseWikiFormatting|繁體中文]]
443
* [[SimplifiedChineseWikiFormatting|简体中文]]