Project

General

Profile

RedmineTextFormattingTextile » History » Version 1

Hans Ginzel, 2015-12-07 13:06

1 1 Hans Ginzel
h1. Textile formatting
2
3
Below is *Textile* formatting, for *Markdown* formatting see [[RedmineTextFormattingMarkdown]].
4
5
{{>TOC}}
6
7
h2. Links
8
9
h3. Redmine links
10
11
Redmine allows hyperlinking between resources (issues, changesets, wiki pages...) from anywhere text formatting is used.
12
13
* Link to an issue: *!#124* (displays #124, link is striked-through if the issue is closed)
14
* Link to an issue note: *!#124-6*, or *!#124!#note-6*
15
* Link to a changeset: *!r758* (displays r758)
16
* Link to a changeset with a non-numeric hash: *commit:c6f4d0fd* (displays c6f4d0fd).
17
18
Wiki links:
19
20
* *[[Guide]]* displays a link to the page named 'Guide': [[Guide]]
21
* *[[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
24
You can also link to pages of another project's wiki (using the project identifier):
25
26
* *[[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
Links to others resources:
32
33
* Documents:
34
35
  * *!document#17* (link to document with id 17)
36
  * *!document:Greetings* (link to the document with title "Greetings")
37
  * *!document:"Some document"* (double quotes can be used when document title contains spaces)
38
  * *!sandbox:document:"Some document"* (link to a document with title "Some document" in project identifier "sandbox")
39
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
  * *!version:"1.0 beta 2"* (double quotes can be used when version name contains spaces)
45
  * *!sandbox:version:1.0.0* (link to version "1.0.0" in the project identifier "sandbox")
46
47
* Attachments:
48
  
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
* Changesets:
54
55
  * *!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
  * *!sandbox:commit:c6f4d0fd* (link to a changeset with a non-numeric hash of another project identifier)
61
62
* Repository files:
63
64
  * *!source:some/file*           -- Link to the file located at /some/file in the project's repository
65
  * *!source:some/file@52*        -- Link to the file's revision 52
66
  * *!source:some/file#L120*      -- Link to line 120 of the file
67
  * *!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
* 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
* Forum messages:
80
81
  * *!message#1218* (link to message with id 1218)
82
83
* News items
84
85
  * *!news#1* (link to news item with id 1)
86
  * *!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
89
* Projects:
90
91
  * *!project#3* (link to project with id 3)
92
  * *!project:someproject* (link to project with name "someproject")
93
  * *!project:"Multiple words project"* (double quotes can be used when project name contains spaces)
94
95
Escaping:
96
97
* You can prevent Redmine links from being parsed by preceding them with an exclamation mark: !
98
99
h3. External links
100
101
HTTP URLs are automatically turned into clickable links: 
102
* *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
105
HTTP URLs can also use different text than the link itself:
106
* *"Redmine web site":http://www.redmine.org* -- External link with different text: "Redmine web site":http://www.redmine.org
107
* *!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
109
p=. !http://www.redmine.org/attachments/7069/Redmine_logo.png(Redmine web site)!:http://www.redmine.org
110
111
h3. Email addresses
112
113
Email addresses are automatically turned into clickable links:
114
115
* *"Email someone":mailto:someone@foo.bar* -- Email link with different text: "Email someone":mailto:someone@foo.bar
116
117
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
h2. Text formatting
123
124
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
126
h3. Acronym
127
128
<pre>
129
JPL(Jean-Philippe Lang)
130
</pre>
131
132
Display:
133
134
JPL(Jean-Philippe Lang)
135
136
h3. Font style
137
138
<pre><code>* *bold*
139
* _italic_
140
* *_bold italic_*
141
* +underline+
142
* -strike-through-
143
* Plain ^superscript^
144
* Plain ~subscript~
145
* @inline monospace@
146
* <notextile>normal *bold* _italic_ normal;E=mc ^2^</notextile>
147
* <notextile>normal<notextile></notextile>*bold*<notextile></notextile>_italic_<notextile></notextile>normal;E=mc<notextile></notextile>^2^</notextile>
148
* <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
* <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
</code></pre>
152
153
Display:
154
155
 * *bold*
156
 * _italic_
157
 * *_bold italic_*
158
 * +underline+
159
 * -strike-through-
160
 * Plain ^superscript^
161
 * Plain ~subscript~
162
 * @inline monospace@
163
 * normal *bold* _italic_ normal;E=mc ^2^
164
 * normal<notextile></notextile>*bold*<notextile></notextile>_italic_<notextile></notextile>normal;E=mc<notextile></notextile>^2^
165
 * 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
 * <pre>*some lines*      some "link":http://www.redmine.org</pre>
167
 * <pre><notextile></notextile>*some lines*      some "link":http://www.redmine.org</pre>
168
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
184
h3. Inline images
185
186
* *&#33;image_url&#33;* displays an image located at image_url (textile syntax)
187
* *&#33;>image_url&#33;* right floating image
188
* *&#33;image_url(Image title)&#33;* displays an image with an alt/title attribute
189
* *&#33;image_url&#33;:URL* displays an image located at image_url with link URL added
190
191
If you have an image attached to your wiki page, it can be displayed inline using its filename: *&#33;attached_image.png&#33;*
192
193
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
h3. Headings
196
197
<pre><code>h1. Heading
198
199
h2. Subheading
200
201
h3. Subheading
202
</code></pre>
203
204
Redmine assigns an anchor to each of those headings thus you can link to them with "#Heading", "#Subheading" and so forth.
205
206
h3. Paragraphs
207
208
<pre><code>p. left aligned
209
210
  p(. left ident 1em
211
212
    p((. left ident 2em
213
    as well as for following lines
214
215
                                                                                   p>. right aligned
216
217
                                                                        p)))>. right ident 3em
218
219
                           p=. This is centered paragraph.
220
</code></pre>
221
222
h3. Horizontal rule 
223
224
@----@
225
Display: 
226
227
----
228
229
230
h3. Predefined
231
232
To escape wiki syntax
233
<pre> <pre> *Your text won't become bold* </pre> </pre>
234
Display:
235
236
<pre> *Your text won't become bold* </pre>
237
238
h3. Blockquotes
239
240
Start the paragraph with *bq.*:
241
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
Displays:
247
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
You can also use > at the beginning of each line and stack them for nested quotes:
252
253
<pre>
254
>> Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern.
255
>> 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
265
h3. Unordered lists
266
267
<pre>
268
* Item 1
269
* Item 2
270
** Item 21
271
** Item 22
272
* Item 3
273
</pre>
274
275
displays:
276
277
* Item 1
278
* Item 2
279
** Item 21
280
** Item 22
281
* Item 3
282
283
h3. Ordered lists
284
285
<pre>
286
# Item 1
287
# Item 2
288
# Item 3
289
## Item 3.1
290
## Item 3.2
291
</pre>
292
293
displays:
294
295
# Item 1
296
# Item 2
297
# Item 3
298
## Item 3.1
299
## Item 3.2
300
301
h3. Tables
302
303
<pre>
304
|_.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
</pre>
314
315
displays (all multiple spaces are replaced by 1 space):
316
317
|_.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
327
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
h3. Table of content
333
334
<pre><code>{{toc}} => left aligned toc
335
{{>toc}} => right aligned toc
336
</code></pre>
337
338
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
h2. Macros
353
354
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
356
{{macro_list}}
357
358
h2. Code highlighting
359
360
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
<pre><code><pre><code class="ruby">
365
  Place your code here.
366
</code></pre>
367
</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
end
382
</code></pre>
383
384
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
h2. Translation
392
393
Note that the following translations may not be up to date. Please refer to the original english documentation if needed.
394
395
* [[BrRedmineWikiFormatting|Português Brasileiro]]
396
* [[RusRedmineTextFormatting|Русский]]
397
* [[FrRedmineWikiFormatting|French]]
398
* [[KoreanWikiFormatting|Korean]]
399
* [[TurkishWikiFormatting|Türkçe]]
400
* [[TraditionalChineseWikiFormatting|繁體中文]]
401
* [[SimplifiedChineseWikiFormatting|简体中文]]