RedmineTextFormatting » History » Version 91

Filou Centrinov, 2013-04-15 16:42
pretty print. now it's better to understand for newbies

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