Changes between Version 1 and Version 2 of WikiFormatting
- Timestamp:
- Mar 7, 2018, 4:17:24 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WikiFormatting
v1 v2 1 = WikiFormatting = 1 = WikiFormatting 2 2 3 [[TracGuideToc]] 3 4 4 5 Wiki markup is a core feature in Trac, tightly integrating all the other parts of Trac into a flexible and powerful whole. 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/ MoinMoin] and [trac:WikiCreole]. 8 7 Trac has a built-in small and powerful wiki rendering engine. This wiki engine implements a growing subset of the commands from other popular Wikis, especially [http://moinmo.in/ MoinMoin] and [trac:WikiCreole]. 9 8 10 9 This page will give you an in-depth explanation of the wiki markup available anywhere WikiFormatting is allowed. 11 10 12 The ''Cheat sheet'' below gives you a quickoverview for the most common syntax, each link in the ''Category'' column will lead you to the more detailed explanation later in this page.11 The sections below provide an overview for the most common syntax, each link in the ''Category'' column will lead you to the more detailed explanation later in this page. 13 12 14 13 A few other wiki pages present the advanced features of the Trac wiki markup in more depth: 15 - TracLinks covers all the possible ways to refer precisely to any Trac resource or parts thereof ,16 - WikiPageNames talks about the various names a wiki page can take, CamelCase or not17 - WikiMacros lists the macros available for generating dynamic content ,18 - WikiProcessors and WikiHtml details how parts of the wiki text can be processed in special ways 19 20 21 == C heat sheet ==14 - TracLinks covers all the possible ways to refer precisely to any Trac resource or parts thereof. 15 - WikiPageNames covers the various names a wiki page can take, whether in CamelCase or not. 16 - WikiMacros lists the macros available for generating dynamic content. 17 - WikiProcessors and WikiHtml details how parts of the wiki text can be processed in special ways. 18 - [trac:wiki:TracDev/Proposals/AdvancedWikiOperations AdvancedWikiOperations] provides some operations in uncommon or administrative scenarios. 19 20 == Common wiki markup 22 21 23 22 ||= '''Category''' =||= '''Wiki Markup''' =||= '''Display''' =|| … … 28 27 || `'''bold'''`, `''italic''`, `'''''Wikipedia style'''''` || \ 29 28 || '''bold''', ''italic'', '''''Wikipedia style''''' || 30 || {{{`monospaced and ''nowiki''`}}} || \31 || `monospaced and nowiki` ||29 || {{{`monospaced (''other markup ignored'')`}}} || \ 30 || `monospaced (''other markup ignored'')` || 32 31 || `**bold**`, `//italic//`, `**//!WikiCreole style//**` || \ 33 32 || **bold**, //italic//, **//!WikiCreole style//** || … … 36 35 {{{#!td 37 36 {{{ 38 == Level 2 ==37 == Level 2 39 38 === Level 3 ^([#hn note])^ 40 39 }}} … … 64 63 {{{#!td 65 64 {{{ 66 * bullet slist67 on multiple paragraphs65 * bullet list 66 on multiple lines 68 67 1. nested list 69 68 a. different numbering … … 72 71 }}} 73 72 {{{#!td 74 * bullet slist75 on multiple paragraphs73 * bullet list 74 on multiple lines 76 75 1. nested list 77 76 a. different numbering … … 85 84 {{{ 86 85 term:: definition on 87 multiple paragraphs86 multiple lines 88 87 }}} 89 88 }}} 90 89 {{{#!td 91 90 term:: definition on 92 multiple paragraphs91 multiple lines 93 92 }}} 94 93 |----------------------------------------------------------- … … 175 174 || see [#point1 (1)] || 176 175 |----------------------------------------------------------- 177 {{{#!th rowspan= 2178 [#Escaping LinksandWikiPageNamesEscaping Markup]176 {{{#!th rowspan=3 177 [#Escaping Escaping Markup] 179 178 }}} 180 179 || `!'' doubled quotes` ||\ … … 182 181 || `!wiki:WikiFormatting`, `!WikiFormatting` ||\ 183 182 || !wiki:WikiFormatting, !WikiFormatting || 183 || [[html(<code>`{{{-}}}` triple curly brackets</code>)]] ||\ 184 || `{{{-}}}` triple curly brackets || 184 185 |----------------------------------------------------------- 185 186 ||= [#Images Images] =|| `[[Image(`''link''`)]]` || [[Image(htdocs:../common/trac_logo_mini.png)]] || … … 241 242 }}} 242 243 243 244 == Font Styles == 244 == Font Styles 245 245 246 246 The Trac wiki supports the following font styles: … … 262 262 * **also bold**, //italic as well//, 263 263 and **'' bold italic **'' //(since 0.12)// 264 * [[span(style=color: #FF0000, a red text )]] 264 265 }}} 265 266 }}} … … 279 280 * **also bold**, //italic as well//, 280 281 and **'' bold italic **'' //(since 0.12)// 282 * [[span(style=color: #FF0000, a red text )]] 281 283 }}} 282 284 … … 285 287 * {{{ ! }}} 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. 286 288 * all the font styles marks have to be used in opening/closing pairs, 287 and they must nest properly (in particular, an `''` italic can't be paired 288 with a `//` one, and `'''` can't be paired with `**`) 289 290 291 == Headings == 292 293 You can create heading by starting a line with one up to six ''equal'' characters ("=") 294 followed by a single space and the headline text. 295 296 [=#hn] The headline text can be followed by the same number of "=" characters, but this is no longer mandatory. 289 and they must nest properly; in particular, an `''` italic can't be paired 290 with a `//` one, and `'''` can't be paired with `**`. 291 292 == Headings 293 294 You can create heading by starting a line with one up to six ''equal'' characters ("=") followed by a single space and the headline text. 295 296 [=#hn] 297 The headline text can be followed by the same number of "=" characters, but this is not mandatory. That is, `=== Section3 ===` is identical to `=== Section3`. 297 298 298 299 Finally, the heading might optionally be followed by an explicit id. If not, an implicit but nevertheless readable id will be generated. … … 311 312 {{{ 312 313 #!div 314 = Heading = 313 315 == Subheading 314 316 === About ''this'' === … … 318 320 }}} 319 321 320 == Paragraphs ==322 == Paragraphs 321 323 322 324 A new text paragraph is created whenever two blocks of text are separated by one or more empty lines. … … 346 348 }}} 347 349 348 == Lists ==350 == Lists 349 351 350 352 The wiki supports both ordered/numbered and unordered lists. … … 402 404 }}} 403 405 404 405 == Definition Lists == 406 == Definition Lists 406 407 407 408 The wiki also supports definition lists. … … 427 428 Note that you need a space in front of the defined term. 428 429 429 430 == Preformatted Text == 430 == Preformatted Text 431 431 432 432 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. … … 450 450 Note that this kind of block is also used for selecting lines that should be processed through WikiProcessors. 451 451 452 == Blockquotes ==452 == Blockquotes 453 453 454 454 In order to mark a paragraph as blockquote, indent that paragraph with two spaces. … … 466 466 }}} 467 467 468 == Discussion Citations ==469 470 To delineate a citation in an ongoing discussion thread, such as the ticket comment area, e -mail-like citation marks (">", ">>", etc.) may be used.468 == Discussion Citations 469 470 To delineate a citation in an ongoing discussion thread, such as the ticket comment area, email-like citation marks (">", ">>", etc.) may be used. 471 471 472 472 ||= Wiki Markup =||= Display =|| … … 486 486 }}} 487 487 488 489 == Tables ==490 === Simple Tables === 488 == Tables 489 === Simple Tables 490 491 491 Simple tables can be created like this: 492 492 ||= Wiki Markup =||= Display =|| … … 578 578 }}} 579 579 580 === Complex Tables === 581 582 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]. 583 584 585 == Links == 586 587 Hyperlinks are automatically created for WikiPageNames and URLs. !WikiPageLinks can be disabled by prepending an exclamation mark "!" character, such as {{{!WikiPageLink}}}. 580 === Complex Tables 581 582 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]. 583 584 == Links 585 586 Hyperlinks are automatically created for WikiPageNames and URLs. !WikiPageLinks can be disabled by prepending an exclamation mark ('!'), such as {{{!WikiPageLink}}}. 588 587 589 588 ||= Wiki Markup =||= Display =|| … … 637 636 }}} 638 637 639 '''Note''': the [trac:WikiCreole] style for links is quick to type and 640 certainly looks familiar as it's the one used on Wikipedia and in many 641 other wikis. Unfortunately it conflicts with the syntax for [#Macros macros]. 642 So in the rare case when you need to refer to a page which is named after 643 a macro (typical examples being TitleIndex, InterTrac and InterWiki), 644 by writing `[[TitleIndex]]` you will actually call the macro instead of linking 645 to the page. 646 647 == Trac Links == 638 '''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]. 639 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. 640 641 == Trac Links 648 642 649 643 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: … … 675 669 There are many more flavors of Trac links, see TracLinks for more in-depth information and a reference for all the default link resolvers. 676 670 677 678 == Setting Anchors == 671 == Setting Anchors 679 672 680 673 An anchor, or more correctly speaking, an [http://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, in order to uniquely identify a position in the document: … … 689 682 }}} 690 683 691 It 's also very close to the syntax for the corresponding link to that anchor:684 It is also very close to the syntax for the corresponding link to that anchor: 692 685 {{{ 693 686 [#point1] … … 696 689 Optionally, a label can be given to the anchor: 697 690 {{{ 698 [ [=#point1 '''Point 1''']]691 [=#point1 '''Point 1'''] 699 692 }}} 700 693 … … 718 711 }}} 719 712 720 For more complex anchors (e.g. when a custom title is wanted), one can use the Span macro, e.g. `[[span(id=point2, class=wikianchor, title=Point 2, ^(2)^)]]`. 721 722 723 == Escaping Links and WikiPageNames == 724 725 You may avoid making hyperlinks out of TracLinks by preceding an expression with a single "!" (exclamation mark). 713 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)^)]]`. 714 715 == Escaping Links, WikiPageNames and other Markup == #Escaping 716 717 You may avoid making hyperlinks out of TracLinks by preceding an expression with a single exclamation mark ('!'). 726 718 727 719 ||= Wiki Markup =||= Display =|| … … 731 723 !#42 is not a link 732 724 }}} 725 {{{ 726 Various forms of escaping for list markup: 727 ^^- escaped minus sign \\ 728 ^^1. escaped number \\ 729 ^^* escaped asterisk sign 730 }}} 733 731 }}} 734 732 {{{#!td 735 733 !NoHyperLink 736 734 !#42 is not a link 737 }}} 738 739 == Images == 735 736 Various forms of escaping for list markup: 737 ^^- escaped minus sign \\ 738 ^^1. escaped number \\ 739 ^^* escaped asterisk sign 740 }}} 741 742 == Images 740 743 741 744 Urls ending with `.png`, `.gif` or `.jpg` are no longer automatically interpreted as image links, and converted to `<img>` tags. … … 746 749 * `[[Image(wiki:WikiFormatting:picture.gif)]]` (referring to attachment on another page) 747 750 * `[[Image(ticket:1:picture.gif)]]` (file attached to a ticket) 748 * `[[Image(htdocs:picture.gif)]]` (referring to a file inside project htdocs)751 * `[[Image(htdocs:picture.gif)]]` (referring to a file inside the [TracEnvironment environment] `htdocs` directory) 749 752 * `[[Image(source:/trunk/trac/htdocs/trac_logo_mini.png)]]` (a file in repository) 750 753 … … 759 762 }}} 760 763 761 See WikiMacros for further documentation on the `[[Image()]]` macro. 762 763 764 == Macros == 764 See WikiMacros for further documentation on the `[[Image()]]` macro, which has several useful options (`title=`, `link=`, etc.) 765 766 == Macros 765 767 766 768 Macros are ''custom functions'' to insert dynamic content in a page. … … 790 792 }}} 791 793 792 793 == Processors == 794 == Processors 794 795 795 796 Trac supports alternative markup formats using WikiProcessors. For example, processors are used to write pages in … … 928 929 See WikiProcessors for more information. 929 930 930 931 == Comments == 931 == Comments 932 932 933 933 Comments can be added to the plain text. These will not be rendered and will not display in any other format than plain text. … … 941 941 Your comment for editors here 942 942 }}} 943 see ;-)943 see. 944 944 }}} 945 945 }}} … … 950 950 Your comment for editors here 951 951 }}} 952 see ;-) 953 }}} 954 955 == Miscellaneous == 956 957 An horizontal line can be used to separated different parts of your page: 958 959 ||= Wiki Markup =||= Display =|| 960 {{{#!td 952 see. 953 }}} 954 955 == Miscellaneous 956 957 ||= Wiki Markup =||= Display =|| 958 {{{#!td 959 Horizontal line: 961 960 {{{ 962 961 Four or more dashes will be replaced 963 by a nhorizontal line (<HR>)962 by a horizontal line (<HR>) 964 963 ---- 965 964 See? … … 968 967 {{{#!td 969 968 Four or more dashes will be replaced 970 by a nhorizontal line (<HR>)969 by a horizontal line (<HR>) 971 970 ---- 972 971 See? … … 974 973 |---------------------------------- 975 974 {{{#!td 976 {{{ 977 "macro" style [[br]] line break 978 }}} 979 }}} 980 {{{#!td 981 "macro" style [[br]] line break 975 Two examples of line breaks: 976 {{{ 977 "macro" style [[BR]] line break 978 }}} 979 or: 980 {{{ 981 !WikiCreole style \\ line\\break 982 }}} 983 }}} 984 {{{#!td 985 "macro" style [[BR]] line break 986 987 !WikiCreole style \\ line\\break 982 988 }}} 983 989 |---------------------------------- 984 {{{#!td985 {{{986 !WikiCreole style \\ line\\break987 }}}988 }}}989 {{{#!td990 !WikiCreole style \\ line\\break991 }}}