RedmineTextFormatting » History » Version 83

Jean-Philippe Lang, 2012-10-17 22:41

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