| 1 | = WikiFormatting = |
| 2 | [[TracGuideToc]] |
| 3 | |
| 4 | Wiki markup is a core feature in Trac, tightly integrating all the other parts of Trac into a flexible and powerful whole. |
| 5 | |
| 6 | Trac 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, |
| 7 | especially [http://moinmoin.wikiwikiweb.de/ MoinMoin]. |
| 8 | |
| 9 | |
| 10 | This page demonstrates the formatting syntax available anywhere WikiFormatting is allowed. |
| 11 | |
| 12 | |
| 13 | == Font styles == |
| 14 | |
| 15 | The Trac wiki supports the following font styles: |
| 16 | {{{ |
| 17 | * '''bold''' |
| 18 | * ''italic'' |
| 19 | * '''''bold italic''''' |
| 20 | * __underline__ |
| 21 | * {{{monospace}}} or `monospace` |
| 22 | * ~~strike-through~~ |
| 23 | * ^superscript^ |
| 24 | * ,,subscript,,. |
| 25 | }}} |
| 26 | |
| 27 | Display: |
| 28 | * '''bold''' |
| 29 | * ''italic'' |
| 30 | * '''''bold italic''''' |
| 31 | * __underline__ |
| 32 | * {{{monospace}}} or `monospace` |
| 33 | * ~~strike-through~~ |
| 34 | * ^superscript^ |
| 35 | * ,,subscript,,. |
| 36 | |
| 37 | |
| 38 | |
| 39 | == Heading == |
| 40 | |
| 41 | You can create heading by starting a line with one up to five ''equal'' "=" characters |
| 42 | followed by a single space and the headline text. The line should end with a space |
| 43 | followed by the same number of ''equal'' characters. |
| 44 | |
| 45 | Example: |
| 46 | {{{ |
| 47 | = Heading = |
| 48 | == Subheading == |
| 49 | === About ''this'' === |
| 50 | }}} |
| 51 | |
| 52 | Display: |
| 53 | = Heading = |
| 54 | == Subheading == |
| 55 | === About ''this'' === |
| 56 | |
| 57 | |
| 58 | == Paragraphs == |
| 59 | |
| 60 | A new text paragraph is created whenever two blocks of text are separated |
| 61 | by one or more empty lines. |
| 62 | |
| 63 | A forced line break can also be inserted, using: |
| 64 | {{{ |
| 65 | Line 1[[BR]]Line 2 |
| 66 | }}} |
| 67 | Display: |
| 68 | |
| 69 | Line 1[[BR]]Line 2 |
| 70 | |
| 71 | Text paragraphs can be indented by starting the lines with two or more spaces. |
| 72 | |
| 73 | |
| 74 | == Lists == |
| 75 | |
| 76 | The wiki supports both ordered/numbered and unordered lists. |
| 77 | There must be a space preceding the star "*" or number "1.", or nothing will happen. |
| 78 | |
| 79 | Example: |
| 80 | {{{ |
| 81 | * Item 1 |
| 82 | * Item 1.1 |
| 83 | * Item 2 |
| 84 | |
| 85 | 1. Item 1 |
| 86 | 1. Item 1.1 |
| 87 | 1. Item 2 |
| 88 | }}} |
| 89 | |
| 90 | Display: |
| 91 | * Item 1 |
| 92 | * Item 1.1 |
| 93 | * Item 2 |
| 94 | |
| 95 | 1. Item 1 |
| 96 | 1. Item 1.1 |
| 97 | 1. Item 2 |
| 98 | |
| 99 | |
| 100 | == Definition lists == |
| 101 | |
| 102 | The wiki also supports definition lists. |
| 103 | |
| 104 | Example: |
| 105 | {{{ |
| 106 | llama:: |
| 107 | some kind of mammal, with hair |
| 108 | ppython:: |
| 109 | some kind of reptile, without hair |
| 110 | (can you spot the typo?) |
| 111 | }}} |
| 112 | |
| 113 | Display: |
| 114 | llama:: |
| 115 | some kind of mammal, with hair |
| 116 | ppython:: |
| 117 | some kind of reptile, without hair |
| 118 | (can you spot the typo?) |
| 119 | |
| 120 | Note that you need a space in front of the defined term. |
| 121 | |
| 122 | |
| 123 | == Preformatted text == |
| 124 | |
| 125 | Block quotes, preformatted text, are suitable for source code snippets, notes and examples. Use three ''curly braces'' wrapped around the text to define a block quote. |
| 126 | |
| 127 | Example: |
| 128 | {{{ |
| 129 | {{{ |
| 130 | def HelloWorld() |
| 131 | print "Hello World" |
| 132 | }}} |
| 133 | }}} |
| 134 | |
| 135 | Display: |
| 136 | {{{ |
| 137 | def HelloWorld() |
| 138 | print "Hello World" |
| 139 | }}} |
| 140 | |
| 141 | |
| 142 | == Tables == |
| 143 | |
| 144 | Simple tables can be created like this: |
| 145 | {{{ |
| 146 | ||Cell 1||Cell 2||Cell 3|| |
| 147 | ||Cell 4||Cell 5||Cell 6|| |
| 148 | }}} |
| 149 | |
| 150 | Display: |
| 151 | ||Cell 1||Cell 2||Cell 3|| |
| 152 | ||Cell 4||Cell 5||Cell 6|| |
| 153 | |
| 154 | Note that more complex tables can be created using |
| 155 | [wiki:WikiRestructuredText#BiggerReSTExample reStructuredText]. |
| 156 | |
| 157 | == Links == |
| 158 | |
| 159 | Hyperlinks are automatically created for WikiPageNames and urls. |
| 160 | !WikiPageLinks can be disabled by |
| 161 | prepending an exclamation mark "!" character, such as {{{!WikiPageLink}}}. |
| 162 | |
| 163 | Example: |
| 164 | {{{ |
| 165 | TitleIndex, http://www.edgewall.com/, !NotAlink |
| 166 | }}} |
| 167 | |
| 168 | Display: |
| 169 | TitleIndex, http://www.edgewall.com/, !NotAlink |
| 170 | |
| 171 | Links can be given a more descriptive title by writing the link followed by |
| 172 | a space and a title and all this inside square brackets. |
| 173 | If the descriptive title is omitted, then the explicit prefix is disguarded, |
| 174 | unless the link is an external link. This can be useful for wiki pages |
| 175 | not adhering to the WikiPageNames convention. |
| 176 | |
| 177 | Like this: |
| 178 | {{{ |
| 179 | * [http://www.edgewall.com/ Edgewall Software] |
| 180 | * [wiki:TitleIndex Title Index] |
| 181 | * [wiki:ISO9000] |
| 182 | }}} |
| 183 | |
| 184 | Display: |
| 185 | * [http://www.edgewall.com/ Edgewall Software] |
| 186 | * [wiki:TitleIndex Title Index] |
| 187 | * [wiki:ISO9000] |
| 188 | |
| 189 | |
| 190 | === Trac Links === |
| 191 | |
| 192 | Wiki pages can link directly to other parts of the Trac system. |
| 193 | Pages can refer to tickets, reports, changesets, milestones, source files and |
| 194 | other Wiki pages using the following notation: |
| 195 | {{{ |
| 196 | * Tickets: #1 or ticket:1 |
| 197 | * Reports: {1} or report:1 |
| 198 | * Changesets: r1, [1] or changeset:1 |
| 199 | * Revision Logs: r1:3, [1:3] or log:branches/0.9-stable#1:3 |
| 200 | * Wiki pages: CamelCase or wiki:CamelCase |
| 201 | * Milestones: milestone:1.0 or milestone:"End-of-days Release" |
| 202 | * Files: source:trunk/COPYING |
| 203 | * A specific file revision: source:/trunk/COPYING#200 |
| 204 | * A filename with embedded space: source:"/trunk/README FIRST" |
| 205 | }}} |
| 206 | |
| 207 | Display: |
| 208 | * Tickets: #1 or ticket:1 |
| 209 | * Reports: {1} or report:1 |
| 210 | * Changesets: r1, [1] or changeset:1 |
| 211 | * Revision Logs: r1:3, [1:3] or log:branches/0.8-stable#1000:2000 |
| 212 | * Wiki pages: CamelCase or wiki:CamelCase |
| 213 | * Milestones: milestone:1.0 or milestone:"End-of-days Release" |
| 214 | * Files: source:trunk/COPYING |
| 215 | * A specific file revision: source:/trunk/COPYING#200 |
| 216 | * A filename with embedded space: source:"/trunk/README FIRST" |
| 217 | |
| 218 | See TracLinks for more in-depth information. |
| 219 | |
| 220 | |
| 221 | == Escaping Links and WikiPageNames == |
| 222 | |
| 223 | You may avoid making hyperlinks out of TracLinks by preceding an expression with a single "!" (exclamation mark). |
| 224 | |
| 225 | {{{ |
| 226 | !NoHyperLink |
| 227 | !#42 is not a link |
| 228 | }}} |
| 229 | |
| 230 | Display: |
| 231 | !NoHyperLink |
| 232 | !#42 is not a link |
| 233 | |
| 234 | |
| 235 | == Images == |
| 236 | |
| 237 | Urls ending with `.png`, `.gif` or `.jpg` are automatically interpreted as image links, and converted to `<img>` tags. |
| 238 | |
| 239 | Example: |
| 240 | {{{ |
| 241 | http://www.edgewall.com/gfx/trac_example_image.png |
| 242 | }}} |
| 243 | |
| 244 | Display: |
| 245 | |
| 246 | http://www.edgewall.com/gfx/trac_example_image.png |
| 247 | |
| 248 | |
| 249 | == Macros == |
| 250 | |
| 251 | Macros are ''custom functions'' to insert dynamic content in a page. |
| 252 | See WikiMacros for usage. |
| 253 | |
| 254 | Example: |
| 255 | {{{ |
| 256 | [[Timestamp]] |
| 257 | }}} |
| 258 | |
| 259 | Display: |
| 260 | [[Timestamp]] |
| 261 | |
| 262 | |
| 263 | == Processors == |
| 264 | |
| 265 | Trac supports alternative markup formats using WikiProcessors. |
| 266 | For example, processors are used to write pages in |
| 267 | [wiki:WikiRestructuredText reStructuredText] or [wiki:WikiHtml HTML]. |
| 268 | |
| 269 | See WikiProcessors for more information. |
| 270 | |
| 271 | '''Example 1:''' |
| 272 | {{{ |
| 273 | #!html |
| 274 | <pre class="wiki">{{{ |
| 275 | #!html |
| 276 | <h1 style="text-align: right; color: blue">HTML Test</h1> |
| 277 | }}}</pre> |
| 278 | }}} |
| 279 | |
| 280 | Display: |
| 281 | {{{ |
| 282 | #!html |
| 283 | <h1 style="text-align: right; color: blue">HTML Test</h1> |
| 284 | }}} |
| 285 | |
| 286 | '''Example 2:''' |
| 287 | {{{ |
| 288 | #!html |
| 289 | <pre class="wiki">{{{ |
| 290 | #!python |
| 291 | class Test: |
| 292 | def __init__(self): |
| 293 | print "Hello World" |
| 294 | if __name__ == '__main__': |
| 295 | Test() |
| 296 | }}}</pre> |
| 297 | }}} |
| 298 | |
| 299 | Display: |
| 300 | {{{ |
| 301 | #!python |
| 302 | class Test: |
| 303 | def __init__(self): |
| 304 | print "Hello World" |
| 305 | if __name__ == '__main__': |
| 306 | Test() |
| 307 | }}} |
| 308 | |
| 309 | |
| 310 | == Miscellaneous == |
| 311 | |
| 312 | Four or more dashes will be replaced by a horizontal line (<HR>) |
| 313 | |
| 314 | Example: |
| 315 | {{{ |
| 316 | ---- |
| 317 | }}} |
| 318 | |
| 319 | Display: |
| 320 | ---- |
| 321 | |
| 322 | |
| 323 | ---- |
| 324 | |
| 325 | See also: TracLinks, TracGuide, WikiHtml, WikiMacros, WikiProcessors, TracSyntaxColoring. |
| 326 | |
| 327 | ---- |