Project

General

Profile

RedmineTextFormattingTextile » History » Version 3

Hiroo Hayashi, 2016-07-20 09:57
changes to be more consistent. merge some lines which were only in source:trunk/public/help/en/wiki_syntax_detailed_textile.html . refs #16373

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