source: wikiformatting.md@ ef1c1c7

main
Last change on this file since ef1c1c7 was ef1c1c7, checked in by Stefan <trsunovstefan@…>, 6 days ago

Wiki docs, phase 6 and phase 7 added

  • Property mode set to 100644
File size: 17.5 KB
RevLine 
[ef1c1c7]1WikiFormatting
2
3Table of Contents
4Index
5Installation
6Customization
7Plugins
8Upgrading
9Configuration
10Administration
11Backup
12Logging
13Permissions
14The Wiki
15Wiki Formatting
16Timeline
17Repository Browser
18Revision Log
19Changesets
20Tickets
21Workflow
22Roadmap
23Ticket Queries
24Batch Modify
25Reports
26RSS Support
27Notification
28
29Wiki markup is a core feature in Trac, tightly integrating all the other parts of Trac into a flexible and unified whole.
30
31Trac has a powerful wiki rendering engine that implements a subset of the commands from other popular Wikis, such as ​MoinMoin and ​WikiCreole.
32
33The sections below provide an overview for the most common syntax, each link in the Category column leads you to the more detailed explanation later in this page.
34
35The following wiki pages present the advanced features of the Trac wiki markup in more depth:
36
37TracLinks covers all the possible ways to refer to any Trac resource or parts thereof.
38WikiPageNames covers the various names a wiki page can take, whether in CamelCase or not.
39WikiMacros lists the macros available for generating dynamic content.
40WikiProcessors and WikiHtml details how parts of the wiki text can be processed in special ways.
41​AdvancedWikiOperations provides some operations in uncommon or administrative scenarios.
42Common wiki markup
43Category Wiki Markup Display
44Font Styles
45
46'''bold''', ''italic'', '''''Wikipedia style''''' bold, italic, Wikipedia style
47**bold**, //italic//, **//!WikiCreole style//** bold, italic, WikiCreole style
48`monospaced (''other markup ignored'')` monospaced (''other markup ignored'')
49Headings
50== Level 2
51=== Level 3 ^([#hn note])^
52Level 2
53Level 3 (note)
54Paragraphs
55First paragraph
56on multiple lines.
57
58Second paragraph.
59First paragraph on multiple lines.
60
61Second paragraph.
62
63Lists
64* bullet list
65 on multiple lines
66 1. nested list
67 a. different numbering
68 styles
69bullet list on multiple lines
70nested list
71different numbering styles
72Definition Lists
73
74 term:: definition on
75 multiple lines
76term
77definition on multiple lines
78Preformatted Text
79{{{
80multiple lines, ''no wiki'',
81 white space respected
82}}}
83multiple lines, ''no wiki'',
84 white space respected
85Blockquotes
86 if there's some leading
87 space the text is quoted
88if there's some leading space the text is quoted
89
90Discussion Citations
91>> ... (I said)
92> (he replied)
93… (I said)
94
95(he replied)
96
97Tables
98||= Table Header =|| Cell ||
99|||| (details below) ||
100Table Header Cell
101(details below)
102Links
103
104https://trac.edgewall.org ​https://trac.edgewall.org
105WikiFormatting (CamelCase) WikiFormatting (CamelCase)
106TracLinks
107
108wiki:WikiFormatting, wiki:"WikiFormatting" wiki:WikiFormatting, wiki:"WikiFormatting"
109#1 (ticket), [1] (changeset), {1} (report) #1 (ticket), [1] (changeset), {1} (report)
110ticket:1, ticket:1#comment:1, comment:1:ticket:1 ticket:1, ticket:1#comment:1, comment:1:ticket:1
111Ticket [ticket:1], [ticket:1 ticket one] Ticket 1, ticket one
112Ticket [[ticket:1]], [[ticket:1|ticket one]] Ticket 1, ticket one
113Setting Anchors
114
115[=#point1 (1)] First... (1) First…
116see [#point1 (1)] see (1)
117Escaping Markup
118
119!'' doubled quotes '' doubled quotes
120!wiki:WikiFormatting, !WikiFormatting wiki:WikiFormatting, WikiFormatting
121`{{{-}}}` triple curly brackets {{{-}}} triple curly brackets
122Images [[Image(link)]] trac_logo_mini.png
123Macros
124
125[[MacroList(*)]] (short list of all available macros)
126[[Image?]] (help for the Image macro)
127Processors
128{{{#!div style="font-size: 80%"
129Code highlighting:
130 {{{#!python
131 hello = lambda: "world"
132 }}}
133}}}
134Code highlighting:
135
136hello = lambda: "world"
137Comments
138{{{#!comment
139Note to Editors: ...
140}}}
141(comment is shown in edit mode only)
142Miscellaneous
143Line [[br]] break
144Line \\ break
145----
146Line
147break Line
148break
149
150Font Styles
151The Trac wiki supports the following font styles:
152
153Wiki Markup Display
154 * '''bold''',
155 ''' triple quotes !'''
156 can be bold too if prefixed by ! ''',
157 * ''italic''
158 * '''''bold italic''''' or ''italic and
159 ''' italic bold ''' ''
160 * __underline__
161 * {{{monospace}}} or `monospace`
162 (hence `{{{` or {{{`}}} quoting)
163 * ~~strike-through~~
164 * ^superscript^
165 * ,,subscript,,
166 * **also bold**, //italic as well//,
167 and **'' bold italic **'' //(since 0.12)//
168 * [[span(style=color: #FF0000, a red text )]]
169bold, triple quotes ''' can be bold too if prefixed by ! ,
170italic
171bold italic or italic and italic bold
172underline
173monospace or monospace (hence {{{ or ` quoting)
174strike-through
175superscript
176subscript
177also bold, italic as well, and bold italic (since 0.12)
178a red text
179Notes:
180
181{{{...}}} 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.
182 ! 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.
183all the font styles marks have to be used in opening/closing pairs, and they must nest properly; in particular, an '' italic can't be paired with a // one, and ''' can't be paired with **.
184Headings
185You can create a heading by starting a line with one up to six equal characters (=) followed by a single space and the headline text.
186
187 The headline text can be followed by the same number of = characters, but this is not mandatory. That is, === Section3 === is identical to === Section3.
188
189Finally, the heading might optionally be followed by an explicit id. If not, an implicit but nevertheless readable id will be generated.
190
191Wiki Markup Display
192= Heading =
193== Subheading
194=== About ''this'' ===
195=== Explicit id === #using-explicit-id-in-heading
196== Subheading #sub2
197Heading
198Subheading
199About this
200Explicit id
201Subheading
202Paragraphs
203A new text paragraph is created whenever two blocks of text are separated by one or more empty lines.
204
205A forced line break can also be inserted, using:
206
207Wiki Markup Display
208Line 1[[BR]]Line 2
209Paragraph
210one
211
212Paragraph
213two
214Line 1
215Line 2
216
217Paragraph one
218
219Paragraph two
220
221Lists
222The wiki supports both ordered/numbered and unordered lists.
223
224Wiki Markup Display
225 * Item 1
226 * Item 1.1
227 * Item 1.1.1
228 * Item 1.1.2
229 * Item 1.1.3
230 * Item 1.2
231 * Item 2
232- items can start at the beginning of a line
233 and they can span multiple lines
234 - be careful though to continue the line
235 with the appropriate indentation, otherwise
236that will start a new paragraph...
237
238 1. Item 1
239 a. Item 1.a
240 a. Item 1.b
241 i. Item 1.b.i
242 i. Item 1.b.ii
243 1. Item 2
244And numbered lists can also be restarted
245with an explicit number:
246 3. Item 3
247Item 1
248Item 1.1
249Item 1.1.1
250Item 1.1.2
251Item 1.1.3
252Item 1.2
253Item 2
254items can start at the beginning of a line and they can span multiple lines
255be careful though to continue the line with the appropriate indentation, otherwise
256that will start a new paragraph…
257
258Item 1
259Item 1.a
260Item 1.b
261Item 1.b.i
262Item 1.b.ii
263Item 2
264And numbered lists can also be restarted with an explicit number:
265
266Item 3
267Definition Lists
268The wiki also supports definition lists.
269
270Wiki Markup Display
271 llama::
272 some kind of mammal, with hair
273 ppython::
274 some kind of reptile, without hair
275 (can you spot the typo?)
276llama
277some kind of mammal, with hair
278ppython
279some kind of reptile, without hair (can you spot the typo?)
280Note that you need a space in front of the defined term.
281
282Preformatted Text
283Block 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.
284
285Wiki Markup Display
286{{{
287def HelloWorld():
288 print '''Hello World'''
289}}}
290def HelloWorld():
291 print '''Hello World'''
292Note that this kind of block is also used for selecting lines that should be processed through WikiProcessors.
293
294Blockquotes
295In order to mark a paragraph as blockquote, indent that paragraph with two spaces.
296
297Wiki Markup Display
298Paragraph
299 This text is a quote from someone else.
300Paragraph
301
302This text is a quote from someone else.
303
304Discussion Citations
305To delineate a citation in an ongoing discussion thread, such as the ticket comment area, email-like citation marks (>, >>, etc.) may be used.
306
307Wiki Markup Display
308>> Someone's original text
309> Someone else's reply text
310> - which can be any kind of Wiki markup
311My reply text
312Someone's original text
313
314Someone else's reply text
315
316which can be any kind of Wiki markup
317My reply text
318
319Tables
320Simple Tables
321Simple tables can be created:
322
323Wiki Markup Display
324||Cell 1||Cell 2||Cell 3||
325||Cell 4||Cell 5||Cell 6||
326Cell 1 Cell 2 Cell 3
327Cell 4 Cell 5 Cell 6
328Cell headings can be specified by wrapping the content in a pair of = characters. Note that the = characters have to stick to the cell separators:
329
330Wiki Markup Display
331|| ||= stable =||= latest =||
332||= 0.10 =|| 0.10.5 || 0.10.6dev||
333||= 0.11 =|| 0.11.6 || 0.11.7dev||
334stable latest
3350.10 0.10.5 0.10.6dev
3360.11 0.11.6 0.11.7dev
337Finally, specifying an empty cell means that the next non empty cell will span the empty cells:
338
339Wiki Markup Display
340|| 1 || 2 || 3 ||
341|||| 1-2 || 3 ||
342|| 1 |||| 2-3 ||
343|||||| 1-2-3 ||
3441 2 3
3451-2 3
3461 2-3
3471-2-3
348Note that if the content of a cell sticks to one side of the cell and only one, then the text will be aligned on that side:
349
350Wiki Markup Display
351||=Text =||= Numbers =||
352||left align || 1.0||
353|| center || 4.5||
354|| right align|| 4.5||
355|| default alignment || 2.5||
356||default|| 2.5||
357|| default || 2.5||
358|| default || 2.5||
359Text Numbers
360left align 1.0
361center 4.5
362right align 4.5
363default alignment 2.5
364default 2.5
365default 2.5
366default 2.5
367If contrary to the example above, the cells in your table contain more text, it might be convenient to spread a table row over multiple lines of markup. The \ character placed at the end of a line after a cell separator tells Trac to not start a new row for the cells on the next line:
368
369Wiki Markup
370|| this is column 1 [https://trac.edgewall.org/newticket new ticket] || \
371|| this is column 2 [https://trac.edgewall.org/roadmap the road ahead] || \
372|| that's column 3 and last one ||
373Display
374this is column 1 ​new ticket this is column 2 ​the road ahead that's column 3 and last one
375Complex Tables
376If the possibilities offered by the simple pipe-based markup (||) for tables described above are not enough for your needs, you can create more elaborate tables by using WikiProcessor based tables.
377
378Links
379Hyperlinks are automatically created for WikiPageNames and URLs. WikiPageLinks can be disabled by prepending an exclamation mark (!), such as !WikiPageLink.
380
381Wiki Markup Display
382TitleIndex, https://www.edgewall.com/, !NotAlink
383TitleIndex, ​https://www.edgewall.com/, NotAlink
384
385Links 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.
386
387Wiki Markup Display
388 * [https://www.edgewall.com Edgewall Software]
389 * [wiki:TitleIndex Title Index]
390 * [wiki:TitleIndex]
391 * [wiki:ISO9000]
392​Edgewall Software
393Title Index
394TitleIndex
395ISO9000
396Following the ​WikiCreole trend, the descriptive title can also be specified by writing the link followed by a pipe (|) and a title and all this inside double square brackets.
397
398 * [[https://www.edgewall.com|Edgewall Software]]
399 * [[wiki:TitleIndex|Title Index]]
400 or even [[TitleIndex|Title Index]]
401 * [[wiki:TitleIndex]]
402 ''' but not ![[TitleIndex]]! '''
403 * [[ISO9000]]
404​Edgewall Software
405Title Index or even Title Index
406TitleIndex but not [[TitleIndex]]!
407ISO9000
408Note: the ​WikiCreole style for links is quick to type and certainly looks familiar as it is the one used on Wikipedia and in many other wikis. Unfortunately it conflicts with the syntax for macros. So in the rare case when you need to refer to a page which is named after a macro (typical examples being TitleIndex, InterTrac and InterWiki), by writing [[TitleIndex]] you will actually call the macro instead of linking to the page.
409
410Trac Links
411Wiki 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:
412
413Wiki Markup Display
414 * Tickets: #1 or ticket:1
415 * Reports: {1} or report:1
416 * Changesets: r1, [1] or changeset:1
417 * ...
418 * targeting other Trac instances,
419 so called InterTrac links:
420 - Tickets: #Trac1 or Trac:ticket:1
421 - Changesets: [Trac1] or Trac:changeset:1
422Tickets: #1 or ticket:1
423Reports: {1} or report:1
424Changesets: r1, [1] or changeset:1
425…
426targeting other Trac instances, so called InterTrac links:
427Tickets: ​#Trac1 or ​Trac:ticket:1
428Changesets: ​[Trac1] or ​Trac:changeset:1
429There are many more flavors of Trac links, see TracLinks for more in-depth information and a reference for all the default link resolvers.
430
431Setting Anchors
432An anchor, or more correctly speaking, an ​anchor name can be added explicitly at any place in the Wiki page, to uniquely identify a position in the document:
433
434[=#point1]
435This syntax was chosen to match the format for explicitly naming the header id documented above:
436
437== Long title == #title
438It is also very close to the syntax for the corresponding link to that anchor:
439
440[#point1]
441Optionally, a label can be given to the anchor:
442
443[=#point1 '''Point 1''']
444Wiki Markup Display
445[#point2 jump to the second point]
446
447...
448
449Point2: [=#point2] Jump here
450jump to the second point
451
452…
453
454Point2: Jump here
455
456For more complex anchors (eg when a custom title is wanted), you can use the Span macro: [[span(id=point2, class=wikianchor, title=Point 2, ^(2)^)]].
457
458Escaping Links, WikiPageNames and other Markup
459You may avoid making hyperlinks out of TracLinks by preceding an expression with a single exclamation mark (!).
460
461Wiki Markup Display
462 !NoHyperLink
463 !#42 is not a link
464Various forms of escaping for list markup:
465 ^^- escaped minus sign \\
466 ^^1. escaped number \\
467 ^^* escaped asterisk sign
468NoHyperLink #42 is not a link
469
470Various forms of escaping for list markup:
471
472- escaped minus sign
4731. escaped number
474* escaped asterisk sign
475
476Images
477Urls ending with .png, .gif or .jpg are no longer automatically interpreted as image links, and converted to <img> tags.
478
479You 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)]].
480
481In addition to the current page, it is possible to refer to other resources:
482
483[[Image(wiki:WikiFormatting:picture.gif)]] (referring to attachment on another page)
484[[Image(ticket:1:picture.gif)]] (file attached to a ticket)
485[[Image(htdocs:picture.gif)]] (referring to a file inside the environment htdocs directory)
486[[Image(source:/trunk/trac/htdocs/trac_logo_mini.png)]] (a file in repository)
487Wiki Markup Display
488[[Image(htdocs:../common/trac_logo_mini.png)]]
489trac_logo_mini.png
490
491See WikiMacros for further documentation on the [[Image()]] macro, which has several useful options (title=, link=, etc.)
492
493Macros
494Macros are custom functions that insert dynamic content in a page.
495
496Wiki Markup Display
497[[RecentChanges(Trac,3)]]
498
49911/04/25
500TracWorkflow
501TracWiki
502TracUpgrade
503
504See WikiMacros for more information, and a list of installed macros.
505
506The detailed help for a specific macro can also be obtained more directly by appending a ? to the macro name.
507
508Wiki Markup Display
509[[MacroList?]]
510
511[[MacroList]]
512Display a list of all installed Wiki macros, including documentation if available.
513
514Optionally, the name of a specific macro can be provided as an argument. In that case, only the documentation for that macro will be rendered.
515
516Note that this macro will not be able to display the documentation of macros if the PythonOptimize option is enabled for mod_python!
517
518
519Processors
520Trac supports alternative markup formats using WikiProcessors. For example, processors are used to write pages in reStructuredText or HTML.
521
522Wiki Markup Display
523Example 1: HTML
524
525{{{#!html
526<h1 style="text-align: right; color: blue">
527 HTML Test
528</h1>
529}}}
530HTML Test
531Example 2: Code Highlighting
532
533{{{#!python
534class Test:
535
536 def __init__(self):
537 print "Hello World"
538if __name__ == '__main__':
539 Test()
540}}}
541class Test:
542 def __init__(self):
543 print "Hello World"
544if __name__ == '__main__':
545 Test()
546Example 3: Complex Tables
547
548{{{#!th rowspan=4 align=justify
549With the `#td` and `#th` processors,
550table cells can contain any content:
551}}}
552|----------------
553{{{#!td
554 - lists
555 - embedded tables
556 - simple multiline content
557}}}
558|----------------
559{{{#!td
560As processors can be easily nested,
561so can be tables:
562 {{{#!th
563 Example:
564 }}}
565 {{{#!td style="background: #eef"
566 || must be at the third level now... ||
567 }}}
568}}}
569|----------------
570{{{#!td
571Even when you don't have complex markup,
572this form of table cells can be convenient
573to write content on multiple lines.
574}}}
575With the #td and #th processors, table cells can contain any content:
576
577lists
578embedded tables
579simple multiline content
580As processors can be easily nested, so can be tables:
581
582Example:
583
584must be at the third level now…
585Even when you don't have complex markup, this form of table cells can be convenient to write content on multiple lines.
586
587See WikiProcessors for more information.
588
589Comments
590Comments can be added to the plain text. These will not be rendered and will not display in any other format than plain text.
591
592Wiki Markup Display
593Nothing to
594{{{#!comment
595Your comment for editors here
596}}}
597see.
598Nothing to
599
600see.
601
602Miscellaneous
603Wiki Markup Display
604Horizontal line:
605
606Four or more dashes will be replaced
607by a horizontal line (<HR>)
608----
609See?
610Four or more dashes will be replaced by a horizontal line (<HR>)
611
612See?
613
614Two examples of line breaks:
615
616"macro" style [[BR]] line break
617or:
618
619!WikiCreole style \\ line\\break
620"macro" style
621line break
622
623WikiCreole style
624line
625break
Note: See TracBrowser for help on using the repository browser.