Changes between Version 1 and Version 2 of WikiFormatting


Ignore:
Timestamp:
Feb 24, 2010 5:37:18 PM (8 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiFormatting

    v1 v2  
    55
    66Trac 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].
     7especially [http://moinmo.in/ MoinMoin] and [trac:WikiCreole].
    88
    99
     
    1111
    1212
     13[[PageOutline(2,Markup Categories,inline)]]
     14
     15
    1316== Font Styles ==
    1417
    1518The 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 ! ''',
    1840 * ''italic''
    19  * '''''bold italic'''''
     41 * '''''bold italic''''' or ''italic and
     42   ''' italic bold ''' ''
    2043 * __underline__
    2144 * {{{monospace}}} or `monospace`
     45   (hence `{{{` or {{{`}}} quoting)
    2246 * ~~strike-through~~
    2347 * ^superscript^
     
    2549}}}
    2650
    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 
    3751Notes:
    3852 * `{{{...}}}` 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.
    3953 * {{{ ! }}} 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
    4056
    4157== Headings ==
    4258
    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.
     59You can create heading by starting a line with one up to six ''equal'' characters ("=")
     60followed by a single space and the headline text. The headline text can be
     61followed by the same number of ''='' characters, but this is no longer mandatory.
    4662The heading might optionally be followed by an explicit id. If not, an implicit but nevertheless readable id will be generated.
    4763
     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
     86A new text paragraph is created whenever two blocks of text are separated by one or more empty lines.
     87
     88A 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
     114The wiki supports both ordered/numbered and unordered lists.
     115
    48116Example:
    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
    81145 * Item 1
    82146   * Item 1.1
     
    86150   * Item 1.2
    87151 * 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
     156that will start a new paragraph...
    88157
    89158 1. Item 1
     
    93162      i. Item 1.b.ii
    94163 1. Item 2
    95 And numbered lists can also be given an explicit number:
     164And numbered lists can also be restarted with an explicit number:
    96165 3. Item 3
    97166}}}
    98167
    99 Display:
    100  * Item 1
    101    * Item 1.1
    102       * Item 1.1.1
    103       * Item 1.1.2
    104       * Item 1.1.3
    105    * Item 1.2
    106  * Item 2
    107 
    108  1. Item 1
    109    a. Item 1.a
    110    a. Item 1.b
    111       i. Item 1.b.i
    112       i. Item 1.b.ii
    113  1. Item 2
    114 And numbered lists can also be given an explicit number:
    115  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 
    119168
    120169== Definition Lists ==
    121170
    122 
    123171The wiki also supports definition lists.
    124172
    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
    127184 llama::
    128185   some kind of mammal, with hair
     
    132189}}}
    133190
    134 Display:
    135  llama::
    136    some kind of mammal, with hair
    137  ppython::
    138    some kind of reptile, without hair
    139    (can you spot the typo?)
    140 
    141191Note that you need a space in front of the defined term.
    142192
     
    146196Block 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.
    147197 
    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
     214Note that this kind of block is also used for selecting lines that should be processed through WikiProcessors.
     215
     216== Blockquotes ==
     217
     218In order to mark a paragraph as blockquote, indent that paragraph with two spaces.
     219
     220||= Wiki Markup =||= Display =||
     221{{{#!td
    149222{{{
    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 {{{
     223Paragraph
    169224  This text is a quote from someone else.
    170225}}}
    171 
    172 Display:
     226}}}
     227{{{#!td
     228Paragraph
    173229  This text is a quote from someone else.
     230}}}
    174231
    175232== Discussion Citations ==
     
    177234To delineate a citation in an ongoing discussion thread, such as the ticket comment area, e-mail-like citation marks (">", ">>", etc.) may be used. 
    178235
    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
    181246>> Someone's original text
    182247> Someone else's reply text
     248>  - which can be any kind of Wiki markup
    183249My reply text
    184250}}}
    185251
    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.''
    192252
    193253== Tables ==
    194 
     254=== Simple Tables ===
    195255Simple 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;"
    197264||Cell 1||Cell 2||Cell 3||
    198265||Cell 4||Cell 5||Cell 6||
    199266}}}
    200267
    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].
     268Cell headings can be specified by wrapping the content in a pair of '=' characters.
     269Note 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
     284Finally, 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
     301Note 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
     326If 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
     346If 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].
    207347
    208348
     
    211351Hyperlinks are automatically created for WikiPageNames and URLs. !WikiPageLinks can be disabled by prepending an exclamation mark "!" character, such as {{{!WikiPageLink}}}.
    212352
    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
     360TitleIndex, http://www.edgewall.com/, !NotAlink
     361}}}
    220362
    221363Links 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.
    222364
    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
    225374 * [http://www.edgewall.com/ Edgewall Software]
    226375 * [wiki:TitleIndex Title Index]
     
    228377}}}
    229378
    230 Display:
    231  * [http://www.edgewall.com/ Edgewall Software]
    232  * [wiki:TitleIndex Title Index]
    233  * [wiki:ISO9000]
    234 
    235379== Trac Links ==
    236380
    237381Wiki 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
    246393 * Tickets: #1 or ticket:1
    247394 * Reports: {1} or report:1
    248395 * Changesets: r1, [1] or changeset:1
    249396 * ...
     397}}}
    250398
    251399There are many more flavors of Trac links, see TracLinks for more in-depth information.
     
    256404You may avoid making hyperlinks out of TracLinks by preceding an expression with a single "!" (exclamation mark).
    257405
    258 Example:
    259 {{{
     406||= Wiki Markup =||= Display =||
     407{{{#!td
     408  {{{
     409   !NoHyperLink
     410   !#42 is not a link
     411  }}}
     412}}}
     413{{{#!td
    260414 !NoHyperLink
    261415 !#42 is not a link
    262416}}}
    263 
    264 Display:
    265  !NoHyperLink
    266  !#42 is not a link
    267 
    268417
    269418== Images ==
     
    279428 * `[[Image(source:/trunk/trac/htdocs/trac_logo_mini.png)]]` (a file in repository)
    280429
    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}}}
    283439
    284440See WikiMacros for further documentation on the `[[Image()]]` macro.
     
    289445Macros are ''custom functions'' to insert dynamic content in a page.
    290446
    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}}}
    298456
    299457See WikiMacros for more information, and a list of installed macros.
     458
     459The 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}}}
    300470
    301471
     
    305475[wiki:WikiRestructuredText reStructuredText] or [wiki:WikiHtml HTML].
    306476
    307 Example 1:
    308 {{{
    309 #!html
    310 <pre class="wiki">{{{
    311 #!html
    312 &lt;h1 style="text-align: right; color: blue"&gt;HTML Test&lt;/h1&gt;
    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
    317497{{{
    318498#!html
     
    320500}}}
    321501
    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}}}
    323523{{{
    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
    337526{{{
    338527#!python
     
    344533}}}
    345534
    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}}}
    347574{{{
    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
    353605}}}
    354606
     
    359611
    360612Comments 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}}}
    368633
    369634== Miscellaneous ==
    370635
    371 Four or more dashes will be replaced by a horizontal line (<HR>)
    372 
    373 Example:
    374 {{{
    375  ----
    376 }}}
    377 
    378 Display:
     636An 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
     648Four or more dashes will be replaced
     649by a horizontal line (<HR>)
    379650----
    380 
     651See?
     652}}}
    381653
    382654