Changes between Version 1 and Version 2 of WikiFormatting
- Timestamp:
- Feb 24, 2010 5:37:18 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WikiFormatting
v1 v2 5 5 6 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://moinmo in.wikiwikiweb.de/ MoinMoin].7 especially [http://moinmo.in/ MoinMoin] and [trac:WikiCreole]. 8 8 9 9 … … 11 11 12 12 13 [[PageOutline(2,Markup Categories,inline)]] 14 15 13 16 == Font Styles == 14 17 15 18 The Trac wiki supports the following font styles: 16 {{{ 17 * '''bold''', '''!''' can be bold too''', and '''! ''' 19 ||= Wiki Markup =||= Display =|| 20 {{{#!td 21 {{{ 22 * '''bold''', 23 ''' triple quotes !''' 24 can be bold too if prefixed by ! ''', 25 * ''italic'' 26 * '''''bold italic''''' or ''italic and 27 ''' italic bold ''' '' 28 * __underline__ 29 * {{{monospace}}} or `monospace` 30 (hence `{{{` or {{{`}}} quoting) 31 * ~~strike-through~~ 32 * ^superscript^ 33 * ,,subscript,, 34 }}} 35 }}} 36 {{{#!td 37 * '''bold''', 38 ''' triple quotes !''' 39 can be bold too if prefixed by ! ''', 18 40 * ''italic'' 19 * '''''bold italic''''' 41 * '''''bold italic''''' or ''italic and 42 ''' italic bold ''' '' 20 43 * __underline__ 21 44 * {{{monospace}}} or `monospace` 45 (hence `{{{` or {{{`}}} quoting) 22 46 * ~~strike-through~~ 23 47 * ^superscript^ … … 25 49 }}} 26 50 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,,36 37 51 Notes: 38 52 * `{{{...}}}` 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 53 * {{{ ! }}} 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. 54 * all the font styles marks have to be used in opening/closing pairs, 55 and they must nest properly 40 56 41 57 == Headings == 42 58 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 space45 followed by the same number of ''='' characters .59 You can create heading by starting a line with one up to six ''equal'' characters ("=") 60 followed by a single space and the headline text. The headline text can be 61 followed by the same number of ''='' characters, but this is no longer mandatory. 46 62 The heading might optionally be followed by an explicit id. If not, an implicit but nevertheless readable id will be generated. 47 63 64 ||= Wiki Markup =||= Display =|| 65 {{{#!td 66 {{{ 67 = Heading = 68 == Subheading 69 === About ''this'' === 70 === Explicit id === #using-explicit-id-in-heading 71 == Subheading #sub2 72 }}} 73 }}} 74 {{{#!td style="padding: 1em;" 75 {{{ 76 #!div 77 == Subheading 78 === About ''this'' === 79 === Explicit id === #using-explicit-id-in-heading 80 == Subheading #sub2 81 }}} 82 }}} 83 84 == Paragraphs == 85 86 A new text paragraph is created whenever two blocks of text are separated by one or more empty lines. 87 88 A forced line break can also be inserted, using: 89 ||= Wiki Markup =||= Display =|| 90 {{{#!td 91 {{{ 92 Line 1[[BR]]Line 2 93 }}} 94 {{{ 95 Paragraph 96 one 97 98 Paragraph 99 two 100 }}} 101 }}} 102 {{{#!td 103 Line 1[[BR]]Line 2 104 105 Paragraph 106 one 107 108 Paragraph 109 two 110 }}} 111 112 == Lists == 113 114 The wiki supports both ordered/numbered and unordered lists. 115 48 116 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 {{{ 117 ||= Wiki Markup =||= Display =|| 118 {{{#!td 119 {{{ 120 * Item 1 121 * Item 1.1 122 * Item 1.1.1 123 * Item 1.1.2 124 * Item 1.1.3 125 * Item 1.2 126 * Item 2 127 - items can start at the beginning of a line 128 and they can span multiple lines 129 - be careful though to continue the line 130 with the appropriate indentation, otherwise 131 that will start a new paragraph... 132 133 1. Item 1 134 a. Item 1.a 135 a. Item 1.b 136 i. Item 1.b.i 137 i. Item 1.b.ii 138 1. Item 2 139 And numbered lists can also be restarted 140 with an explicit number: 141 3. Item 3 142 }}} 143 }}} 144 {{{#!td 81 145 * Item 1 82 146 * Item 1.1 … … 86 150 * Item 1.2 87 151 * Item 2 152 - items can start at the beginning of a line 153 and they can span multiple lines 154 - be careful though to continue the line 155 with the appropriate indentation, otherwise 156 that will start a new paragraph... 88 157 89 158 1. Item 1 … … 93 162 i. Item 1.b.ii 94 163 1. Item 2 95 And numbered lists can also be givenan explicit number:164 And numbered lists can also be restarted with an explicit number: 96 165 3. Item 3 97 166 }}} 98 167 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 168 120 169 == Definition Lists == 121 170 122 123 171 The wiki also supports definition lists. 124 172 125 Example: 126 {{{ 173 ||= Wiki Markup =||= Display =|| 174 {{{#!td 175 {{{ 176 llama:: 177 some kind of mammal, with hair 178 ppython:: 179 some kind of reptile, without hair 180 (can you spot the typo?) 181 }}} 182 }}} 183 {{{#!td 127 184 llama:: 128 185 some kind of mammal, with hair … … 132 189 }}} 133 190 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 191 Note that you need a space in front of the defined term. 142 192 … … 146 196 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 197 148 Example: 198 ||= Wiki Markup =||= Display =|| 199 {{{#!td 200 {{{ 201 {{{ 202 def HelloWorld(): 203 print '''Hello World''' 204 }}} 205 }}} 206 }}} 207 {{{#!td 208 {{{ 209 def HelloWorld(): 210 print '''Hello World''' 211 }}} 212 }}} 213 214 Note that this kind of block is also used for selecting lines that should be processed through WikiProcessors. 215 216 == Blockquotes == 217 218 In order to mark a paragraph as blockquote, indent that paragraph with two spaces. 219 220 ||= Wiki Markup =||= Display =|| 221 {{{#!td 149 222 {{{ 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 {{{ 223 Paragraph 169 224 This text is a quote from someone else. 170 225 }}} 171 172 Display: 226 }}} 227 {{{#!td 228 Paragraph 173 229 This text is a quote from someone else. 230 }}} 174 231 175 232 == Discussion Citations == … … 177 234 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 235 179 Example: 180 {{{ 236 ||= Wiki Markup =||= Display =|| 237 {{{#!td 238 {{{ 239 >> Someone's original text 240 > Someone else's reply text 241 > - which can be any kind of Wiki markup 242 My reply text 243 }}} 244 }}} 245 {{{#!td 181 246 >> Someone's original text 182 247 > Someone else's reply text 248 > - which can be any kind of Wiki markup 183 249 My reply text 184 250 }}} 185 251 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 252 193 253 == Tables == 194 254 === Simple Tables === 195 255 Simple tables can be created like this: 196 {{{ 256 ||= Wiki Markup =||= Display =|| 257 {{{#!td 258 {{{ 259 ||Cell 1||Cell 2||Cell 3|| 260 ||Cell 4||Cell 5||Cell 6|| 261 }}} 262 }}} 263 {{{#!td style="padding: 2em;" 197 264 ||Cell 1||Cell 2||Cell 3|| 198 265 ||Cell 4||Cell 5||Cell 6|| 199 266 }}} 200 267 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]. 268 Cell headings can be specified by wrapping the content in a pair of '=' characters. 269 Note that the '=' characters have to stick to the cell separators, like this: 270 ||= Wiki Markup =||= Display =|| 271 {{{#!td 272 {{{ 273 || ||= stable =||= latest =|| 274 ||= 0.10 =|| 0.10.5 || 0.10.6dev|| 275 ||= 0.11 =|| 0.11.6 || 0.11.7dev|| 276 }}} 277 }}} 278 {{{#!td style="padding: 2em;" 279 || ||= stable =||= latest =|| 280 ||= 0.10 =|| 0.10.5 || 0.10.6dev|| 281 ||= 0.11 =|| 0.11.6 || 0.11.7dev|| 282 }}} 283 284 Finally, specifying an empty cell means that the next non empty cell will span the empty cells. For example: 285 ||= Wiki Markup =||= Display =|| 286 {{{#!td 287 {{{ 288 || 1 || 2 || 3 || 289 |||| 1-2 || 3 || 290 || 1 |||| 2-3 || 291 |||||| 1-2-3 || 292 }}} 293 }}} 294 {{{#!td style="padding: 2em;" 295 || 1 || 2 || 3 || 296 |||| 1-2 || 3 || 297 || 1 |||| 2-3 || 298 |||||| 1-2-3 || 299 }}} 300 301 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: 302 ||= Wiki Markup =||= Display =|| 303 {{{#!td 304 {{{ 305 ||=Text =||= Numbers =|| 306 ||left align || 1.0|| 307 || center || 4.5|| 308 || right align|| 4.5|| 309 || default alignment || 2.5|| 310 ||default|| 2.5|| 311 || default || 2.5|| 312 || default || 2.5|| 313 }}} 314 }}} 315 {{{#!td style="padding: 2em;" 316 ||=Text =||= Numbers =|| 317 ||left align || 1.0|| 318 || center || 4.5|| 319 || right align|| 4.5|| 320 || default alignment || 2.5|| 321 ||default|| 2.5|| 322 || default || 2.5|| 323 || default || 2.5|| 324 }}} 325 326 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. 327 328 ||= Wiki Markup =|| 329 {{{#!td 330 {{{ 331 || this is column 1 [http://trac.edgewall.org/newticket new ticket] || \ 332 || this is column 2 [http://trac.edgewall.org/roadmap the road ahead] || \ 333 || that's column 3 and last one || 334 }}} 335 }}} 336 |------------- 337 ||= Display =|| 338 {{{#!td style="padding: 2em;" 339 || this is column 1 [http://trac.edgewall.org/newticket new ticket] || \ 340 || this is column 2 [http://trac.edgewall.org/roadmap the road ahead] || \ 341 || that's column 3 and last one || 342 }}} 343 344 === Complex Tables === 345 346 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 347 208 348 … … 211 351 Hyperlinks are automatically created for WikiPageNames and URLs. !WikiPageLinks can be disabled by prepending an exclamation mark "!" character, such as {{{!WikiPageLink}}}. 212 352 213 Example: 214 {{{ 215 TitleIndex, http://www.edgewall.com/, !NotAlink 216 }}} 217 218 Display: 219 TitleIndex, http://www.edgewall.com/, !NotAlink 353 ||= Wiki Markup =||= Display =|| 354 {{{#!td 355 {{{ 356 TitleIndex, http://www.edgewall.com/, !NotAlink 357 }}} 358 }}} 359 {{{#!td 360 TitleIndex, http://www.edgewall.com/, !NotAlink 361 }}} 220 362 221 363 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 364 223 Example: 224 {{{ 365 ||= Wiki Markup =||= Display =|| 366 {{{#!td 367 {{{ 368 * [http://www.edgewall.com/ Edgewall Software] 369 * [wiki:TitleIndex Title Index] 370 * [wiki:ISO9000] 371 }}} 372 }}} 373 {{{#!td 225 374 * [http://www.edgewall.com/ Edgewall Software] 226 375 * [wiki:TitleIndex Title Index] … … 228 377 }}} 229 378 230 Display:231 * [http://www.edgewall.com/ Edgewall Software]232 * [wiki:TitleIndex Title Index]233 * [wiki:ISO9000]234 235 379 == Trac Links == 236 380 237 381 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: 382 383 ||= Wiki Markup =||= Display =|| 384 {{{#!td 385 {{{ 386 * Tickets: #1 or ticket:1 387 * Reports: {1} or report:1 388 * Changesets: r1, [1] or changeset:1 389 * ... 390 }}} 391 }}} 392 {{{#!td 246 393 * Tickets: #1 or ticket:1 247 394 * Reports: {1} or report:1 248 395 * Changesets: r1, [1] or changeset:1 249 396 * ... 397 }}} 250 398 251 399 There are many more flavors of Trac links, see TracLinks for more in-depth information. … … 256 404 You may avoid making hyperlinks out of TracLinks by preceding an expression with a single "!" (exclamation mark). 257 405 258 Example: 259 {{{ 406 ||= Wiki Markup =||= Display =|| 407 {{{#!td 408 {{{ 409 !NoHyperLink 410 !#42 is not a link 411 }}} 412 }}} 413 {{{#!td 260 414 !NoHyperLink 261 415 !#42 is not a link 262 416 }}} 263 264 Display:265 !NoHyperLink266 !#42 is not a link267 268 417 269 418 == Images == … … 279 428 * `[[Image(source:/trunk/trac/htdocs/trac_logo_mini.png)]]` (a file in repository) 280 429 281 Example display: [[Image(htdocs:../common/trac_logo_mini.png)]] 282 430 ||= Wiki Markup =||= Display =|| 431 {{{#!td 432 {{{ 433 [[Image(htdocs:../common/trac_logo_mini.png)]] 434 }}} 435 }}} 436 {{{#!td 437 [[Image(htdocs:../common/trac_logo_mini.png)]] 438 }}} 283 439 284 440 See WikiMacros for further documentation on the `[[Image()]]` macro. … … 289 445 Macros are ''custom functions'' to insert dynamic content in a page. 290 446 291 Example: 292 {{{ 293 [[RecentChanges(Trac,3)]] 294 }}} 295 296 Display: 297 [[RecentChanges(Trac,3)]] 447 ||= Wiki Markup =||= Display =|| 448 {{{#!td 449 {{{ 450 [[RecentChanges(Trac,3)]] 451 }}} 452 }}} 453 {{{#!td style="padding-left: 2em" 454 [[RecentChanges(Trac,3)]] 455 }}} 298 456 299 457 See WikiMacros for more information, and a list of installed macros. 458 459 The detailed help for a specific macro can also be obtained more directly by appending a "?" to the macro name. 460 461 ||= Wiki Markup =||= Display =|| 462 {{{#!td 463 {{{ 464 [[MacroList?]] 465 }}} 466 }}} 467 {{{#!td style="padding-left: 2em" 468 [[MacroList?]] 469 }}} 300 470 301 471 … … 305 475 [wiki:WikiRestructuredText reStructuredText] or [wiki:WikiHtml HTML]. 306 476 307 Example 1: 308 {{{ 309 #!html 310 <pre class="wiki">{{{ 311 #!html 312 <h1 style="text-align: right; color: blue">HTML Test</h1> 313 }}}</pre> 314 }}} 315 316 Display: 477 ||= Wiki Markup =||= Display =|| 478 |-------------------------------------------------------- 479 {{{#!td align="center" colspan=2 style="border: 0px; font-size: 90%" 480 481 [=#Processors-example-html Example 1:] HTML 482 483 }}} 484 |-------------------------------------------------------- 485 {{{#!td style="border: 0px" 486 {{{ 487 {{{ 488 #!html 489 <h1 style="text-align: right; color: blue"> 490 HTML Test 491 </h1> 492 }}} 493 }}} 494 }}} 495 {{{#!td valign="top" style="border: 0px" 496 317 497 {{{ 318 498 #!html … … 320 500 }}} 321 501 322 Example: 502 }}} 503 |-------------------------------------------------------- 504 {{{#!td align="center" colspan=2 style="border: 0px; font-size: 90%" 505 506 [=#Processors-example-highlight Example 2:] Code Highlighting 507 508 }}} 509 |-------------------------------------------------------- 510 {{{#!td style="border: 0px" 511 {{{ 512 {{{ 513 #!python 514 class Test: 515 516 def __init__(self): 517 print "Hello World" 518 if __name__ == '__main__': 519 Test() 520 }}} 521 }}} 522 }}} 323 523 {{{ 324 #!html 325 <pre class="wiki">{{{ 326 #!python 327 class Test: 328 329 def __init__(self): 330 print "Hello World" 331 if __name__ == '__main__': 332 Test() 333 }}}</pre> 334 }}} 335 336 Display: 524 #!td valign="top" style="border: 0px" 525 337 526 {{{ 338 527 #!python … … 344 533 }}} 345 534 346 Perl: 535 }}} 536 |-------------------------------------------------------- 537 {{{#!td align="center" colspan=2 style="border: 0px; font-size: 90%" 538 539 [=#Processors-example-tables Example 3:] Complex Tables 540 541 }}} 542 |-------------------------------------------------------- 543 {{{#!td style="border: 0px" 544 {{{ 545 {{{#!th rowspan=4 align=justify 546 With the `#td` and `#th` processors, 547 table cells can contain any content: 548 }}} 549 |---------------- 550 {{{#!td 551 - lists 552 - embedded tables 553 - simple multiline content 554 }}} 555 |---------------- 556 {{{#!td 557 As processors can be easily nested, 558 so can be tables: 559 {{{#!th 560 Example: 561 }}} 562 {{{#!td style="background: #eef" 563 || must be at the third level now... || 564 }}} 565 }}} 566 |---------------- 567 {{{#!td 568 Even when you don't have complex markup, 569 this form of table cells can be convenient 570 to write content on multiple lines. 571 }}} 572 }}} 573 }}} 347 574 {{{ 348 #!perl 349 my ($test) = 0; 350 if ($test > 0) { 351 print "hello"; 352 } 575 #!td valign="top" style="border: 0px" 576 577 {{{#!th rowspan=4 align=justify 578 With the `#td` and `#th` processors, 579 table cells can contain any content: 580 }}} 581 |---------------- 582 {{{#!td 583 - lists 584 - embedded tables 585 - simple multiline content 586 }}} 587 |---------------- 588 {{{#!td 589 As processors can be easily nested, 590 so can be tables: 591 {{{#!th 592 Example: 593 }}} 594 {{{#!td style="background: #eef" 595 || must be at the third level now... || 596 }}} 597 }}} 598 |---------------- 599 {{{#!td 600 Even when you don't have complex markup, 601 this form of table cells can be convenient 602 to write content on multiple lines. 603 }}} 604 353 605 }}} 354 606 … … 359 611 360 612 Comments can be added to the plain text. These will not be rendered and will not display in any other format than plain text. 361 {{{ 362 {{{ 363 #!comment 364 Your comment here 365 }}} 366 }}} 367 613 614 ||= Wiki Markup =||= Display =|| 615 {{{#!td 616 {{{ 617 Nothing to 618 {{{ 619 #!comment 620 Your comment for editors here 621 }}} 622 see ;-) 623 }}} 624 }}} 625 {{{#!td 626 Nothing to 627 {{{ 628 #!comment 629 Your comment for editors here 630 }}} 631 see ;-) 632 }}} 368 633 369 634 == Miscellaneous == 370 635 371 Four or more dashes will be replaced by a horizontal line (<HR>) 372 373 Example: 374 {{{ 375 ---- 376 }}} 377 378 Display: 636 An horizontal line can be used to separated different parts of your page: 637 638 ||= Wiki Markup =||= Display =|| 639 {{{#!td 640 {{{ 641 Four or more dashes will be replaced 642 by a horizontal line (<HR>) 643 ---- 644 See? 645 }}} 646 }}} 647 {{{#!td 648 Four or more dashes will be replaced 649 by a horizontal line (<HR>) 379 650 ---- 380 651 See? 652 }}} 381 653 382 654