final move of files
[web.mtrack] / help / WikiFormatting
1 = !WikiFormatting =
2
3 Wiki markup is a core feature, tightly integrating all the other parts of mtrack into a flexible and powerful whole.
4
5 mtrack has a built in small and powerful wiki rendering engine. This wiki engine implements an ever growing subset of the commands from other popular Wikis,
6 especially [http://moinmoin.wikiwikiweb.de/ MoinMoin]. 
7
8
9 This page demonstrates the formatting syntax available anywhere !WikiFormatting is allowed.
10
11
12 == Font Styles ==
13
14 The Trac wiki supports the following font styles:
15 {{{
16  * '''bold''', '''!''' can be bold too''', and '''! '''
17  * ''italic''
18  * '''''bold italic'''''
19  * __underline__
20  * {{{monospace}}} or `monospace`
21  * ~~strike-through~~
22  * ^superscript^ 
23  * ,,subscript,,
24 }}}
25
26 Display:
27  * '''bold''', '''!''' can be bold too''', and '''! '''
28  * ''italic''
29  * '''''bold italic'''''
30  * __underline__
31  * {{{monospace}}} or `monospace`
32  * ~~strike-through~~
33  * ^superscript^ 
34  * ,,subscript,,
35
36 Notes:
37  * `{{{...}}}` and {{{`...`}}} commands not only select a monospace font, but also treat their content as verbatim text, meaning that no further wiki processing is done on this text.
38  * {{{ ! }}} tells wiki parser to not take the following characters as wiki format, so pay attention to put a space after !, e.g. when ending bold.
39
40 == Headings ==
41
42 You can create heading by starting a line with one up to five ''equal'' characters ("=")
43 followed by a single space and the headline text. The line should end with a space 
44 followed by the same number of ''='' characters.
45 The heading might optionally be followed by an explicit id. If not, an implicit but nevertheless readable id will be generated.
46
47 Example:
48 {{{
49 = Heading =
50 == Subheading ==
51 === About ''this'' ===
52 === Explicit id === #using-explicit-id-in-heading
53 }}}
54
55 Display:
56 = Heading =
57 == Subheading ==
58 === About ''this'' ===
59 === Explicit id === #using-explicit-id-in-heading
60
61 == Paragraphs ==
62
63 A new text paragraph is created whenever two blocks of text are separated by one or more empty lines.
64
65 A forced line break can also be inserted, using:
66 {{{
67 Line 1[[BR]]Line 2
68 }}}
69 Display:
70
71 Line 1[[BR]]Line 2
72
73
74 == Lists ==
75
76 The wiki supports both ordered/numbered and unordered lists.
77
78 Example:
79 {{{
80  * Item 1
81    * Item 1.1
82       * Item 1.1.1   
83       * Item 1.1.2
84       * Item 1.1.3
85    * Item 1.2
86  * Item 2
87
88  1. Item 1
89    a. Item 1.a
90    a. Item 1.b
91       i. Item 1.b.i
92       i. Item 1.b.ii
93  1. Item 2
94 And numbered lists can also be given an explicit number:
95  3. Item 3
96 }}}
97
98 Display:
99  * Item 1
100    * Item 1.1
101       * Item 1.1.1
102       * Item 1.1.2
103       * Item 1.1.3
104    * Item 1.2
105  * Item 2
106
107  1. Item 1
108    a. Item 1.a
109    a. Item 1.b
110       i. Item 1.b.i
111       i. Item 1.b.ii
112  1. Item 2
113 And numbered lists can also be given an explicit number:
114  3. Item 3
115
116 Note that there must be one or more spaces preceding the list item markers, otherwise the list will be treated as a normal paragraph.
117
118
119 == Definition Lists ==
120
121
122 The wiki also supports definition lists.
123
124 Example:
125 {{{
126  llama::
127    some kind of mammal, with hair
128  ppython::
129    some kind of reptile, without hair
130    (can you spot the typo?)
131 }}}
132
133 Display:
134  llama::
135    some kind of mammal, with hair
136  ppython::
137    some kind of reptile, without hair
138    (can you spot the typo?)
139
140 Note that you need a space in front of the defined term.
141
142
143 == Preformatted Text ==
144
145 Block containing preformatted text are suitable for source code snippets, notes and examples. Use three ''curly braces'' wrapped around the text to define a block quote. The curly braces need to be on a separate line.
146   
147 Example:
148 {{{
149  {{{
150   def HelloWorld():
151       print "Hello World"
152  }}}
153 }}}
154
155 Display:
156 {{{
157  def HelloWorld():
158      print "Hello World"
159 }}}
160
161
162 == Blockquotes ==
163
164 In order to mark a paragraph as blockquote, indent that paragraph with two spaces.
165
166 Example:
167 {{{
168   This text is a quote from someone else.
169 }}}
170
171 Display:
172   This text is a quote from someone else.
173
174 == Discussion Citations ==
175
176 To delineate a citation in an ongoing discussion thread, such as the ticket comment area, e-mail-like citation marks (">", ">>", etc.) may be used.  
177
178 Example:
179 {{{
180 >> Someone's original text
181 > Someone else's reply text
182 My reply text
183 }}}
184
185 Display:
186 >> Someone's original text
187 > Someone else's reply text
188 My reply text
189
190 ''Note: Some !WikiFormatting elements, such as lists and preformatted text, are  lost in the citation area.  Some reformatting may be necessary to create a clear citation.''
191
192 == Tables ==
193
194 Simple tables can be created like this:
195 {{{
196 ||Cell 1||Cell 2||Cell 3||
197 ||Cell 4||Cell 5||Cell 6||
198 }}}
199
200 Display:
201 ||Cell 1||Cell 2||Cell 3||
202 ||Cell 4||Cell 5||Cell 6||
203
204 == Links ==
205
206 Hyperlinks are automatically created for WikiPageNames and URLs. !WikiPageLinks can be disabled by prepending an exclamation mark "!" character, such as {{{!WikiPageLink}}}.
207
208 Example:
209 {{{
210  TitleIndex, http://www.edgewall.com/, !NotAlink
211 }}}
212
213 Display:
214  TitleIndex, http://www.edgewall.com/, !NotAlink
215
216 Links can be given a more descriptive title by writing the link followed by a space and a title and all this inside square brackets.  If the descriptive title is omitted, then the explicit prefix is discarded, unless the link is an external link. This can be useful for wiki pages not adhering to the WikiPageNames convention.
217
218 Example:
219 {{{
220  * [http://www.edgewall.com/ Edgewall Software]
221  * [wiki:TitleIndex Title Index]
222  * [wiki:ISO9000]
223 }}}
224
225 Display:
226  * [http://www.edgewall.com/ Edgewall Software]
227  * [wiki:TitleIndex Title Index]
228  * [wiki:ISO9000]
229
230 == Trac Links ==
231
232 Wiki pages can link directly to other parts of the Trac system. Pages can refer to tickets, reports, changesets, milestones, source files and other Wiki pages using the following notations:
233 {{{
234  * Tickets: #1 or ticket:1
235  * Reports: {1} or report:1
236  * Changesets: r1, [1] or changeset:1
237  * ...
238 }}}
239
240 Display:
241  * Tickets: #1 or ticket:1
242  * Reports: {1} or report:1
243  * Changesets: r1, [1] or changeset:1
244  * ... 
245
246 There are many more flavors of Trac links, see TracLinks for more in-depth information.
247
248
249 == Escaping Links and WikiPageNames ==
250
251 You may avoid making hyperlinks out of TracLinks by preceding an expression with a single "!" (exclamation mark).
252
253 Example:
254 {{{
255  !NoHyperLink
256  !#42 is not a link
257 }}}
258
259 Display:
260  !NoHyperLink
261  !#42 is not a link
262
263
264 {{{
265 #!comment
266 == Images ==
267
268 Urls ending with `.png`, `.gif` or `.jpg` are no longer automatically interpreted as image links, and converted to `<img>` tags.
269
270 You now have to use the ![[Image]] macro. The simplest way to include an image is to upload it as attachment to the current page, and put the filename in a macro call like `[[Image(picture.gif)]]`.
271
272 In addition to the current page, it is possible to refer to other resources:
273  * `[[Image(wiki:WikiFormatting:picture.gif)]]` (referring to attachment on another page)
274  * `[[Image(ticket:1:picture.gif)]]` (file attached to a ticket)
275  * `[[Image(htdocs:picture.gif)]]` (referring to a file inside project htdocs)
276  * `[[Image(source:/trunk/trac/htdocs/trac_logo_mini.png)]]` (a file in repository)
277
278 Example display: [[Image(htdocs:../common/trac_logo_mini.png)]]
279
280
281 See WikiMacros for further documentation on the `[[Image()]]` macro.
282
283 }}}
284
285 == Macros ==
286
287 Macros are ''custom functions'' to insert dynamic content in a page.
288
289 Example:
290 {{{
291  [[RecentChanges(Trac,3)]]
292 }}}
293
294 Display:
295  [[RecentChanges(Trac,3)]]
296
297 See WikiMacros for more information, and a list of installed macros.
298
299
300 == Processors ==
301
302 Trac supports alternative markup formats using WikiProcessors. For example, processors are used to write pages in HTML.
303
304 Example 1:
305 {{{
306 #!html
307 <pre class="wiki">{{{
308 #!html
309 &lt;h1 style="text-align: right; color: blue"&gt;HTML Test&lt;/h1&gt;
310 }}}</pre>
311 }}}
312
313 Display:
314 {{{
315 #!html
316 <h1 style="text-align: right; color: blue">HTML Test</h1>
317 }}}
318
319 Example:
320 {{{
321 #!html
322 <pre class="wiki">{{{
323 #!python
324 class Test:
325
326     def __init__(self):
327         print "Hello World"
328 if __name__ == '__main__':
329    Test()
330 }}}</pre>
331 }}}
332
333 Display:
334 {{{
335 #!python
336 class Test:
337     def __init__(self):
338         print "Hello World"
339 if __name__ == '__main__':
340    Test()
341 }}}
342
343 Perl:
344 {{{
345 #!perl
346 my ($test) = 0;
347 if ($test > 0) {
348     print "hello";
349 }
350 }}}
351
352 See WikiProcessors for more information.
353
354
355 == Comments ==
356
357 Comments can be added to the plain text. These will not be rendered and will not display in any other format than plain text.
358 {{{
359 {{{
360 #!comment
361 Your comment here
362 }}}
363 }}}
364
365 == Data output from SQL command line utilities ==
366
367 If you have text that you want to copy and paste from a command line utility,
368 such as psql, then you can enclose it in the ''dataset'' processor:
369
370 {{{
371 {{{
372 #!dataset
373             current_query             | procpid | usename | client_addr  |     elapsed
374 --------------------------------------+---------+---------+--------------+-----------------
375  SELECT * FROM build_mailing(59508)   |    6595 | user  | 10.16.40.80 | 00:04:24.377262
376  FETCH NEXT FROM "<unnamed portal 5>" |   27597 | user  | 10.16.40.80 | 00:00:44.208982
377  commit                               |   19188 | user  | 10.16.40.67 | 00:00:00.013402
378  COMMIT                               |   26390 | user  | 10.16.1.56  | 00:00:00.007778
379 }}}
380 }}}
381
382 {{{
383 #!dataset
384             current_query             | procpid | usename | client_addr  |     elapsed
385 --------------------------------------+---------+---------+--------------+-----------------
386  SELECT * FROM build_mailing(59508)   |    6595 | user  | 10.16.40.80 | 00:04:24.377262
387  FETCH NEXT FROM "<unnamed portal 5>" |   27597 | user  | 10.16.40.80 | 00:00:44.208982
388  commit                               |   19188 | user  | 10.16.40.67 | 00:00:00.013402
389  COMMIT                               |   26390 | user  | 10.16.1.56  | 00:00:00.007778
390 }}}
391
392 == Miscellaneous ==
393
394 Four or more dashes will be replaced by a horizontal line (<HR>)
395
396 Example:
397 {{{
398  ----
399 }}}
400
401 Display:
402 ----
403