Changes between Version 90 and Version 91 of WikiFormatting
- Timestamp:
- Apr 10, 2010, 7:28:58 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WikiFormatting
v90 v91 1 ** Note: this page documents the 0.12 version of Trac, see [[0.11/WikiFormatting]] if you need the previous version ** 1 2 = WikiFormatting = 2 3 [[TracGuideToc]] … … 5 6 6 7 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. 8 especially [http://moinmo.in/ MoinMoin] and [trac:WikiCreole]. 9 10 11 This page will give you an in-depth explanation of the wiki markup available anywhere WikiFormatting is allowed. 12 13 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. 14 15 A few other wiki pages present the advanced features of the Trac wiki markup in more depth: 16 - TracLinks covers all the possible ways to refer precisely to any Trac resource or parts thereof, 17 - WikiPageNames talks about the various names a wiki page can take, CamelCase or not 18 - WikiMacros lists the macros available for generating dynamic content, 19 - WikiProcessors and WikiHtml details how parts of the wiki text can be processed in special ways 20 21 22 == Cheatsheet == 23 24 ||= '''Category''' =||= '''Wiki Markup''' =||= '''Display''' =|| 25 |----------------------------------------------------------- 26 {{{#!th rowspan=3 27 [#FontStyles Font Styles] 28 }}} 29 || `'''bold'''`, `''italic''`, `'''''Wikipedia style'''''` || \ 30 || '''bold''', ''italic'', '''''Wikipedia style''''' || 31 || {{{`monospaced and ''nowiki''`}}} || \ 32 || `monospaced and nowiki` || 33 || `**bold**`, `//italic//`, `**//!WikiCreole style//**` || \ 34 || **bold**, //italic//, **//!WikiCreole style//** || 35 |----------------------------------------------------------- 36 ||= [#Headings Headings] =||\ 37 {{{#!td 38 {{{ 39 == Level 2 == 40 === Level 3 ^([#hn note])^ 41 }}} 42 }}} 43 {{{#!td style="padding-left: 2em" 44 == Level 2 45 === Level 3 ^([#hn note])^ 46 }}} 47 |----------------------------------------------------------- 48 ||= [#Paragraphs Paragraphs] =||\ 49 {{{#!td 50 {{{ 51 First paragraph 52 on multiple lines. 53 54 Second paragraph. 55 }}} 56 }}} 57 {{{#!td 58 First paragraph 59 on multiple lines. 60 61 Second paragraph. 62 }}} 63 |----------------------------------------------------------- 64 ||= [#Lists Lists] =||\ 65 {{{#!td 66 {{{ 67 * bullets list 68 on multiple paragraphs 69 1. nested list 70 a. different numbering 71 styles 72 }}} 73 }}} 74 {{{#!td 75 * bullets list 76 on multiple paragraphs 77 1. nested list 78 a. different numbering 79 styles 80 }}} 81 |----------------------------------------------------------- 82 {{{#!th 83 [#DefinitionLists Definition Lists] 84 }}} 85 {{{#!td 86 {{{ 87 term:: definition on 88 multiple paragraphs 89 }}} 90 }}} 91 {{{#!td 92 term:: definition on 93 multiple paragraphs 94 }}} 95 |----------------------------------------------------------- 96 ||= [#PreformattedText Preformatted Text] =||\ 97 {{{#!td 98 {{{ 99 {{{ 100 multiple lines, ''no wiki'' 101 white space respected 102 }}} 103 }}} 104 }}} 105 {{{#!td 106 {{{ 107 multiple lines, ''no wiki'' 108 white space respected 109 }}} 110 }}} 111 |----------------------------------------------------------- 112 ||= [#Blockquotes Blockquotes] =||\ 113 {{{#!td 114 {{{ 115 if there's some leading 116 space the text is quoted 117 }}} 118 }}} 119 {{{#!td 120 if there's some leading 121 space the text is quoted 122 }}} 123 |----------------------------------------------------------- 124 ||= [#DiscussionCitations Discussion Citations] =||\ 125 {{{#!td 126 {{{ 127 >> ... (I said) 128 > (he replied) 129 }}} 130 }}} 131 {{{#!td 132 >>... (I said) 133 > (he replied) 134 }}} 135 |----------------------------------------------------------- 136 ||= [#Tables Tables] =||\ 137 {{{#!td 138 {{{ 139 ||= Table Header =|| Cell || 140 |||| (details below) || 141 }}} 142 }}} 143 {{{#!td 144 ||= Table Header =|| Cell || 145 |||| (details below) || 146 }}} 147 |----------------------------------------------------------- 148 {{{#!th rowspan=2 149 [#Links Links] 150 }}} 151 || `http://trac.edgewall.org` ||\ 152 || http://trac.edgewall.org || 153 || `WikiFormatting (CamelCase)` ||\ 154 || WikiFormatting (CamelCase) || 155 |----------------------------------------------------------- 156 {{{#!th rowspan=5 157 [#TracLinks TracLinks] 158 }}} 159 || `wiki:WikiFormatting`, `wiki:"WikiFormatting"` ||\ 160 || wiki:WikiFormatting, wiki:"WikiFormatting" || 161 || `#1 (ticket)`, `[1] (changeset)`, `{1} (report)` ||\ 162 || #1 (ticket), [1] (changeset), {1} (report) || 163 || `ticket:1, ticket:1#comment:1` ||\ 164 || ticket:1, ticket:1#comment:1 || 165 || `Ticket [ticket:1]`, `[ticket:1 ticket one]` ||\ 166 || Ticket [ticket:1], [ticket:1 ticket one] || 167 || `Ticket [[ticket:1]]`, `[[ticket:1|ticket one]]` ||\ 168 || Ticket [[ticket:1]], [[ticket:1|ticket one]] || 169 |----------------------------------------------------------- 170 {{{#!th rowspan=2 171 [#EscapingLinksandWikiPageNames Escaping Markup] 172 }}} 173 || `!'' doubled quotes` ||\ 174 || !'' doubled quotes || 175 || `!wiki:WikiFormatting`, `!WikiFormatting` ||\ 176 || !wiki:WikiFormatting, !WikiFormatting || 177 |----------------------------------------------------------- 178 ||= [#Images Images] =|| `[[Image(`''link''`)]]` || [[Image(htdocs:../common/trac_logo_mini.png)]] || 179 |----------------------------------------------------------- 180 {{{#!th rowspan=2 181 [#Macros Macros] 182 }}} 183 || `[[MacroList(*)]]` || ''(short list of all available macros)'' || 184 || `[[Image?]]` || ''(help for the Image macro)'' || 185 |----------------------------------------------------------- 186 ||= [#Processors Processors] =||\ 187 {{{#!td 188 {{{ 189 {{{ 190 #!div style="font-size: 80%" 191 Code highlighting: 192 {{{#!python 193 hello = lambda: "world" 194 }}} 195 }}} 196 }}} 197 }}} 198 {{{#!td style="padding-left: 2em" 199 {{{ 200 #!div style="font-size: 80%" 201 Code highlighting: 202 {{{#!python 203 hello = lambda: "world" 204 }}} 205 }}} 206 }}} 207 |----------------------------------------------------------- 208 ||= [#Comments Comments] =||\ 209 {{{#!td 210 {{{ 211 {{{#!comment 212 Note to Editors: ... 213 }}} 214 }}} 215 }}} 216 {{{#!td style="padding-left: 2em" 217 {{{#!comment 218 Note to Editors: ... 219 }}} 220 }}} 221 |----------------------------------------------------------- 222 ||= [#Miscellaneous Miscellaneous] =||\ 223 {{{#!td 224 {{{ 225 Line [[br]] break 226 Line \\ break 227 ---- 228 }}} 229 }}} 230 {{{#!td style="padding-left: 2em" 231 Line [[br]] break 232 Line \\ break 233 ---- 234 }}} 11 235 12 236 … … 14 238 15 239 The Trac wiki supports the following font styles: 16 {{{ 17 * '''bold''', '''!''' can be bold too''', and '''! ''' 240 ||= Wiki Markup =||= Display =|| 241 {{{#!td 242 {{{ 243 * '''bold''', 244 ''' triple quotes !''' 245 can be bold too if prefixed by ! ''', 246 * ''italic'' 247 * '''''bold italic''''' or ''italic and 248 ''' italic bold ''' '' 249 * __underline__ 250 * {{{monospace}}} or `monospace` 251 (hence `{{{` or {{{`}}} quoting) 252 * ~~strike-through~~ 253 * ^superscript^ 254 * ,,subscript,, 255 * **also bold**, //italic as well//, 256 and **'' bold italic **'' //(since 0.12)// 257 }}} 258 }}} 259 {{{#!td 260 * '''bold''', 261 ''' triple quotes !''' 262 can be bold too if prefixed by ! ''', 18 263 * ''italic'' 19 * '''''bold italic''''' 264 * '''''bold italic''''' or ''italic and 265 ''' italic bold ''' '' 20 266 * __underline__ 21 267 * {{{monospace}}} or `monospace` 268 (hence `{{{` or {{{`}}} quoting) 22 269 * ~~strike-through~~ 23 270 * ^superscript^ 24 271 * ,,subscript,, 25 }}} 26 27 Display: 28 * '''bold''', '''!''' can be bold too''', and '''! ''' 29 * ''italic'' 30 * '''''bold italic''''' 31 * __underline__ 32 * {{{monospace}}} or `monospace` 33 * ~~strike-through~~ 34 * ^superscript^ 35 * ,,subscript,, 272 * **also bold**, //italic as well//, 273 and **'' bold italic **'' //(since 0.12)// 274 }}} 36 275 37 276 Notes: 38 277 * `{{{...}}}` 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. 39 278 * {{{ ! }}} 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. 279 * all the font styles marks have to be used in opening/closing pairs, 280 and they must nest properly (in particular, an `''` italic can't be paired 281 with a `//` one, and `'''` can't be paired with `**`) 282 40 283 41 284 == Headings == 42 285 43 You can create heading by starting a line with one up to five ''equal'' characters ("=") 44 followed by a single space and the headline text. The line should end with a space 45 followed by the same number of ''='' characters. 46 The heading might optionally be followed by an explicit id. If not, an implicit but nevertheless readable id will be generated. 286 You can create heading by starting a line with one up to six ''equal'' characters ("=") 287 followed by a single space and the headline text. 288 289 [=#hn] The headline text can be followed by the same number of "=" characters, but this is no longer mandatory. 290 291 Finally, the heading might optionally be followed by an explicit id. If not, an implicit but nevertheless readable id will be generated. 292 293 ||= Wiki Markup =||= Display =|| 294 {{{#!td 295 {{{ 296 = Heading = 297 == Subheading 298 === About ''this'' === 299 === Explicit id === #using-explicit-id-in-heading 300 == Subheading #sub2 301 }}} 302 }}} 303 {{{#!td style="padding: 1em;" 304 {{{ 305 #!div 306 == Subheading 307 === About ''this'' === 308 === Explicit id === #using-explicit-id-in-heading 309 == Subheading #sub2 310 }}} 311 }}} 312 313 == Paragraphs == 314 315 A new text paragraph is created whenever two blocks of text are separated by one or more empty lines. 316 317 A forced line break can also be inserted, using: 318 ||= Wiki Markup =||= Display =|| 319 {{{#!td 320 {{{ 321 Line 1[[BR]]Line 2 322 }}} 323 {{{ 324 Paragraph 325 one 326 327 Paragraph 328 two 329 }}} 330 }}} 331 {{{#!td 332 Line 1[[BR]]Line 2 333 334 Paragraph 335 one 336 337 Paragraph 338 two 339 }}} 340 341 == Lists == 342 343 The wiki supports both ordered/numbered and unordered lists. 47 344 48 345 Example: 49 {{{ 50 = Heading = 51 == Subheading == 52 === About ''this'' === 53 === Explicit id === #using-explicit-id-in-heading 54 }}} 55 56 Display: 57 = Heading = 58 == Subheading == 59 === About ''this'' === 60 === Explicit id === #using-explicit-id-in-heading 61 62 == Paragraphs == 63 64 A new text paragraph is created whenever two blocks of text are separated by one or more empty lines. 65 66 A forced line break can also be inserted, using: 67 {{{ 68 Line 1[[BR]]Line 2 69 }}} 70 Display: 71 72 Line 1[[BR]]Line 2 73 74 75 == Lists == 76 77 The wiki supports both ordered/numbered and unordered lists. 78 79 Example: 80 {{{ 346 ||= Wiki Markup =||= Display =|| 347 {{{#!td 348 {{{ 349 * Item 1 350 * Item 1.1 351 * Item 1.1.1 352 * Item 1.1.2 353 * Item 1.1.3 354 * Item 1.2 355 * Item 2 356 - items can start at the beginning of a line 357 and they can span multiple lines 358 - be careful though to continue the line 359 with the appropriate indentation, otherwise 360 that will start a new paragraph... 361 362 1. Item 1 363 a. Item 1.a 364 a. Item 1.b 365 i. Item 1.b.i 366 i. Item 1.b.ii 367 1. Item 2 368 And numbered lists can also be restarted 369 with an explicit number: 370 3. Item 3 371 }}} 372 }}} 373 {{{#!td 81 374 * Item 1 82 375 * Item 1.1 … … 86 379 * Item 1.2 87 380 * Item 2 381 - items can start at the beginning of a line 382 and they can span multiple lines 383 - be careful though to continue the line 384 with the appropriate indentation, otherwise 385 that will start a new paragraph... 88 386 89 387 1. Item 1 … … 93 391 i. Item 1.b.ii 94 392 1. Item 2 95 And numbered lists can also be givenan explicit number:393 And numbered lists can also be restarted with an explicit number: 96 394 3. Item 3 97 395 }}} 98 396 99 Display:100 * Item 1101 * Item 1.1102 * Item 1.1.1103 * Item 1.1.2104 * Item 1.1.3105 * Item 1.2106 * Item 2107 108 1. Item 1109 a. Item 1.a110 a. Item 1.b111 i. Item 1.b.i112 i. Item 1.b.ii113 1. Item 2114 And numbered lists can also be given an explicit number:115 3. Item 3116 117 Note that there must be one or more spaces preceding the list item markers, otherwise the list will be treated as a normal paragraph.118 119 397 120 398 == Definition Lists == 121 399 122 123 400 The wiki also supports definition lists. 124 401 125 Example: 126 {{{ 402 ||= Wiki Markup =||= Display =|| 403 {{{#!td 404 {{{ 405 llama:: 406 some kind of mammal, with hair 407 ppython:: 408 some kind of reptile, without hair 409 (can you spot the typo?) 410 }}} 411 }}} 412 {{{#!td 127 413 llama:: 128 414 some kind of mammal, with hair … … 132 418 }}} 133 419 134 Display:135 llama::136 some kind of mammal, with hair137 ppython::138 some kind of reptile, without hair139 (can you spot the typo?)140 141 420 Note that you need a space in front of the defined term. 142 421 … … 146 425 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. 147 426 148 Example: 427 ||= Wiki Markup =||= Display =|| 428 {{{#!td 429 {{{ 430 {{{ 431 def HelloWorld(): 432 print '''Hello World''' 433 }}} 434 }}} 435 }}} 436 {{{#!td 437 {{{ 438 def HelloWorld(): 439 print '''Hello World''' 440 }}} 441 }}} 442 443 Note that this kind of block is also used for selecting lines that should be processed through WikiProcessors. 444 445 == Blockquotes == 446 447 In order to mark a paragraph as blockquote, indent that paragraph with two spaces. 448 449 ||= Wiki Markup =||= Display =|| 450 {{{#!td 149 451 {{{ 150 {{{ 151 def HelloWorld(): 152 print "Hello World" 153 }}} 154 }}} 155 156 Display: 157 {{{ 158 def HelloWorld(): 159 print "Hello World" 160 }}} 161 162 163 == Blockquotes == 164 165 In order to mark a paragraph as blockquote, indent that paragraph with two spaces. 166 167 Example: 168 {{{ 452 Paragraph 169 453 This text is a quote from someone else. 170 454 }}} 171 172 Display: 455 }}} 456 {{{#!td 457 Paragraph 173 458 This text is a quote from someone else. 459 }}} 174 460 175 461 == Discussion Citations == … … 177 463 To delineate a citation in an ongoing discussion thread, such as the ticket comment area, e-mail-like citation marks (">", ">>", etc.) may be used. 178 464 179 Example: 180 {{{ 465 ||= Wiki Markup =||= Display =|| 466 {{{#!td 467 {{{ 468 >> Someone's original text 469 > Someone else's reply text 470 > - which can be any kind of Wiki markup 471 My reply text 472 }}} 473 }}} 474 {{{#!td 181 475 >> Someone's original text 182 476 > Someone else's reply text 477 > - which can be any kind of Wiki markup 183 478 My reply text 184 479 }}} 185 480 186 Display:187 >> Someone's original text188 > Someone else's reply text189 My reply text190 191 ''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.''192 481 193 482 == Tables == 194 483 === Simple Tables === 195 484 Simple tables can be created like this: 196 {{{ 485 ||= Wiki Markup =||= Display =|| 486 {{{#!td 487 {{{ 488 ||Cell 1||Cell 2||Cell 3|| 489 ||Cell 4||Cell 5||Cell 6|| 490 }}} 491 }}} 492 {{{#!td style="padding: 2em;" 197 493 ||Cell 1||Cell 2||Cell 3|| 198 494 ||Cell 4||Cell 5||Cell 6|| 199 495 }}} 200 496 201 Display: 202 ||Cell 1||Cell 2||Cell 3|| 203 ||Cell 4||Cell 5||Cell 6|| 204 205 Note that more complex tables can be created using 206 [wiki:WikiRestructuredText#BiggerReSTExample reStructuredText]. 497 Cell headings can be specified by wrapping the content in a pair of '=' characters. 498 Note that the '=' characters have to stick to the cell separators, like this: 499 ||= Wiki Markup =||= Display =|| 500 {{{#!td 501 {{{ 502 || ||= stable =||= latest =|| 503 ||= 0.10 =|| 0.10.5 || 0.10.6dev|| 504 ||= 0.11 =|| 0.11.6 || 0.11.7dev|| 505 }}} 506 }}} 507 {{{#!td style="padding: 2em;" 508 || ||= stable =||= latest =|| 509 ||= 0.10 =|| 0.10.5 || 0.10.6dev|| 510 ||= 0.11 =|| 0.11.6 || 0.11.7dev|| 511 }}} 512 513 Finally, specifying an empty cell means that the next non empty cell will span the empty cells. For example: 514 ||= Wiki Markup =||= Display =|| 515 {{{#!td 516 {{{ 517 || 1 || 2 || 3 || 518 |||| 1-2 || 3 || 519 || 1 |||| 2-3 || 520 |||||| 1-2-3 || 521 }}} 522 }}} 523 {{{#!td style="padding: 2em;" 524 || 1 || 2 || 3 || 525 |||| 1-2 || 3 || 526 || 1 |||| 2-3 || 527 |||||| 1-2-3 || 528 }}} 529 530 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: 531 ||= Wiki Markup =||= Display =|| 532 {{{#!td 533 {{{ 534 ||=Text =||= Numbers =|| 535 ||left align || 1.0|| 536 || center || 4.5|| 537 || right align|| 4.5|| 538 || default alignment || 2.5|| 539 ||default|| 2.5|| 540 || default || 2.5|| 541 || default || 2.5|| 542 }}} 543 }}} 544 {{{#!td style="padding: 2em;" 545 ||=Text =||= Numbers =|| 546 ||left align || 1.0|| 547 || center || 4.5|| 548 || right align|| 4.5|| 549 || default alignment || 2.5|| 550 ||default|| 2.5|| 551 || default || 2.5|| 552 || default || 2.5|| 553 }}} 554 555 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. 556 557 ||= Wiki Markup =|| 558 {{{#!td 559 {{{ 560 || this is column 1 [http://trac.edgewall.org/newticket new ticket] || \ 561 || this is column 2 [http://trac.edgewall.org/roadmap the road ahead] || \ 562 || that's column 3 and last one || 563 }}} 564 }}} 565 |------------- 566 ||= Display =|| 567 {{{#!td style="padding: 2em;" 568 || this is column 1 [http://trac.edgewall.org/newticket new ticket] || \ 569 || this is column 2 [http://trac.edgewall.org/roadmap the road ahead] || \ 570 || that's column 3 and last one || 571 }}} 572 573 === Complex Tables === 574 575 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]. 207 576 208 577 … … 211 580 Hyperlinks are automatically created for WikiPageNames and URLs. !WikiPageLinks can be disabled by prepending an exclamation mark "!" character, such as {{{!WikiPageLink}}}. 212 581 213 Example: 214 {{{ 215 TitleIndex, http://www.edgewall.com/, !NotAlink 216 }}} 217 218 Display: 219 TitleIndex, http://www.edgewall.com/, !NotAlink 220 221 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. 222 223 Example: 224 {{{ 225 * [http://www.edgewall.com/ Edgewall Software] 226 * [wiki:TitleIndex Title Index] 227 * [wiki:ISO9000] 228 }}} 229 230 Display: 231 * [http://www.edgewall.com/ Edgewall Software] 232 * [wiki:TitleIndex Title Index] 233 * [wiki:ISO9000] 582 ||= Wiki Markup =||= Display =|| 583 {{{#!td 584 {{{ 585 TitleIndex, http://www.edgewall.com/, !NotAlink 586 }}} 587 }}} 588 {{{#!td 589 TitleIndex, http://www.edgewall.com/, !NotAlink 590 }}} 591 592 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. 593 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. 594 595 ||= Wiki Markup =||= Display =|| 596 {{{#!td 597 {{{ 598 * [http://www.edgewall.com Edgewall Software] 599 * [wiki:TitleIndex Title Index] 600 * [wiki:TitleIndex] 601 * [wiki:ISO9000] 602 }}} 603 }}} 604 {{{#!td 605 * [http://www.edgewall.com Edgewall Software] 606 * [wiki:TitleIndex Title Index] 607 * [wiki:TitleIndex] 608 * [wiki:ISO9000] 609 }}} 610 611 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. 612 613 {{{#!td 614 {{{ 615 * [[http://www.edgewall.com|Edgewall Software]] 616 * [[wiki:TitleIndex|Title Index]] 617 or even [[TitleIndex|Title Index]] 618 * [[wiki:TitleIndex]] 619 ''' but not ![[TitleIndex]]! ''' 620 * [[ISO9000]] 621 }}} 622 }}} 623 {{{#!td 624 * [[http://www.edgewall.com|Edgewall Software]] 625 * [[wiki:TitleIndex|Title Index]] 626 or even [[TitleIndex|Title Index]] 627 * [[wiki:TitleIndex]] 628 ''' but not ![[TitleIndex]]! ''' 629 * [[ISO9000]] 630 }}} 631 632 '''Note''': the [trac:WikiCreole] style for links is quick to type and 633 certainly looks familiar as it's the one used on Wikipedia and in many 634 other wikis. Unfortunately it conflicts with the syntax for [#Macros macros]. 635 So in the rare case when you need to refer to a page which is named after 636 a macro (typical examples being TitleIndex, InterTrac and InterWiki), 637 by writing `[[TitleIndex]]` you will actually call the macro instead of linking 638 to the page. 234 639 235 640 == Trac Links == 236 641 237 642 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: 238 {{{ 239 * Tickets: #1 or ticket:1 240 * Reports: {1} or report:1 241 * Changesets: r1, [1] or changeset:1 242 * ... 243 }}} 244 245 Display: 643 644 ||= Wiki Markup =||= Display =|| 645 {{{#!td 646 {{{ 647 * Tickets: #1 or ticket:1 648 * Reports: {1} or report:1 649 * Changesets: r1, [1] or changeset:1 650 * ... 651 * targeting other Trac instances, 652 so called InterTrac links: 653 - Tickets: #Trac1 or Trac:ticket:1 654 - Changesets: [Trac1] or Trac:changeset:1 655 }}} 656 }}} 657 {{{#!td 246 658 * Tickets: #1 or ticket:1 247 659 * Reports: {1} or report:1 248 660 * Changesets: r1, [1] or changeset:1 249 661 * ... 250 251 There are many more flavors of Trac links, see TracLinks for more in-depth information. 662 * targeting other Trac instances, 663 so called InterTrac links: 664 - Tickets: #Trac1 or Trac:ticket:1 665 - Changesets: [Trac1] or Trac:changeset:1 666 }}} 667 668 There are many more flavors of Trac links, see TracLinks for more in-depth information and a reference for all the default link resolvers. 252 669 253 670 … … 256 673 You may avoid making hyperlinks out of TracLinks by preceding an expression with a single "!" (exclamation mark). 257 674 258 Example: 259 {{{ 675 ||= Wiki Markup =||= Display =|| 676 {{{#!td 677 {{{ 678 !NoHyperLink 679 !#42 is not a link 680 }}} 681 }}} 682 {{{#!td 260 683 !NoHyperLink 261 684 !#42 is not a link 262 685 }}} 263 264 Display:265 !NoHyperLink266 !#42 is not a link267 268 686 269 687 == Images == … … 279 697 * `[[Image(source:/trunk/trac/htdocs/trac_logo_mini.png)]]` (a file in repository) 280 698 281 Example display: [[Image(htdocs:../common/trac_logo_mini.png)]] 699 ||= Wiki Markup =||= Display =|| 700 {{{#!td 701 {{{ 702 [[Image(htdocs:../common/trac_logo_mini.png)]] 703 }}} 704 }}} 705 {{{#!td 706 [[Image(htdocs:../common/trac_logo_mini.png)]] 707 }}} 282 708 283 709 See WikiMacros for further documentation on the `[[Image()]]` macro. … … 288 714 Macros are ''custom functions'' to insert dynamic content in a page. 289 715 290 Example: 291 {{{ 292 [[RecentChanges(Trac,3)]] 293 }}} 294 295 Display: 296 [[RecentChanges(Trac,3)]] 716 ||= Wiki Markup =||= Display =|| 717 {{{#!td 718 {{{ 719 [[RecentChanges(Trac,3)]] 720 }}} 721 }}} 722 {{{#!td style="padding-left: 2em" 723 [[RecentChanges(Trac,3)]] 724 }}} 297 725 298 726 See WikiMacros for more information, and a list of installed macros. 727 728 The detailed help for a specific macro can also be obtained more directly by appending a "?" to the macro name. 729 730 ||= Wiki Markup =||= Display =|| 731 {{{#!td 732 {{{ 733 [[MacroList?]] 734 }}} 735 }}} 736 {{{#!td style="padding-left: 2em" 737 [[MacroList?]] 738 }}} 299 739 300 740 … … 304 744 [wiki:WikiRestructuredText reStructuredText] or [wiki:WikiHtml HTML]. 305 745 306 Example 1: 307 {{{ 308 #!html 309 <pre class="wiki">{{{ 310 #!html 311 <h1 style="text-align: right; color: blue">HTML Test</h1> 312 }}}</pre> 313 }}} 314 315 Display: 746 ||= Wiki Markup =||= Display =|| 747 |-------------------------------------------------------- 748 {{{#!td align="center" colspan=2 style="border: 0px; font-size: 90%" 749 750 [=#Processors-example-html Example 1:] HTML 751 752 }}} 753 |-------------------------------------------------------- 754 {{{#!td style="border: 0px" 755 {{{ 756 {{{ 757 #!html 758 <h1 style="text-align: right; color: blue"> 759 HTML Test 760 </h1> 761 }}} 762 }}} 763 }}} 764 {{{#!td valign="top" style="border: 0px" 765 316 766 {{{ 317 767 #!html … … 319 769 }}} 320 770 321 Example: 771 }}} 772 |-------------------------------------------------------- 773 {{{#!td align="center" colspan=2 style="border: 0px; font-size: 90%" 774 775 [=#Processors-example-highlight Example 2:] Code Highlighting 776 777 }}} 778 |-------------------------------------------------------- 779 {{{#!td style="border: 0px" 780 {{{ 781 {{{ 782 #!python 783 class Test: 784 785 def __init__(self): 786 print "Hello World" 787 if __name__ == '__main__': 788 Test() 789 }}} 790 }}} 791 }}} 322 792 {{{ 323 #!html 324 <pre class="wiki">{{{ 325 #!python 326 class Test: 327 328 def __init__(self): 329 print "Hello World" 330 if __name__ == '__main__': 331 Test() 332 }}}</pre> 333 }}} 334 335 Display: 793 #!td valign="top" style="border: 0px" 794 336 795 {{{ 337 796 #!python … … 343 802 }}} 344 803 345 Perl: 804 }}} 805 |-------------------------------------------------------- 806 {{{#!td align="center" colspan=2 style="border: 0px; font-size: 90%" 807 808 [=#Processors-example-tables Example 3:] Complex Tables 809 810 }}} 811 |-------------------------------------------------------- 812 {{{#!td style="border: 0px" 813 {{{ 814 {{{#!th rowspan=4 align=justify 815 With the `#td` and `#th` processors, 816 table cells can contain any content: 817 }}} 818 |---------------- 819 {{{#!td 820 - lists 821 - embedded tables 822 - simple multiline content 823 }}} 824 |---------------- 825 {{{#!td 826 As processors can be easily nested, 827 so can be tables: 828 {{{#!th 829 Example: 830 }}} 831 {{{#!td style="background: #eef" 832 || must be at the third level now... || 833 }}} 834 }}} 835 |---------------- 836 {{{#!td 837 Even when you don't have complex markup, 838 this form of table cells can be convenient 839 to write content on multiple lines. 840 }}} 841 }}} 842 }}} 346 843 {{{ 347 #!perl 348 my ($test) = 0; 349 if ($test > 0) { 350 print "hello"; 351 } 844 #!td valign="top" style="border: 0px" 845 846 {{{#!th rowspan=4 align=justify 847 With the `#td` and `#th` processors, 848 table cells can contain any content: 849 }}} 850 |---------------- 851 {{{#!td 852 - lists 853 - embedded tables 854 - simple multiline content 855 }}} 856 |---------------- 857 {{{#!td 858 As processors can be easily nested, 859 so can be tables: 860 {{{#!th 861 Example: 862 }}} 863 {{{#!td style="background: #eef" 864 || must be at the third level now... || 865 }}} 866 }}} 867 |---------------- 868 {{{#!td 869 Even when you don't have complex markup, 870 this form of table cells can be convenient 871 to write content on multiple lines. 872 }}} 873 352 874 }}} 353 875 … … 358 880 359 881 Comments can be added to the plain text. These will not be rendered and will not display in any other format than plain text. 360 {{{ 361 {{{ 362 #!comment 363 Your comment here 364 }}} 365 }}} 366 882 883 ||= Wiki Markup =||= Display =|| 884 {{{#!td 885 {{{ 886 Nothing to 887 {{{ 888 #!comment 889 Your comment for editors here 890 }}} 891 see ;-) 892 }}} 893 }}} 894 {{{#!td 895 Nothing to 896 {{{ 897 #!comment 898 Your comment for editors here 899 }}} 900 see ;-) 901 }}} 367 902 368 903 == Miscellaneous == 369 904 370 Four or more dashes will be replaced by a horizontal line (<HR>) 371 372 Example: 373 {{{ 374 ---- 375 }}} 376 377 Display: 905 An horizontal line can be used to separated different parts of your page: 906 907 ||= Wiki Markup =||= Display =|| 908 {{{#!td 909 {{{ 910 Four or more dashes will be replaced 911 by an horizontal line (<HR>) 912 ---- 913 See? 914 }}} 915 }}} 916 {{{#!td 917 Four or more dashes will be replaced 918 by an horizontal line (<HR>) 378 919 ---- 379 380 381 382 ---- 383 See also: TracLinks, TracGuide, WikiHtml, WikiMacros, WikiProcessors, TracSyntaxColoring. 920 See? 921 }}} 922 |---------------------------------- 923 {{{#!td 924 {{{ 925 "macro" style [[br]] line break 926 }}} 927 }}} 928 {{{#!td 929 "macro" style [[br]] line break 930 }}} 931 |---------------------------------- 932 {{{#!td 933 {{{ 934 !WikiCreole style \\ line\\break 935 }}} 936 }}} 937 {{{#!td 938 !WikiCreole style \\ line\\break 939 }}}