Changes between Version 6 and Version 7 of WikiFormatting


Ignore:
Timestamp:
Feb 12, 2017 2:41:53 AM (3 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiFormatting

    v6 v7  
    1 = WikiFormatting =
     1= WikiFormatting
     2
    23[[TracGuideToc]]
    34
    45Wiki markup is a core feature in Trac, tightly integrating all the other parts of Trac into a flexible and powerful whole.
    56
    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 
     7Trac 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].
    98
    109This page will give you an in-depth explanation of the wiki markup available anywhere WikiFormatting is allowed.
    1110
    12 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.
     11The 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.
    1312
    1413A 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 not
    17  - 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 == Cheat 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
    2221
    2322||= '''Category''' =||= '''Wiki Markup''' =||= '''Display''' =||
     
    3635{{{#!td
    3736 {{{
    38  == Level 2 ==
     37 == Level 2
    3938 === Level 3 ^([#hn note])^
    4039 }}}
    4140}}}
    4241{{{#!td style="padding-left: 2em"
    43 == Level 2 ==
     42== Level 2
    4443=== Level 3 ^([#hn note])^
    4544}}}
     
    6463{{{#!td
    6564 {{{
    66  * bullets list
     65 * bullet list
    6766   on multiple lines
    6867   1. nested list
     
    7271}}}
    7372{{{#!td
    74 * bullets list
     73* bullet list
    7574  on multiple lines
    7675  1. nested list
     
    9392}}}
    9493|-----------------------------------------------------------
    95 {{{#!th rowspan=3
    96 [#PreformattedText Preformatted Text]\\
    97 [#Processors Processors]\\
    98 [#Comments Comments]
    99 }}}
     94||= [#PreformattedText Preformatted Text] =||\
    10095{{{#!td
    10196 {{{
     
    110105 multiple lines, ''no wiki''
    111106       white space respected
    112  }}}
    113 }}}
    114 ||
    115 {{{#!td
    116  {{{
    117  {{{#!hs
    118  main :: IO ()
    119  main = putStrLn "Hello, World"
    120  }}}
    121  }}}
    122 }}}
    123 {{{#!td
    124  {{{#!hs
    125  main :: IO ()
    126  main = putStrLn "Hello, World"
    127  }}}
    128 }}}
    129 ||
    130 {{{#!td
    131  {{{
    132  {{{#!comment
    133  Note to Editors: ...
    134  }}}
    135  }}}
    136 }}}
    137 {{{#!td style="padding-left: 2em"
    138  {{{#!comment
    139  Note to Editors: ...
    140107 }}}
    141108}}}
     
    194161|| `ticket:1, ticket:1#comment:1` ||\
    195162|| ticket:1, ticket:1#comment:1 ||
    196 || `Ticket [ticket:1]`, `[ticket:1 ticket one]` ||\
    197 || Ticket [ticket:1], [ticket:1 ticket one] ||
    198 || `Ticket [[ticket:1]]`, `[[ticket:1|ticket one]]` ||\
    199 || Ticket [[ticket:1]], [[ticket:1|ticket one]] ||
     163|| `Ticket [ticket:1]`, `[ticket:1 ticket one]` ||\
     164|| Ticket [ticket:1], [ticket:1 ticket one] ||
     165|| `Ticket [[ticket:1]]`, `[[ticket:1|ticket one]]` ||\
     166|| Ticket [[ticket:1]], [[ticket:1|ticket one]] ||
    200167|-----------------------------------------------------------
    201168{{{#!th rowspan=2
     
    214181|| `!wiki:WikiFormatting`, `!WikiFormatting` ||\
    215182|| !wiki:WikiFormatting, !WikiFormatting ||
    216 || {{{`}}}`{{{-}}}`{{{`}}}` triple curly brackets` ||\
     183|| [[html(<code>`{{{-}}}` triple curly brackets</code>)]] ||\
    217184|| `{{{-}}}` triple curly brackets ||
    218185|-----------------------------------------------------------
     
    224191|| `[[MacroList(*)]]` ||  ''(short list of all available macros)''  ||
    225192|| `[[Image?]]` ||  ''(help for the Image macro)''  ||
     193|-----------------------------------------------------------
     194||= [#Processors Processors] =||\
     195{{{#!td
     196 {{{
     197 {{{
     198 #!div style="font-size: 80%"
     199 Code highlighting:
     200   {{{#!python
     201   hello = lambda: "world"
     202   }}}
     203 }}}
     204 }}}
     205}}}
     206{{{#!td style="padding-left: 2em"
     207 {{{
     208 #!div style="font-size: 80%"
     209 Code highlighting:
     210   {{{#!python
     211   hello = lambda: "world"
     212   }}}
     213 }}}
     214}}}
     215|-----------------------------------------------------------
     216||= [#Comments Comments] =||\
     217{{{#!td
     218 {{{
     219 {{{#!comment
     220 Note to Editors: ...
     221 }}}
     222 }}}
     223}}}
     224{{{#!td style="padding-left: 2em"
     225 {{{#!comment
     226 Note to Editors: ...
     227 }}}
     228}}}
    226229|-----------------------------------------------------------
    227230||= [#Miscellaneous Miscellaneous] =||\
     
    239242}}}
    240243
    241 
    242 == Font Styles ==
     244== Font Styles
    243245
    244246The Trac wiki supports the following font styles:
     
    260262   * **also bold**, //italic as well//,
    261263     and **'' bold italic **'' //(since 0.12)//
     264   * [[span(style=color: #FF0000, a red text )]]
    262265  }}}
    263266}}}
     
    277280 * **also bold**, //italic as well//,
    278281   and **'' bold italic **'' //(since 0.12)//
     282 * [[span(style=color: #FF0000, a red text )]]
    279283}}}
    280284
     
    283287 * {{{ ! }}} 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.
    284288 * all the font styles marks have to be used in opening/closing pairs,
    285    and they must nest properly (in particular, an `''` italic can't be paired
    286    with a `//` one, and `'''` can't be paired with `**`)
    287 
    288 
    289 == Headings ==
    290 
    291 You can create heading by starting a line with one up to six ''equal'' characters ("=")
    292 followed by a single space and the headline text.
     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
     294You can create heading by starting a line with one up to six ''equal'' characters ("=") followed by a single space and the headline text.
    293295
    294296[=#hn]
    295 The headline text can be followed by the same number of "=" characters, but this is no longer mandatory.
     297The headline text can be followed by the same number of "=" characters, but this is not mandatory. That is, `=== Section3 ===` is identical to `=== Section3`.
    296298
    297299Finally, the heading might optionally be followed by an explicit id. If not, an implicit but nevertheless readable id will be generated.
     
    318320}}}
    319321
    320 == Paragraphs ==
     322== Paragraphs
    321323
    322324A new text paragraph is created whenever two blocks of text are separated by one or more empty lines.
     
    346348}}}
    347349
    348 == Lists ==
     350== Lists
    349351
    350352The wiki supports both ordered/numbered and unordered lists.
     
    402404}}}
    403405
    404 
    405 == Definition Lists ==
     406== Definition Lists
    406407
    407408The wiki also supports definition lists.
     
    427428Note that you need a space in front of the defined term.
    428429
    429 
    430 == Preformatted Text ==
     430== Preformatted Text
    431431
    432432Block 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.
     
    448448}}}
    449449
    450 See [#Processors Processors] for syntax highlighting.
    451 
    452450Note that this kind of block is also used for selecting lines that should be processed through WikiProcessors.
    453451
    454 
    455 == Comments ==
    456 
    457 Comments can be added to the plain text. These will not be rendered and will not display in any other format than plain text.
    458 
    459 ||= Wiki Markup =||= Display =||
    460 {{{#!td
    461   {{{
    462   Nothing to
    463   {{{
    464   #!comment
    465   Your comment for editors here
    466   }}}
    467   see ;-)
    468   }}}
    469 }}}
    470 {{{#!td
    471   Nothing to
    472   {{{
    473   #!comment
    474   Your comment for editors here
    475   }}}
    476   see ;-)
    477 }}}
    478 
    479 
    480 == Blockquotes ==
     452== Blockquotes
    481453
    482454In order to mark a paragraph as blockquote, indent that paragraph with two spaces.
     
    494466}}}
    495467
    496 == Discussion Citations ==
    497 
    498 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
     470To delineate a citation in an ongoing discussion thread, such as the ticket comment area, email-like citation marks (">", ">>", etc.) may be used. 
    499471
    500472||= Wiki Markup =||= Display =||
     
    514486}}}
    515487
    516 
    517 == Tables ==
    518 === Simple Tables ===
     488== Tables
     489=== Simple Tables
     490
    519491Simple tables can be created like this:
    520492||= Wiki Markup =||= Display =||
     
    606578}}}
    607579
    608 === Complex Tables ===
    609 
    610 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].
    611 
    612 
    613 == Links ==
    614 
    615 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
     582If 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
     586Hyperlinks are automatically created for WikiPageNames and URLs. !WikiPageLinks can be disabled by prepending an exclamation mark ('!'), such as {{{!WikiPageLink}}}.
    616587
    617588||= Wiki Markup =||= Display =||
     
    665636}}}
    666637
    667 '''Note''': the [trac:WikiCreole] style for links is quick to type and
    668 certainly looks familiar as it's the one used on Wikipedia and in many
    669 other wikis. Unfortunately it conflicts with the syntax for [#Macros macros].
    670 So in the rare case when you need to refer to a page which is named after
    671 a macro (typical examples being TitleIndex, InterTrac and InterWiki),
    672 by writing `[[TitleIndex]]` you will actually call the macro instead of linking
    673 to the page.
    674 
    675 == 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].
     639So 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
    676642
    677643Wiki 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:
     
    703669There are many more flavors of Trac links, see TracLinks for more in-depth information and a reference for all the default link resolvers.
    704670
    705 
    706 == Setting Anchors ==
     671== Setting Anchors
    707672
    708673An 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:
     
    717682}}}
    718683
    719 It's also very close to the syntax for the corresponding link to that anchor:
     684It is also very close to the syntax for the corresponding link to that anchor:
    720685{{{
    721686[#point1]
     
    746711}}}
    747712
    748 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)^)]]`.
    749 
     713For 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)^)]]`.
    750714
    751715== Escaping Links, WikiPageNames and other Markup == #Escaping
    752716
    753 You may avoid making hyperlinks out of TracLinks by preceding an expression with a single "!" (exclamation mark).
     717You may avoid making hyperlinks out of TracLinks by preceding an expression with a single exclamation mark ('!').
    754718
    755719||= Wiki Markup =||= Display =||
     
    761725  {{{
    762726Various forms of escaping for list markup:
    763  `-` escaped minus sign \\
    764  ``1. escaped number  \\
    765  {{{*}}} escaped asterisk sign
     727 ^^- escaped minus sign \\
     728 ^^1. escaped number  \\
     729 ^^* escaped asterisk sign
    766730  }}}
    767731}}}
     
    771735
    772736Various forms of escaping for list markup:
    773  `-` escaped minus sign \\
    774  ``1. escaped number  \\
    775  {{{*}}} escaped asterisk sign
    776 }}}
    777 
    778 == Images ==
     737 ^^- escaped minus sign \\
     738 ^^1. escaped number  \\
     739 ^^* escaped asterisk sign
     740}}}
     741
     742== Images
    779743
    780744Urls ending with `.png`, `.gif` or `.jpg` are no longer automatically interpreted as image links, and converted to `<img>` tags.
     
    800764See WikiMacros for further documentation on the `[[Image()]]` macro, which has several useful options (`title=`, `link=`, etc.)
    801765
    802 
    803 == Macros ==
     766== Macros
    804767
    805768Macros are ''custom functions'' to insert dynamic content in a page.
     
    829792}}}
    830793
    831 
    832 == Processors ==
     794== Processors
    833795
    834796Trac supports alternative markup formats using WikiProcessors. For example, processors are used to write pages in
     
    967929See WikiProcessors for more information.
    968930
    969 
    970 == Miscellaneous ==
    971 
    972 An horizontal line can be used to separated different parts of your page:
    973 
    974 ||= Wiki Markup =||= Display =||
    975 {{{#!td
     931== Comments
     932
     933Comments can be added to the plain text. These will not be rendered and will not display in any other format than plain text.
     934
     935||= Wiki Markup =||= Display =||
     936{{{#!td
     937  {{{
     938  Nothing to
     939  {{{
     940  #!comment
     941  Your comment for editors here
     942  }}}
     943  see.
     944  }}}
     945}}}
     946{{{#!td
     947  Nothing to
     948  {{{
     949  #!comment
     950  Your comment for editors here
     951  }}}
     952  see.
     953}}}
     954
     955== Miscellaneous
     956
     957||= Wiki Markup =||= Display =||
     958{{{#!td
     959  Horizontal line:
    976960  {{{
    977961  Four or more dashes will be replaced
    978   by an horizontal line (<HR>)
     962  by a horizontal line (<HR>)
    979963  ----
    980964  See?
     
    983967{{{#!td
    984968Four or more dashes will be replaced
    985 by an horizontal line (<HR>)
     969by a horizontal line (<HR>)
    986970----
    987971See?
     
    989973|----------------------------------
    990974{{{#!td
    991   {{{
    992   "macro" style [[br]] line break
    993   }}}
    994 }}}
    995 {{{#!td
    996 "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
    997988}}}
    998989|----------------------------------
    999 {{{#!td
    1000   {{{
    1001   !WikiCreole style \\ line\\break
    1002   }}}
    1003 }}}
    1004 {{{#!td
    1005 !WikiCreole style \\ line\\break
    1006 }}}
    1007