Project

General

Profile

RedmineTextFormatting » History » Version 103

Friedrich Schiller, 2014-08-09 12:29
changing formatting within a single string (split string parts by using <notextile></notextile>)

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