Edgewall Software

Changes between Version 7 and Version 8 of 0.12/WikiFormatting


Ignore:
Timestamp:
Jan 25, 2010, 10:18:28 AM (14 years ago)
Author:
Christian Boos
Comment:

use tables for showing wiki markup and corresponding display side by side

Legend:

Unmodified
Added
Removed
Modified
  • 0.12/WikiFormatting

    v7 v8  
    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
     
    1414
    1515The 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 ! ''',
    1837 * ''italic''
    19  * '''''bold italic'''''
     38 * '''''bold italic''''' or ''italic and
     39   ''' italic bold ''' ''
    2040 * __underline__
    2141 * {{{monospace}}} or `monospace`
     42   (hence `{{{` or {{{`}}} quoting)
    2243 * ~~strike-through~~
    2344 * ^superscript^
     
    2546}}}
    2647
    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 
    4048Notes:
    4149 * `{{{...}}}` 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.
    4250 * {{{ ! }}} 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
    4353
    4454== Headings ==
     
    4959The heading might optionally be followed by an explicit id. If not, an implicit but nevertheless readable id will be generated.
    5060
     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
     83A new text paragraph is created whenever two blocks of text are separated by one or more empty lines.
     84
     85A 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
     111The wiki supports both ordered/numbered and unordered lists.
     112
    51113Example:
    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
    89142 * Item 1
    90143   * Item 1.1
     
    94147   * Item 1.2
    95148 * Item 2
    96 
    97149- items can start at the beginning of a line
    98150  and they can span multiple lines
     
    107159      i. Item 1.b.ii
    108160 1. Item 2
    109 And numbered lists can also be given an explicit number:
     161And numbered lists can also be restarted with an explicit number:
    110162 3. Item 3
    111163}}}
    112164
    113 Display:
    114 {{{
    115 #!div style="border: 1px solid #ddd"
    116  * Item 1
    117    * Item 1.1
    118       * Item 1.1.1
    119       * Item 1.1.2
    120       * Item 1.1.3
    121    * Item 1.2
    122  * Item 2
    123 
    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 given an explicit number:
    137  3. Item 3
    138 }}}
    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 
    142165
    143166== Definition Lists ==
    144167
    145 
    146168The wiki also supports definition lists.
    147169
    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
    150181 llama::
    151182   some kind of mammal, with hair
     
    155186}}}
    156187
    157 Display:
    158 {{{
    159 #!div style="border: 1px solid #ddd"
    160  llama::
    161    some kind of mammal, with hair
    162  ppython::
    163    some kind of reptile, without hair
    164    (can you spot the typo?)
    165 }}}
    166 
    167188Note that you need a space in front of the defined term.
    168189
     
    172193Block 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.
    173194 
    174 Example:
    175 {{{
    176  {{{
     195||= Wiki Markup =||= Display =||
     196{{{#!td
     197  {{{
     198  {{{
    177199  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
     211Note that this kind of block is also used for selecting lines that should be processed through WikiProcessors.
    190212
    191213== Blockquotes ==
     
    193215In order to mark a paragraph as blockquote, indent that paragraph with two spaces.
    194216
    195 Example:
    196 {{{
     217||= Wiki Markup =||= Display =||
     218{{{#!td
     219{{{
     220Paragraph
    197221  This text is a quote from someone else.
    198222}}}
    199 
    200 Display:
    201 {{{
    202 #!div style="border: 1px solid #ddd"
     223}}}
     224{{{#!td
     225Paragraph
    203226  This text is a quote from someone else.
    204227}}}
     
    208231To delineate a citation in an ongoing discussion thread, such as the ticket comment area, e-mail-like citation marks (">", ">>", etc.) may be used. 
    209232
    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
    212242>> Someone's original text
    213243> Someone else's reply text
     
    215245}}}
    216246
    217 Display:
    218 {{{
    219 #!div style="border: 1px solid #ddd"
    220 >> Someone's original text
    221 > Someone else's reply text
    222 My reply text
    223 }}}
    224 
    225247''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.''
    226248
    227249== Tables ==
    228 
     250=== Simple Tables ===
    229251Simple 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
    231260||Cell 1||Cell 2||Cell 3||
    232261||Cell 4||Cell 5||Cell 6||
    233262}}}
    234263
    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 
    242264Cell headings can be specified by wrapping the content in a pair of '=' characters.
    243265Note 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
    245275||        ||= stable =||= latest =||
    246276||= 0.10 =||  0.10.5  || 0.10.6dev||
     
    248278}}}
    249279
    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 
    258280Finally, 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
    260291|| 1 || 2 || 3 ||
    261292|||| 1-2 || 3 ||
     
    264295}}}
    265296
    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 
    275297Note 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
    277312||=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
     322Note that more complex tables can be created using WikiProcessors#Tables.
    295323
    296324== Links ==
     
    298326Hyperlinks are automatically created for WikiPageNames and URLs. !WikiPageLinks can be disabled by prepending an exclamation mark "!" character, such as {{{!WikiPageLink}}}.
    299327
    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
     335TitleIndex, http://www.edgewall.com/, !NotAlink
    309336}}}
    310337
    311338Links 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.
    312339
    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
    315349 * [http://www.edgewall.com/ Edgewall Software]
    316350 * [wiki:TitleIndex Title Index]
     
    318352}}}
    319353
    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 
    328354== Trac Links ==
    329355
    330356Wiki 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
    341368 * Tickets: #1 or ticket:1
    342369 * Reports: {1} or report:1
     
    352379You may avoid making hyperlinks out of TracLinks by preceding an expression with a single "!" (exclamation mark).
    353380
    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
    363389 !NoHyperLink
    364390 !#42 is not a link
     
    377403 * `[[Image(source:/trunk/trac/htdocs/trac_logo_mini.png)]]` (a file in repository)
    378404
    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}}}
    380414
    381415See WikiMacros for further documentation on the `[[Image()]]` macro.
     
    386420Macros are ''custom functions'' to insert dynamic content in a page.
    387421
    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)]]
    397430}}}
    398431
     
    401434The detailed help for a specific macro can also be obtained more directly by appending a "?" to the macro name.
    402435
    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?]]
    412444}}}
    413445
     
    418450[wiki:WikiRestructuredText reStructuredText] or [wiki:WikiHtml HTML].
    419451
     452||= Wiki Markup =||= Display =||
     453{{{#!td
     454
    420455Example 1:
    421 {{{
    422 #!html
    423 <pre class="wiki">{{{
    424 #!html
    425 &lt;h1 style="text-align: right; color: blue"&gt;HTML Test&lt;/h1&gt;
    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
     465Example 1:
    432466{{{
    433467#!html
    434468<h1 style="text-align: right; color: blue">HTML Test</h1>
    435469}}}
    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
     475Example 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"
     490Example 2:
    455491{{{
    456492#!python
     
    461497   Test()
    462498}}}
    463 }}}
    464 
    465 Perl:
     499
     500}}}
     501|--------------------------------------------------------
     502{{{
     503#!td
     504Example 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"
     518Example 3:
    466519{{{
    467520#!perl
     
    472525}}}
    473526
     527}}}
     528
     529
    474530See WikiProcessors for more information.
    475531
     
    478534
    479535Comments 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}}}
    487556
    488557== Miscellaneous ==
    489558
    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"
     559An 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
     571Four or more dashes will be replaced
     572by a horizontal line (<HR>)
    500573----
     574See?
    501575}}}
    502576