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