7 | | especially [http://moinmo.in/ MoinMoin] and [trac:WikiCreole]. |
8 | | |
9 | | |
10 | | This page will give you an in-depth explanation of the wiki markup available anywhere WikiFormatting is allowed. |
11 | | |
12 | | The ''Cheat sheet'' below gives you a quick overview for the most common syntax, each link in the ''Category'' column will lead you to the more detailed explanation later in this page. |
13 | | |
14 | | A few other wiki pages present the advanced features of the Trac wiki markup in more depth: |
15 | | - TracLinks covers all the possible ways to refer precisely to any Trac resource or parts thereof, |
16 | | - WikiPageNames talks about the various names a wiki page can take, CamelCase or not |
17 | | - WikiMacros lists the macros available for generating dynamic content, |
18 | | - WikiProcessors and WikiHtml details how parts of the wiki text can be processed in special ways |
19 | | |
20 | | |
21 | | == Cheat sheet == |
22 | | |
23 | | ||= '''Category''' =||= '''Wiki Markup''' =||= '''Display''' =|| |
24 | | |----------------------------------------------------------- |
25 | | {{{ |
26 | | #!th rowspan=3 |
27 | | [#FontStyles Font Styles] |
28 | | }}} |
29 | | || `'''bold'''`, `''italic''`, `'''''Wikipedia style'''''` || \ |
30 | | || '''bold''', ''italic'', '''''Wikipedia style''''' || |
31 | | || {{{ |
32 | | `monospaced and ''nowiki''` |
33 | | }}} || \ |
34 | | || `monospaced and nowiki` || |
35 | | || `**bold**`, `//italic//`, `**//!WikiCreole style//**` || \ |
36 | | || **bold**, //italic//, **//!WikiCreole style//** || |
37 | | |----------------------------------------------------------- |
38 | | ||= [#Headings Headings] =||\ |
39 | | {{{ |
40 | | #!td |
41 | | {{{ |
42 | | == Level 2 == |
43 | | === Level 3 ^([#hn note])^ |
44 | | |
45 | | }}} |
46 | | }}} |
47 | | {{{ |
48 | | #!td style="padding-left: 2em" |
49 | | == Level 2 |
50 | | === Level 3 ^([#hn note])^ |
51 | | }}} |
52 | | |----------------------------------------------------------- |
53 | | ||= [#Paragraphs Paragraphs] =||\ |
54 | | {{{ |
55 | | #!td |
56 | | {{{ |
57 | | First paragraph |
58 | | on multiple lines. |
59 | | |
60 | | Second paragraph. |
61 | | |
62 | | }}} |
63 | | }}} |
64 | | {{{ |
65 | | #!td |
66 | | First paragraph |
67 | | on multiple lines. |
68 | | |
69 | | Second paragraph. |
70 | | }}} |
71 | | |----------------------------------------------------------- |
72 | | ||= [#Lists Lists] =||\ |
73 | | {{{ |
74 | | #!td |
75 | | {{{ |
76 | | * bullets list |
77 | | on multiple paragraphs |
78 | | 1. nested list |
79 | | a. different numbering |
80 | | styles |
81 | | |
82 | | }}} |
83 | | }}} |
84 | | {{{ |
85 | | #!td |
86 | | * bullets list |
87 | | on multiple paragraphs |
88 | | 1. nested list |
89 | | a. different numbering |
90 | | styles |
91 | | }}} |
92 | | |----------------------------------------------------------- |
93 | | {{{ |
94 | | #!th |
95 | | [#DefinitionLists Definition Lists] |
96 | | }}} |
97 | | {{{ |
98 | | #!td |
99 | | {{{ |
100 | | term:: definition on |
101 | | multiple paragraphs |
102 | | |
103 | | }}} |
104 | | }}} |
105 | | {{{ |
106 | | #!td |
107 | | term:: definition on |
108 | | multiple paragraphs |
109 | | }}} |
110 | | |----------------------------------------------------------- |
111 | | ||= [#PreformattedText Preformatted Text] =||\ |
112 | | {{{ |
113 | | #!td |
114 | | {{{ |
115 | | {{{ |
116 | | multiple lines, ''no wiki'' |
117 | | white space respected |
118 | | |
119 | | }}} |
120 | | |
121 | | }}} |
122 | | }}} |
123 | | {{{ |
124 | | #!td |
125 | | {{{ |
126 | | multiple lines, ''no wiki'' |
127 | | white space respected |
128 | | |
129 | | }}} |
130 | | }}} |
131 | | |----------------------------------------------------------- |
132 | | ||= [#Blockquotes Blockquotes] =||\ |
133 | | {{{ |
134 | | #!td |
135 | | {{{ |
136 | | if there's some leading |
137 | | space the text is quoted |
138 | | |
139 | | }}} |
140 | | }}} |
141 | | {{{ |
142 | | #!td |
143 | | if there's some leading |
144 | | space the text is quoted |
145 | | }}} |
146 | | |----------------------------------------------------------- |
147 | | ||= [#DiscussionCitations Discussion Citations] =||\ |
148 | | {{{ |
149 | | #!td |
150 | | {{{ |
151 | | >> ... (I said) |
152 | | > (he replied) |
153 | | |
154 | | }}} |
155 | | }}} |
156 | | {{{ |
157 | | #!td |
158 | | >>... (I said) |
159 | | > (he replied) |
160 | | }}} |
161 | | |----------------------------------------------------------- |
162 | | ||= [#Tables Tables] =||\ |
163 | | {{{ |
164 | | #!td |
165 | | {{{ |
166 | | ||= Table Header =|| Cell || |
167 | | |||| (details below) || |
168 | | |
169 | | }}} |
170 | | }}} |
171 | | {{{ |
172 | | #!td |
173 | | ||= Table Header =|| Cell || |
174 | | |||| (details below) || |
175 | | }}} |
176 | | |----------------------------------------------------------- |
177 | | {{{ |
178 | | #!th rowspan=2 |
179 | | [#Links Links] |
180 | | }}} |
181 | | || `http://trac.edgewall.org` ||\ |
182 | | || http://trac.edgewall.org || |
183 | | || `WikiFormatting (CamelCase)` ||\ |
184 | | || WikiFormatting (CamelCase) || |
185 | | |----------------------------------------------------------- |
186 | | {{{ |
187 | | #!th rowspan=5 |
188 | | [#TracLinks TracLinks] |
189 | | }}} |
190 | | || `wiki:WikiFormatting`, `wiki:"WikiFormatting"` ||\ |
191 | | || wiki:WikiFormatting, wiki:"WikiFormatting" || |
192 | | || `#1 (ticket)`, `[1] (changeset)`, `{1} (report)` ||\ |
193 | | || #1 (ticket), [1] (changeset), {1} (report) || |
194 | | || `ticket:1, ticket:1#comment:1` ||\ |
195 | | || ticket:1, ticket:1#comment:1 || |
196 | | || `Ticket [ticket:1]`, `[ticket:1 ticket one]` ||\ |
197 | | || Ticket [ticket:1], [ticket:1 ticket one] || |
198 | | || `Ticket [[ticket:1]]`, `[[ticket:1|ticket one]]` ||\ |
199 | | || Ticket [[ticket:1]], [[ticket:1|ticket one]] || |
200 | | |----------------------------------------------------------- |
201 | | {{{ |
202 | | #!th rowspan=2 |
203 | | [#SettingAnchors Setting Anchors] |
204 | | }}} |
205 | | || `[=#point1 (1)] First...` ||\ |
206 | | || [=#point1 (1)] First... || |
207 | | || `see [#point1 (1)]` ||\ |
208 | | || see [#point1 (1)] || |
209 | | |----------------------------------------------------------- |
210 | | {{{ |
211 | | #!th rowspan=2 |
212 | | [#EscapingLinksandWikiPageNames Escaping Markup] |
213 | | }}} |
214 | | || `!'' doubled quotes` ||\ |
215 | | || !'' doubled quotes || |
216 | | || `!wiki:WikiFormatting`, `!WikiFormatting` ||\ |
217 | | || !wiki:WikiFormatting, !WikiFormatting || |
218 | | |----------------------------------------------------------- |
219 | | ||= [#Images Images] =|| `[[Image(`''link''`)]]` || [[Image(htdocs:../common/trac_logo_mini.png)]] || |
220 | | |----------------------------------------------------------- |
221 | | {{{ |
222 | | #!th rowspan=2 |
223 | | [#Macros Macros] |
224 | | }}} |
225 | | || `[[MacroList(*)]]` || ''(short list of all available macros)'' || |
226 | | || `[[Image?]]` || ''(help for the Image macro)'' || |
227 | | |----------------------------------------------------------- |
228 | | ||= [#Processors Processors] =||\ |
229 | | {{{ |
230 | | #!td |
231 | | {{{ |
232 | | {{{ |
233 | | #!div style="font-size: 80%" |
234 | | Code highlighting: |
235 | | {{{ |
236 | | #!python |
237 | | hello = lambda: "world" |
238 | | |
239 | | }}} |
240 | | |
241 | | }}} |
242 | | |
243 | | }}} |
244 | | }}} |
245 | | {{{ |
246 | | #!td style="padding-left: 2em" |
247 | | {{{ |
248 | | #!div style="font-size: 80%" |
249 | | Code highlighting: |
250 | | {{{ |
251 | | #!python |
252 | | hello = lambda: "world" |
253 | | |
254 | | }}} |
255 | | |
256 | | }}} |
257 | | }}} |
258 | | |----------------------------------------------------------- |
259 | | ||= [#Comments Comments] =||\ |
260 | | {{{ |
261 | | #!td |
262 | | {{{ |
263 | | {{{ |
264 | | #!comment |
265 | | Note to Editors: ... |
266 | | |
267 | | }}} |
268 | | |
269 | | }}} |
270 | | }}} |
271 | | {{{ |
272 | | #!td style="padding-left: 2em" |
273 | | {{{ |
274 | | #!comment |
275 | | Note to Editors: ... |
276 | | |
277 | | }}} |
278 | | }}} |
279 | | |----------------------------------------------------------- |
280 | | ||= [#Miscellaneous Miscellaneous] =||\ |
281 | | {{{ |
282 | | #!td |
283 | | {{{ |
284 | | Line [[br]] break |
285 | | Line \\ break |
286 | | ---- |
287 | | |
288 | | }}} |
289 | | }}} |
290 | | {{{ |
291 | | #!td style="padding-left: 2em" |
292 | | Line [[br]] break |
293 | | Line \\ break |
294 | | ---- |
295 | | }}} |
| 7 | especially [http://moinmoin.wikiwikiweb.de/ MoinMoin]. |
| 8 | |
| 9 | |
| 10 | This page demonstrates the formatting syntax available anywhere WikiFormatting is allowed. |
601 | | Cell headings can be specified by wrapping the content in a pair of '=' characters. |
602 | | Note that the '=' characters have to stick to the cell separators, like this: |
603 | | ||= Wiki Markup =||= Display =|| |
604 | | {{{ |
605 | | #!td |
606 | | {{{ |
607 | | || ||= stable =||= latest =|| |
608 | | ||= 0.10 =|| 0.10.5 || 0.10.6dev|| |
609 | | ||= 0.11 =|| 0.11.6 || 0.11.7dev|| |
610 | | |
611 | | }}} |
612 | | }}} |
613 | | {{{ |
614 | | #!td style="padding: 2em;" |
615 | | || ||= stable =||= latest =|| |
616 | | ||= 0.10 =|| 0.10.5 || 0.10.6dev|| |
617 | | ||= 0.11 =|| 0.11.6 || 0.11.7dev|| |
618 | | }}} |
619 | | |
620 | | Finally, specifying an empty cell means that the next non empty cell will span the empty cells. For example: |
621 | | ||= Wiki Markup =||= Display =|| |
622 | | {{{ |
623 | | #!td |
624 | | {{{ |
625 | | || 1 || 2 || 3 || |
626 | | |||| 1-2 || 3 || |
627 | | || 1 |||| 2-3 || |
628 | | |||||| 1-2-3 || |
629 | | |
630 | | }}} |
631 | | }}} |
632 | | {{{ |
633 | | #!td style="padding: 2em;" |
634 | | || 1 || 2 || 3 || |
635 | | |||| 1-2 || 3 || |
636 | | || 1 |||| 2-3 || |
637 | | |||||| 1-2-3 || |
638 | | }}} |
639 | | |
640 | | Note 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. Example: |
641 | | ||= Wiki Markup =||= Display =|| |
642 | | {{{ |
643 | | #!td |
644 | | {{{ |
645 | | ||=Text =||= Numbers =|| |
646 | | ||left align || 1.0|| |
647 | | || center || 4.5|| |
648 | | || right align|| 4.5|| |
649 | | || default alignment || 2.5|| |
650 | | ||default|| 2.5|| |
651 | | || default || 2.5|| |
652 | | || default || 2.5|| |
653 | | |
654 | | }}} |
655 | | }}} |
656 | | {{{ |
657 | | #!td style="padding: 2em;" |
658 | | ||=Text =||= Numbers =|| |
659 | | ||left align || 1.0|| |
660 | | || center || 4.5|| |
661 | | || right align|| 4.5|| |
662 | | || default alignment || 2.5|| |
663 | | ||default|| 2.5|| |
664 | | || default || 2.5|| |
665 | | || default || 2.5|| |
666 | | }}} |
667 | | |
668 | | If 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. |
669 | | |
670 | | ||= Wiki Markup =|| |
671 | | {{{ |
672 | | #!td |
673 | | {{{ |
674 | | || this is column 1 [http://trac.edgewall.org/newticket new ticket] || \ |
675 | | || this is column 2 [http://trac.edgewall.org/roadmap the road ahead] || \ |
676 | | || that's column 3 and last one || |
677 | | |
678 | | }}} |
679 | | }}} |
680 | | |------------- |
681 | | ||= Display =|| |
682 | | {{{ |
683 | | #!td style="padding: 2em;" |
684 | | || this is column 1 [http://trac.edgewall.org/newticket new ticket] || \ |
685 | | || this is column 2 [http://trac.edgewall.org/roadmap the road ahead] || \ |
686 | | || that's column 3 and last one || |
687 | | }}} |
688 | | |
689 | | === Complex Tables === |
690 | | |
691 | | If the possibilities offered by the simple "pipe"-based markup for tables described above are not enough for your needs, you can create more elaborated tables by using [#Processors-example-tables WikiProcessor based tables]. |
| 212 | Display: |
| 213 | ||Cell 1||Cell 2||Cell 3|| |
| 214 | ||Cell 4||Cell 5||Cell 6|| |
| 215 | |
| 216 | Note that more complex tables can be created using |
| 217 | [wiki:WikiRestructuredText#BiggerReSTExample reStructuredText]. |
700 | | ||= Wiki Markup =||= Display =|| |
701 | | {{{ |
702 | | #!td |
703 | | {{{ |
704 | | TitleIndex, http://www.edgewall.com/, !NotAlink |
705 | | |
706 | | }}} |
707 | | }}} |
708 | | {{{ |
709 | | #!td |
710 | | TitleIndex, http://www.edgewall.com/, !NotAlink |
711 | | }}} |
712 | | |
713 | | 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. |
714 | | 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. |
715 | | |
716 | | ||= Wiki Markup =||= Display =|| |
717 | | {{{ |
718 | | #!td |
719 | | {{{ |
720 | | * [http://www.edgewall.com Edgewall Software] |
721 | | * [wiki:TitleIndex Title Index] |
722 | | * [wiki:TitleIndex] |
723 | | * [wiki:ISO9000] |
724 | | |
725 | | }}} |
726 | | }}} |
727 | | {{{ |
728 | | #!td |
729 | | * [http://www.edgewall.com Edgewall Software] |
730 | | * [wiki:TitleIndex Title Index] |
731 | | * [wiki:TitleIndex] |
732 | | * [wiki:ISO9000] |
733 | | }}} |
734 | | |
735 | | Following the [trac: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. |
736 | | |
737 | | {{{ |
738 | | #!td |
739 | | {{{ |
740 | | * [[http://www.edgewall.com|Edgewall Software]] |
741 | | * [[wiki:TitleIndex|Title Index]] |
742 | | or even [[TitleIndex|Title Index]] |
743 | | * [[wiki:TitleIndex]] |
744 | | ''' but not ![[TitleIndex]]! ''' |
745 | | * [[ISO9000]] |
746 | | |
747 | | }}} |
748 | | }}} |
749 | | {{{ |
750 | | #!td |
751 | | * [[http://www.edgewall.com|Edgewall Software]] |
752 | | * [[wiki:TitleIndex|Title Index]] |
753 | | or even [[TitleIndex|Title Index]] |
754 | | * [[wiki:TitleIndex]] |
755 | | ''' but not ![[TitleIndex]]! ''' |
756 | | * [[ISO9000]] |
757 | | }}} |
758 | | |
759 | | '''Note''': the [trac:WikiCreole] style for links is quick to type and |
760 | | certainly looks familiar as it's the one used on Wikipedia and in many |
761 | | other wikis. Unfortunately it conflicts with the syntax for [#Macros macros]. |
762 | | So in the rare case when you need to refer to a page which is named after |
763 | | a macro (typical examples being TitleIndex, InterTrac and InterWiki), |
764 | | by writing `[[TitleIndex]]` you will actually call the macro instead of linking |
765 | | to the page. |
| 226 | Example: |
| 227 | {{{ |
| 228 | TitleIndex, http://www.edgewall.com/, !NotAlink |
| 229 | }}} |
| 230 | |
| 231 | Display: |
| 232 | TitleIndex, http://www.edgewall.com/, !NotAlink |
| 233 | |
| 234 | 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. |
| 235 | |
| 236 | Example: |
| 237 | {{{ |
| 238 | * [http://www.edgewall.com/ Edgewall Software] |
| 239 | * [wiki:TitleIndex Title Index] |
| 240 | * [wiki:ISO9000] |
| 241 | }}} |
| 242 | |
| 243 | Display: |
| 244 | * [http://www.edgewall.com/ Edgewall Software] |
| 245 | * [wiki:TitleIndex Title Index] |
| 246 | * [wiki:ISO9000] |
792 | | * targeting other Trac instances, |
793 | | so called InterTrac links: |
794 | | - Tickets: #Trac1 or Trac:ticket:1 |
795 | | - Changesets: [Trac1] or Trac:changeset:1 |
796 | | }}} |
797 | | |
798 | | There are many more flavors of Trac links, see TracLinks for more in-depth information and a reference for all the default link resolvers. |
799 | | |
800 | | |
801 | | == Setting Anchors == |
802 | | |
803 | | An anchor, or more correctly speaking, an [http://www.w3.org/TR/REC-html40/struct/links.html#h-12.2.1 anchor name] can be added explicitly at any place in the Wiki page, in order to uniquely identify a position in the document: |
804 | | |
805 | | {{{ |
806 | | [=#point1] |
807 | | }}} |
808 | | |
809 | | This syntax was chosen to match the format for explicitly naming the header id [#Headings documented above]. For example: |
810 | | {{{ |
811 | | == Long title == #title |
812 | | }}} |
813 | | |
814 | | It's also very close to the syntax for the corresponding link to that anchor: |
815 | | {{{ |
816 | | [#point1] |
817 | | }}} |
818 | | |
819 | | Optionally, a label can be given to the anchor: |
820 | | {{{ |
821 | | [[=#point1 '''Point 1''']] |
822 | | }}} |
823 | | |
824 | | ||= Wiki Markup =||= Display =|| |
825 | | |---------------------------------- |
826 | | {{{ |
827 | | #!td |
828 | | {{{ |
829 | | [#point2 jump to the second point] |
830 | | |
831 | | ... |
832 | | |
833 | | Point2: [=#point2] Jump here |
834 | | |
835 | | }}} |
836 | | }}} |
837 | | {{{ |
838 | | #!td |
839 | | [#point2 jump to the second point] |
840 | | |
841 | | ... |
842 | | |
843 | | Point2: [=#point2] Jump here |
844 | | }}} |
845 | | |
846 | | For more complex anchors (e.g. when a custom title is wanted), one can use the Span macro, e.g. `[[span(id=point2, class=wikianchor, title=Point 2, ^(2)^)]]`. |
| 263 | |
| 264 | There are many more flavors of Trac links, see TracLinks for more in-depth information. |
1003 | | }}} |
1004 | | |-------------------------------------------------------- |
1005 | | {{{ |
1006 | | #!td align="center" colspan=2 style="border: 0px; font-size: 90%" |
1007 | | |
1008 | | [=#Processors-example-tables Example 3:] Complex Tables |
1009 | | |
1010 | | }}} |
1011 | | |-------------------------------------------------------- |
1012 | | {{{ |
1013 | | #!td style="border: 0px" |
1014 | | {{{ |
1015 | | {{{ |
1016 | | #!th rowspan=4 align=justify |
1017 | | With the `#td` and `#th` processors, |
1018 | | table cells can contain any content: |
1019 | | |
1020 | | }}} |
1021 | | |---------------- |
1022 | | {{{ |
1023 | | #!td |
1024 | | - lists |
1025 | | - embedded tables |
1026 | | - simple multiline content |
1027 | | |
1028 | | }}} |
1029 | | |---------------- |
1030 | | {{{ |
1031 | | #!td |
1032 | | As processors can be easily nested, |
1033 | | so can be tables: |
1034 | | {{{ |
1035 | | #!th |
1036 | | Example: |
1037 | | |
1038 | | }}} |
1039 | | {{{ |
1040 | | #!td style="background: #eef" |
1041 | | || must be at the third level now... || |
1042 | | |
1043 | | }}} |
1044 | | |
1045 | | }}} |
1046 | | |---------------- |
1047 | | {{{ |
1048 | | #!td |
1049 | | Even when you don't have complex markup, |
1050 | | this form of table cells can be convenient |
1051 | | to write content on multiple lines. |
1052 | | |
1053 | | }}} |
1054 | | |
1055 | | }}} |
1056 | | }}} |
1057 | | {{{ |
1058 | | #!td valign="top" style="border: 0px" |
1059 | | |
1060 | | {{{ |
1061 | | #!th rowspan=4 align=justify |
1062 | | With the `#td` and `#th` processors, |
1063 | | table cells can contain any content: |
1064 | | |
1065 | | }}} |
1066 | | |---------------- |
1067 | | {{{ |
1068 | | #!td |
1069 | | - lists |
1070 | | - embedded tables |
1071 | | - simple multiline content |
1072 | | |
1073 | | }}} |
1074 | | |---------------- |
1075 | | {{{ |
1076 | | #!td |
1077 | | As processors can be easily nested, |
1078 | | so can be tables: |
1079 | | {{{ |
1080 | | #!th |
1081 | | Example: |
1082 | | |
1083 | | }}} |
1084 | | {{{ |
1085 | | #!td style="background: #eef" |
1086 | | || must be at the third level now... || |
1087 | | |
1088 | | }}} |
1089 | | |
1090 | | }}} |
1091 | | |---------------- |
1092 | | {{{ |
1093 | | #!td |
1094 | | Even when you don't have complex markup, |
1095 | | this form of table cells can be convenient |
1096 | | to write content on multiple lines. |
1097 | | |
1098 | | }}} |
1099 | | |
| 359 | Perl: |
| 360 | {{{ |
| 361 | #!perl |
| 362 | my ($test) = 0; |
| 363 | if ($test > 0) { |
| 364 | print "hello"; |
| 365 | } |