Changes between Version 7 and Version 8 of 0.12/WikiFormatting
- Timestamp:
- Jan 25, 2010, 10:18:28 AM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
0.12/WikiFormatting
v7 v8 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 … … 14 14 15 15 The Trac wiki supports the following font styles: 16 {{{ 17 * '''bold''', '''!''' can be bold too''', and '''! ''' 16 ||= Wiki Markup =||= Display =|| 17 {{{#!td 18 {{{ 19 * '''bold''', 20 ''' triple quotes !''' 21 can be bold too if prefixed by ! ''', 22 * ''italic'' 23 * '''''bold italic''''' or ''italic and 24 ''' italic bold ''' '' 25 * __underline__ 26 * {{{monospace}}} or `monospace` 27 (hence `{{{` or {{{`}}} quoting) 28 * ~~strike-through~~ 29 * ^superscript^ 30 * ,,subscript,, 31 }}} 32 }}} 33 {{{#!td 34 * '''bold''', 35 ''' triple quotes !''' 36 can be bold too if prefixed by ! ''', 18 37 * ''italic'' 19 * '''''bold italic''''' 38 * '''''bold italic''''' or ''italic and 39 ''' italic bold ''' '' 20 40 * __underline__ 21 41 * {{{monospace}}} or `monospace` 42 (hence `{{{` or {{{`}}} quoting) 22 43 * ~~strike-through~~ 23 44 * ^superscript^ … … 25 46 }}} 26 47 27 Display:28 {{{29 #!div style="border: 1px solid #ddd"30 * '''bold''', '''!''' can be bold too''', and '''! '''31 * ''italic''32 * '''''bold italic'''''33 * __underline__34 * {{{monospace}}} or `monospace`35 * ~~strike-through~~36 * ^superscript^37 * ,,subscript,,38 }}}39 40 48 Notes: 41 49 * `{{{...}}}` 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. 42 50 * {{{ ! }}} 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. 51 * all the font styles marks have to be used in opening/closing pairs, 52 and they must nest properly 43 53 44 54 == Headings == … … 49 59 The heading might optionally be followed by an explicit id. If not, an implicit but nevertheless readable id will be generated. 50 60 61 ||= Wiki Markup =||= Display =|| 62 {{{#!td 63 {{{ 64 = Heading = 65 == Subheading 66 === About ''this'' === 67 === Explicit id === #using-explicit-id-in-heading 68 == Subheading #sub2 69 }}} 70 }}} 71 {{{#!td 72 {{{ 73 #!div 74 == Subheading 75 === About ''this'' === 76 === Explicit id === #using-explicit-id-in-heading 77 == Subheading #sub2 78 }}} 79 }}} 80 81 == Paragraphs == 82 83 A new text paragraph is created whenever two blocks of text are separated by one or more empty lines. 84 85 A forced line break can also be inserted, using: 86 ||= Wiki Markup =||= Display =|| 87 {{{#!td 88 {{{ 89 Line 1[[BR]]Line 2 90 }}} 91 {{{ 92 Paragraph 93 one 94 95 Paragraph 96 two 97 }}} 98 }}} 99 {{{#!td 100 Line 1[[BR]]Line 2 101 102 Paragraph 103 one 104 105 Paragraph 106 two 107 }}} 108 109 == Lists == 110 111 The wiki supports both ordered/numbered and unordered lists. 112 51 113 Example: 52 {{{ 53 = Heading = 54 == Subheading 55 === About ''this'' === 56 === Explicit id === #using-explicit-id-in-heading 57 == Subheading #sub2 58 }}} 59 60 Display: 61 {{{ 62 #!div style="border: 1px solid #ddd"= Heading = 63 == Subheading 64 === About ''this'' === 65 === Explicit id === #using-explicit-id-in-heading 66 == Subheading #sub2 67 }}} 68 69 == Paragraphs == 70 71 A new text paragraph is created whenever two blocks of text are separated by one or more empty lines. 72 73 A forced line break can also be inserted, using: 74 {{{ 75 Line 1[[BR]]Line 2 76 }}} 77 Display: 78 {{{ 79 #!div style="border: 1px solid #ddd" 80 Line 1[[BR]]Line 2 81 }}} 82 83 == Lists == 84 85 The wiki supports both ordered/numbered and unordered lists. 86 87 Example: 88 {{{ 114 ||= Wiki Markup =||= Display =|| 115 {{{#!td 116 {{{ 117 * Item 1 118 * Item 1.1 119 * Item 1.1.1 120 * Item 1.1.2 121 * Item 1.1.3 122 * Item 1.2 123 * Item 2 124 - items can start at the beginning of a line 125 and they can span multiple lines 126 - be careful though to continue the line 127 with the appropriate indentation, otherwise 128 that will start a new paragraph... 129 130 1. Item 1 131 a. Item 1.a 132 a. Item 1.b 133 i. Item 1.b.i 134 i. Item 1.b.ii 135 1. Item 2 136 And numbered lists can also be restarted 137 with an explicit number: 138 3. Item 3 139 }}} 140 }}} 141 {{{#!td 89 142 * Item 1 90 143 * Item 1.1 … … 94 147 * Item 1.2 95 148 * Item 2 96 97 149 - items can start at the beginning of a line 98 150 and they can span multiple lines … … 107 159 i. Item 1.b.ii 108 160 1. Item 2 109 And numbered lists can also be givenan explicit number:161 And numbered lists can also be restarted with an explicit number: 110 162 3. Item 3 111 163 }}} 112 164 113 Display:114 {{{115 #!div style="border: 1px solid #ddd"116 * Item 1117 * Item 1.1118 * Item 1.1.1119 * Item 1.1.2120 * Item 1.1.3121 * Item 1.2122 * Item 2123 124 - items can start at the beginning of a line125 and they can span multiple lines126 - be careful though to continue the line127 with the appropriate indentation, otherwise128 that will start a new paragraph...129 130 1. Item 1131 a. Item 1.a132 a. Item 1.b133 i. Item 1.b.i134 i. Item 1.b.ii135 1. Item 2136 And numbered lists can also be given an explicit number:137 3. Item 3138 }}}139 140 Note that there must be one or more spaces preceding the list item markers, otherwise the list will be treated as a normal paragraph.141 142 165 143 166 == Definition Lists == 144 167 145 146 168 The wiki also supports definition lists. 147 169 148 Example: 149 {{{ 170 ||= Wiki Markup =||= Display =|| 171 {{{#!td 172 {{{ 173 llama:: 174 some kind of mammal, with hair 175 ppython:: 176 some kind of reptile, without hair 177 (can you spot the typo?) 178 }}} 179 }}} 180 {{{#!td 150 181 llama:: 151 182 some kind of mammal, with hair … … 155 186 }}} 156 187 157 Display:158 {{{159 #!div style="border: 1px solid #ddd"160 llama::161 some kind of mammal, with hair162 ppython::163 some kind of reptile, without hair164 (can you spot the typo?)165 }}}166 167 188 Note that you need a space in front of the defined term. 168 189 … … 172 193 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. 173 194 174 Example: 175 {{{ 176 {{{ 195 ||= Wiki Markup =||= Display =|| 196 {{{#!td 197 {{{ 198 {{{ 177 199 def HelloWorld(): 178 print "Hello World"179 }}}180 }}}181 182 Display: 183 {{{184 #!div style="border: 1px solid #ddd" 185 {{{ 186 def HelloWorld():187 print "Hello World" 188 }}} 189 }}} 200 print '''Hello World''' 201 }}} 202 }}} 203 }}} 204 {{{#!td 205 {{{ 206 def HelloWorld(): 207 print '''Hello World''' 208 }}} 209 }}} 210 211 Note that this kind of block is also used for selecting lines that should be processed through WikiProcessors. 190 212 191 213 == Blockquotes == … … 193 215 In order to mark a paragraph as blockquote, indent that paragraph with two spaces. 194 216 195 Example: 196 {{{ 217 ||= Wiki Markup =||= Display =|| 218 {{{#!td 219 {{{ 220 Paragraph 197 221 This text is a quote from someone else. 198 222 }}} 199 200 Display: 201 {{{ 202 #!div style="border: 1px solid #ddd" 223 }}} 224 {{{#!td 225 Paragraph 203 226 This text is a quote from someone else. 204 227 }}} … … 208 231 To delineate a citation in an ongoing discussion thread, such as the ticket comment area, e-mail-like citation marks (">", ">>", etc.) may be used. 209 232 210 Example: 211 {{{ 233 ||= Wiki Markup =||= Display =|| 234 {{{#!td 235 {{{ 236 >> Someone's original text 237 > Someone else's reply text 238 My reply text 239 }}} 240 }}} 241 {{{#!td 212 242 >> Someone's original text 213 243 > Someone else's reply text … … 215 245 }}} 216 246 217 Display:218 {{{219 #!div style="border: 1px solid #ddd"220 >> Someone's original text221 > Someone else's reply text222 My reply text223 }}}224 225 247 ''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.'' 226 248 227 249 == Tables == 228 250 === Simple Tables === 229 251 Simple tables can be created like this: 230 {{{ 252 ||= Wiki Markup =||= Display =|| 253 {{{#!td 254 {{{ 255 ||Cell 1||Cell 2||Cell 3|| 256 ||Cell 4||Cell 5||Cell 6|| 257 }}} 258 }}} 259 {{{#!td 231 260 ||Cell 1||Cell 2||Cell 3|| 232 261 ||Cell 4||Cell 5||Cell 6|| 233 262 }}} 234 263 235 Display:236 {{{237 #!div style="border: 1px solid #ddd"238 ||Cell 1||Cell 2||Cell 3||239 ||Cell 4||Cell 5||Cell 6||240 }}}241 242 264 Cell headings can be specified by wrapping the content in a pair of '=' characters. 243 265 Note that the '=' characters have to stick to the cell separators, like this: 244 {{{ 266 ||= Wiki Markup =||= Display =|| 267 {{{#!td 268 {{{ 269 || ||= stable =||= latest =|| 270 ||= 0.10 =|| 0.10.5 || 0.10.6dev|| 271 ||= 0.11 =|| 0.11.6 || 0.11.7dev|| 272 }}} 273 }}} 274 {{{#!td 245 275 || ||= stable =||= latest =|| 246 276 ||= 0.10 =|| 0.10.5 || 0.10.6dev|| … … 248 278 }}} 249 279 250 Display:251 {{{252 #!div style="border: 1px solid #ddd"253 || ||= stable =||= latest =||254 ||= 0.10 =|| 0.10.5 || 0.10.6dev||255 ||= 0.11 =|| 0.11.6 || 0.11.7dev||256 }}}257 258 280 Finally, specifying an empty cell means that the next non empty cell will span the empty cells. For example: 259 {{{ 281 ||= Wiki Markup =||= Display =|| 282 {{{#!td 283 {{{ 284 || 1 || 2 || 3 || 285 |||| 1-2 || 3 || 286 || 1 |||| 2-3 || 287 |||||| 1-2-3 || 288 }}} 289 }}} 290 {{{#!td 260 291 || 1 || 2 || 3 || 261 292 |||| 1-2 || 3 || … … 264 295 }}} 265 296 266 Display:267 {{{268 #!div style="border: 1px solid #ddd"269 || 1 || 2 || 3 ||270 |||| 1-2 || 3 ||271 || 1 |||| 2-3 ||272 |||||| 1-2-3 ||273 }}}274 275 297 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: 276 {{{ 298 ||= Wiki Markup =||= Display =|| 299 {{{#!td 300 {{{ 301 ||=Text =||= Numbers =|| 302 ||left align || 1.0|| 303 || center || 4.5|| 304 || right align|| 4.5|| 305 || default alignment || 2.5|| 306 ||default|| 2.5|| 307 || default || 2.5|| 308 || default || 2.5|| 309 }}} 310 }}} 311 {{{#!td 277 312 ||=Text =||= Numbers =|| 278 ||abc || 1.0|| 279 || default || 2.5|| 280 || def|| 4.5|| 281 }}} 282 283 Display: 284 {{{ 285 #!div style="border: 1px solid #ddd" 286 ||=Text =||= Numbers =|| 287 ||abc || 1.0|| 288 || default || 2.5|| 289 || def|| 4.5|| 290 }}} 291 292 Note that more complex tables can be created using 293 [wiki:WikiRestructuredText#BiggerReSTExample reStructuredText]. 294 313 ||left align || 1.0|| 314 || center || 4.5|| 315 || right align|| 4.5|| 316 || default alignment || 2.5|| 317 ||default|| 2.5|| 318 || default || 2.5|| 319 || default || 2.5|| 320 }}} 321 322 Note that more complex tables can be created using WikiProcessors#Tables. 295 323 296 324 == Links == … … 298 326 Hyperlinks are automatically created for WikiPageNames and URLs. !WikiPageLinks can be disabled by prepending an exclamation mark "!" character, such as {{{!WikiPageLink}}}. 299 327 300 Example: 301 {{{ 302 TitleIndex, http://www.edgewall.com/, !NotAlink 303 }}} 304 305 Display: 306 {{{ 307 #!div style="border: 1px solid #ddd" 308 TitleIndex, http://www.edgewall.com/, !NotAlink 328 ||= Wiki Markup =||= Display =|| 329 {{{#!td 330 {{{ 331 TitleIndex, http://www.edgewall.com/, !NotAlink 332 }}} 333 }}} 334 {{{#!td 335 TitleIndex, http://www.edgewall.com/, !NotAlink 309 336 }}} 310 337 311 338 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. 312 339 313 Example: 314 {{{ 340 ||= Wiki Markup =||= Display =|| 341 {{{#!td 342 {{{ 343 * [http://www.edgewall.com/ Edgewall Software] 344 * [wiki:TitleIndex Title Index] 345 * [wiki:ISO9000] 346 }}} 347 }}} 348 {{{#!td 315 349 * [http://www.edgewall.com/ Edgewall Software] 316 350 * [wiki:TitleIndex Title Index] … … 318 352 }}} 319 353 320 Display:321 {{{322 #!div style="border: 1px solid #ddd"323 * [http://www.edgewall.com/ Edgewall Software]324 * [wiki:TitleIndex Title Index]325 * [wiki:ISO9000]326 }}}327 328 354 == Trac Links == 329 355 330 356 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: 331 {{{ 332 * Tickets: #1 or ticket:1 333 * Reports: {1} or report:1 334 * Changesets: r1, [1] or changeset:1 335 * ... 336 }}} 337 338 Display: 339 {{{ 340 #!div style="border: 1px solid #ddd" 357 358 ||= Wiki Markup =||= Display =|| 359 {{{#!td 360 {{{ 361 * Tickets: #1 or ticket:1 362 * Reports: {1} or report:1 363 * Changesets: r1, [1] or changeset:1 364 * ... 365 }}} 366 }}} 367 {{{#!td 341 368 * Tickets: #1 or ticket:1 342 369 * Reports: {1} or report:1 … … 352 379 You may avoid making hyperlinks out of TracLinks by preceding an expression with a single "!" (exclamation mark). 353 380 354 Example: 355 {{{ 356 !NoHyperLink 357 !#42 is not a link 358 }}} 359 360 Display: 361 {{{ 362 #!div style="border: 1px solid #ddd" 381 ||= Wiki Markup =||= Display =|| 382 {{{#!td 383 {{{ 384 !NoHyperLink 385 !#42 is not a link 386 }}} 387 }}} 388 {{{#!td 363 389 !NoHyperLink 364 390 !#42 is not a link … … 377 403 * `[[Image(source:/trunk/trac/htdocs/trac_logo_mini.png)]]` (a file in repository) 378 404 379 Example display: [[Image(htdocs:../common/trac_logo_mini.png)]] 405 ||= Wiki Markup =||= Display =|| 406 {{{#!td 407 {{{ 408 [[Image(htdocs:../common/trac_logo_mini.png)]] 409 }}} 410 }}} 411 {{{#!td 412 [[Image(htdocs:../common/trac_logo_mini.png)]] 413 }}} 380 414 381 415 See WikiMacros for further documentation on the `[[Image()]]` macro. … … 386 420 Macros are ''custom functions'' to insert dynamic content in a page. 387 421 388 Example: 389 {{{ 390 [[RecentChanges(Trac,3)]] 391 }}} 392 393 Display: 394 {{{ 395 #!div style="border: 1px solid #ddd" 396 [[RecentChanges(Trac,3)]] 422 ||= Wiki Markup =||= Display =|| 423 {{{#!td 424 {{{ 425 [[RecentChanges(Trac,3)]] 426 }}} 427 }}} 428 {{{#!td style="padding-left: 2em" 429 [[RecentChanges(Trac,3)]] 397 430 }}} 398 431 … … 401 434 The detailed help for a specific macro can also be obtained more directly by appending a "?" to the macro name. 402 435 403 Example: 404 {{{ 405 [[MacroList?]] 406 }}} 407 408 Display: 409 {{{ 410 #!div style="border: 1px solid #ddd" 411 [[MacroList?]] 436 ||= Wiki Markup =||= Display =|| 437 {{{#!td 438 {{{ 439 [[MacroList?]] 440 }}} 441 }}} 442 {{{#!td style="padding-left: 2em" 443 [[MacroList?]] 412 444 }}} 413 445 … … 418 450 [wiki:WikiRestructuredText reStructuredText] or [wiki:WikiHtml HTML]. 419 451 452 ||= Wiki Markup =||= Display =|| 453 {{{#!td 454 420 455 Example 1: 421 {{{ 422 #!html 423 <pre class="wiki">{{{ 424 #!html 425 <h1 style="text-align: right; color: blue">HTML Test</h1> 426 }}}</pre> 427 }}} 428 429 Display: 430 {{{ 431 #!div style="border: 1px solid #ddd" 456 {{{ 457 {{{ 458 #!html 459 <h1 style="text-align: right; color: blue">HTML Test</h1> 460 }}} 461 }}} 462 }}} 463 {{{#!td valign="top" 464 465 Example 1: 432 466 {{{ 433 467 #!html 434 468 <h1 style="text-align: right; color: blue">HTML Test</h1> 435 469 }}} 436 }}} 437 438 Example: 439 {{{ 440 #!html 441 <pre class="wiki">{{{ 442 #!python 443 class Test: 444 445 def __init__(self): 446 print "Hello World" 447 if __name__ == '__main__': 448 Test() 449 }}}</pre> 450 }}} 451 452 Display: 453 {{{ 454 #!div style="border: 1px solid #ddd" 470 471 }}} 472 |-------------------------------------------------------- 473 {{{ 474 #!td 475 Example 2: 476 {{{ 477 {{{ 478 #!python 479 class Test: 480 481 def __init__(self): 482 print "Hello World" 483 if __name__ == '__main__': 484 Test() 485 }}} 486 }}} 487 }}} 488 {{{ 489 #!td valign="top" 490 Example 2: 455 491 {{{ 456 492 #!python … … 461 497 Test() 462 498 }}} 463 }}} 464 465 Perl: 499 500 }}} 501 |-------------------------------------------------------- 502 {{{ 503 #!td 504 Example 3: 505 {{{ 506 {{{ 507 #!perl 508 my ($test) = 0; 509 if ($test > 0) { 510 print "hello"; 511 } 512 }}} 513 }}} 514 515 }}} 516 {{{ 517 #!td valign="top" 518 Example 3: 466 519 {{{ 467 520 #!perl … … 472 525 }}} 473 526 527 }}} 528 529 474 530 See WikiProcessors for more information. 475 531 … … 478 534 479 535 Comments can be added to the plain text. These will not be rendered and will not display in any other format than plain text. 480 {{{ 481 {{{ 482 #!comment 483 Your comment here 484 }}} 485 }}} 486 536 537 ||= Wiki Markup =||= Display =|| 538 {{{#!td 539 {{{ 540 Nothing to 541 {{{ 542 #!comment 543 Your comment for editors here 544 }}} 545 see ;-) 546 }}} 547 }}} 548 {{{#!td 549 Nothing to 550 {{{ 551 #!comment 552 Your comment for editors here 553 }}} 554 see ;-) 555 }}} 487 556 488 557 == Miscellaneous == 489 558 490 Four or more dashes will be replaced by a horizontal line (<HR>) 491 492 Example: 493 {{{ 494 ---- 495 }}} 496 497 Display: 498 {{{ 499 #!div style="border: 1px solid #ddd" 559 An horizontal line can be used to separated different parts of your page: 560 561 ||= Wiki Markup =||= Display =|| 562 {{{#!td 563 {{{ 564 Four or more dashes will be replaced 565 by a horizontal line (<HR>) 566 ---- 567 See? 568 }}} 569 }}} 570 {{{#!td 571 Four or more dashes will be replaced 572 by a horizontal line (<HR>) 500 573 ---- 574 See? 501 575 }}} 502 576