Changes between Version 10 and Version 11 of WikiFormatting


Ignore:
Timestamp:
Oct 13, 2009, 3:03:56 PM (16 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiFormatting

    v10 v11  
    1 = WikiFormatting =
    2 [[TracGuideToc]]
    3 
    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 ==
    14 
    15 The Trac wiki supports the following font styles:
    16 {{{
    17  * '''bold'''
    18  * ''italic''
    19  * '''''bold italic'''''
    20  * __underline__
    21  * {{{monospace}}} or `monospace`
    22  * ~~strike-through~~
    23  * ^superscript^ 
    24  * ,,subscript,,
    25 }}}
    26 
    27 Display:
    28  * '''bold'''
    29  * ''italic''
    30  * '''''bold italic'''''
    31  * __underline__
    32  * {{{monospace}}} or `monospace`
    33  * ~~strike-through~~
    34  * ^superscript^ 
    35  * ,,subscript,,
    36 
    37 Note that the `{{{...}}}` 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.
    38 
    39 == Headings ==
    40 
    41 You can create heading by starting a line with one up to five ''equal'' characters ("=")
    42 followed by a single space and the headline text. The line should end with a space 
    43 followed by the same number of ''='' characters.
    44 
    45 Example:
    46 {{{
    47 = Heading =
    48 == Subheading ==
    49 === About ''this'' ===
    50 }}}
    51 
    52 Display:
    53 = Heading =
    54 == Subheading ==
    55 === About ''this'' ===
    56 
    57 
    58 == Paragraphs ==
    59 
    60 A new text paragraph is created whenever two blocks of text are separated by one or more empty lines.
    61 
    62 A forced line break can also be inserted, using:
    63 {{{
    64 Line 1[[BR]]Line 2
    65 }}}
    66 Display:
    67 
    68 Line 1[[BR]]Line 2
    69 
    70 
    71 == Lists ==
    72 
    73 The wiki supports both ordered/numbered and unordered lists.
    74 
    75 Example:
    76 {{{
    77  * Item 1
    78    * Item 1.1
    79  * Item 2
    80 
    81  1. Item 1
    82    1. Item 1.1
    83  1. Item 2
    84 }}}
    85 
    86 Display:
    87  * Item 1
    88    * Item 1.1
    89  * Item 2
    90 
    91  1. Item 1
    92    1. Item 1.1
    93  1. Item 2
    94 
    95 Note that there must be one or more spaces preceding the list item markers, otherwise the list will be treated as a normal paragraph.
    96 
    97 
    98 == Definition Lists ==
    99 
    100 The wiki also supports definition lists.
    101 
    102 Example:
    103 {{{
    104  llama::
    105    some kind of mammal, with hair
    106  ppython::
    107    some kind of reptile, without hair
    108    (can you spot the typo?)
    109 }}}
    110 
    111 Display:
    112  llama::
    113    some kind of mammal, with hair
    114  ppython::
    115    some kind of reptile, without hair
    116    (can you spot the typo?)
    117 
    118 Note that you need a space in front of the defined term.
    119 
    120 
    121 == Preformatted Text ==
    122 
    123 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.
    124 
    125 Example:
    126 {{{
    127  {{{
    128   def HelloWorld():
    129       print "Hello World"
    130  }}}
    131 }}}
    132 
    133 Display:
    134 {{{
    135  def HelloWorld():
    136      print "Hello World"
    137 }}}
    138 
    139 
    140 == Blockquotes ==
    141 
    142 In order to mark a paragraph as blockquote, indent that paragraph with two spaces.
    143 
    144 Example:
    145 {{{
    146   This text is a quote from someone else.
    147 }}}
    148 
    149 Display:
    150   This text is a quote from someone else.
    151 
    152 == Tables ==
    153 
    154 Simple tables can be created like this:
    155 {{{
    156 ||Cell 1||Cell 2||Cell 3||
    157 ||Cell 4||Cell 5||Cell 6||
    158 }}}
    159 
    160 Display:
    161 ||Cell 1||Cell 2||Cell 3||
    162 ||Cell 4||Cell 5||Cell 6||
    163 
    164 Note that more complex tables can be created using
    165 [wiki:WikiRestructuredText#BiggerReSTExample reStructuredText].
    166 
    167 
    168 == Links ==
    169 
    170 Hyperlinks are automatically created for WikiPageNames and URLs. !WikiPageLinks can be disabled by prepending an exclamation mark "!" character, such as {{{!WikiPageLink}}}.
    171 
    172 Example:
    173 {{{
    174  TitleIndex, http://www.edgewall.com/, !NotAlink
    175 }}}
    176 
    177 Display:
    178  TitleIndex, http://www.edgewall.com/, !NotAlink
    179 
    180 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 disguarded, unless the link is an external link. This can be useful for wiki pages not adhering to the WikiPageNames convention.
    181 
    182 Example:
    183 {{{
    184  * [http://www.edgewall.com/ Edgewall Software]
    185  * [wiki:TitleIndex Title Index]
    186  * [wiki:ISO9000]
    187 }}}
    188 
    189 Display:
    190  * [http://www.edgewall.com/ Edgewall Software]
    191  * [wiki:TitleIndex Title Index]
    192  * [wiki:ISO9000]
    193 
    194 
    195 === Trac Links ===
    196 
    197 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:
    198 {{{
    199  * Tickets: #1 or ticket:1
    200  * Reports: {1} or report:1
    201  * Changesets: r1, [1] or changeset:1
    202  * Revision Logs: r1:3, [1:3] or log:branches/0.8-stable#1:3
    203  * Wiki pages: CamelCase or wiki:CamelCase
    204  * Milestones: milestone:1.0 or milestone:"End-of-days Release"
    205  * Files: source:trunk/COPYING
    206  * Attachments: attachment:"file name.doc"
    207  * A specific file revision: source:/trunk/COPYING#200
    208  * A filename with embedded space: source:"/trunk/README FIRST"
    209 }}}
    210 
    211 Display:
    212  * Tickets: #1 or ticket:1
    213  * Reports: {1} or report:1
    214  * Changesets: r1, [1] or changeset:1
    215  * Revision Logs: r1:3, [1:3] or log:branches/0.8-stable#1:3
    216  * Wiki pages: CamelCase or wiki:CamelCase
    217  * Milestones: milestone:1.0 or milestone:"End-of-days Release"
    218  * Files: source:trunk/COPYING
    219  * Attachments: attachment:"file name.doc"
    220  * A specific file revision: source:/trunk/COPYING#200
    221  * A filename with embedded space: source:"/trunk/README FIRST"
    222 
    223 See TracLinks for more in-depth information.
    224 
    225 
    226 == Escaping Links and WikiPageNames ==
    227 
    228 You may avoid making hyperlinks out of TracLinks by preceding an expression with a single "!" (exclamation mark).
    229 
    230 Example:
    231 {{{
    232  !NoHyperLink
    233  !#42 is not a link
    234 }}}
    235 
    236 Display:
    237  !NoHyperLink
    238  !#42 is not a link
    239 
    240 
    241 == Images ==
    242 
    243 Urls ending with `.png`, `.gif` or `.jpg` are automatically interpreted as image links, and converted to `<img>` tags.
    244 
    245 Example:
    246 {{{
    247 http://www.edgewall.com/gfx/trac_example_image.png
    248 }}}
    249 
    250 Display:
    251 
    252 http://www.edgewall.com/gfx/trac_example_image.png
    253 
    254 However, this doesn't give much control over the display mode. This way of inserting images is deprecated in favor of the more powerful `Image` macro (see WikiMacros).
    255 
    256 
    257 == Macros ==
    258 
    259 Macros are ''custom functions'' to insert dynamic content in a page.
    260 
    261 Example:
    262 {{{
    263  [[Timestamp]]
    264 }}}
    265 
    266 Display:
    267  [[Timestamp]]
    268 
    269 See WikiMacros for more information, and a list of installed macros.
    270 
    271 
    272 == Processors ==
    273 
    274 Trac supports alternative markup formats using WikiProcessors. For example, processors are used to write pages in 
    275 [wiki:WikiRestructuredText reStructuredText] or [wiki:WikiHtml HTML]. 
    276 
    277 Example 1:
    278 {{{
    279 #!html
    280 <pre class="wiki">{{{
    281 #!html
    282 &lt;h1 style="text-align: right; color: blue"&gt;HTML Test&lt;/h1&gt;
    283 }}}</pre>
    284 }}}
    285 
    286 Display:
    287 {{{
    288 #!html
    289 <h1 style="text-align: right; color: blue">HTML Test</h1>
    290 }}}
    291 
    292 Example:
    293 {{{
    294 #!html
    295 <pre class="wiki">{{{
    296 #!python
    297 class Test:
    298     def __init__(self):
    299         print "Hello World"
    300 if __name__ == '__main__':
    301    Test()
    302 }}}</pre>
    303 }}}
    304 
    305 Display:
    306 {{{
    307 #!python
    308 class Test:
    309     def __init__(self):
    310         print "Hello World"
    311 if __name__ == '__main__':
    312    Test()
    313 }}}
    314 
    315 Perl:
    316 {{{
    317 #!perl
    318 my ($test) = 0;
    319 if ($test > 0) {
    320 echo "hello";
    321 }
    322 }}}
    323 
    324 See WikiProcessors for more information.
    325 
    326 
    327 == Miscellaneous ==
    328 
    329 Four or more dashes will be replaced by a horizontal line (<HR>)
    330 
    331 Example:
    332 {{{
    333  ----
    334 }}}
    335 
    336 Display:
    337 ----
    338 
    339 
    340 ----
    341 See also: TracLinks, TracGuide, WikiHtml, WikiMacros, WikiProcessors, TracSyntaxColoring.
     1= WikiFormatting =
     2[[TracGuideToc]]
     3
     4Wiki markup is a core feature in Trac, tightly integrating all the other parts of Trac into a flexible and powerful whole.
     5
     6Trac 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,
     7especially [http://moinmoin.wikiwikiweb.de/ MoinMoin].
     8
     9
     10This page demonstrates the formatting syntax available anywhere WikiFormatting is allowed.
     11
     12
     13== Font Styles ==
     14
     15The Trac wiki supports the following font styles:
     16{{{
     17 * '''bold''', '''!''' can be bold too''', and '''! '''
     18 * ''italic''
     19 * '''''bold italic'''''
     20 * __underline__
     21 * {{{monospace}}} or `monospace`
     22 * ~~strike-through~~
     23 * ^superscript^
     24 * ,,subscript,,
     25}}}
     26
     27Display:
     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
     37Notes:
     38 * `{{{...}}}` 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
     43You can create heading by starting a line with one up to five ''equal'' characters ("=")
     44followed by a single space and the headline text. The line should end with a space
     45followed by the same number of ''='' characters.
     46The heading might optionally be followed by an explicit id. If not, an implicit but nevertheless readable id will be generated.
     47
     48Example:
     49{{{
     50= Heading =
     51== Subheading ==
     52=== About ''this'' ===
     53=== Explicit id === #using-explicit-id-in-heading
     54}}}
     55
     56Display:
     57= Heading =
     58== Subheading ==
     59=== About ''this'' ===
     60=== Explicit id === #using-explicit-id-in-heading
     61
     62== Paragraphs ==
     63
     64A new text paragraph is created whenever two blocks of text are separated by one or more empty lines.
     65
     66A forced line break can also be inserted, using:
     67{{{
     68Line 1[[BR]]Line 2
     69}}}
     70Display:
     71
     72Line 1[[BR]]Line 2
     73
     74
     75== Lists ==
     76
     77The wiki supports both ordered/numbered and unordered lists.
     78
     79Example:
     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
     95And numbered lists can also be given an explicit number:
     96 3. Item 3
     97}}}
     98
     99Display:
     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
     114And numbered lists can also be given an explicit number:
     115 3. Item 3
     116
     117Note 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
     122
     123The wiki also supports definition lists.
     124
     125Example:
     126{{{
     127 llama::
     128   some kind of mammal, with hair
     129 ppython::
     130   some kind of reptile, without hair
     131   (can you spot the typo?)
     132}}}
     133
     134Display:
     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
     141Note that you need a space in front of the defined term.
     142
     143
     144== Preformatted Text ==
     145
     146Block 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 
     148Example:
     149{{{
     150 {{{
     151  def HelloWorld():
     152      print "Hello World"
     153 }}}
     154}}}
     155
     156Display:
     157{{{
     158 def HelloWorld():
     159     print "Hello World"
     160}}}
     161
     162
     163== Blockquotes ==
     164
     165In order to mark a paragraph as blockquote, indent that paragraph with two spaces.
     166
     167Example:
     168{{{
     169  This text is a quote from someone else.
     170}}}
     171
     172Display:
     173  This text is a quote from someone else.
     174
     175== Discussion Citations ==
     176
     177To delineate a citation in an ongoing discussion thread, such as the ticket comment area, e-mail-like citation marks (">", ">>", etc.) may be used. 
     178
     179Example:
     180{{{
     181>> Someone's original text
     182> Someone else's reply text
     183My reply text
     184}}}
     185
     186Display:
     187>> Someone's original text
     188> Someone else's reply text
     189My 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
     195Simple tables can be created like this:
     196{{{
     197||Cell 1||Cell 2||Cell 3||
     198||Cell 4||Cell 5||Cell 6||
     199}}}
     200
     201Display:
     202||Cell 1||Cell 2||Cell 3||
     203||Cell 4||Cell 5||Cell 6||
     204
     205Note that more complex tables can be created using
     206[wiki:WikiRestructuredText#BiggerReSTExample reStructuredText].
     207
     208
     209== Links ==
     210
     211Hyperlinks are automatically created for WikiPageNames and URLs. !WikiPageLinks can be disabled by prepending an exclamation mark "!" character, such as {{{!WikiPageLink}}}.
     212
     213Example:
     214{{{
     215 TitleIndex, http://www.edgewall.com/, !NotAlink
     216}}}
     217
     218Display:
     219 TitleIndex, http://www.edgewall.com/, !NotAlink
     220
     221Links 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
     223Example:
     224{{{
     225 * [http://www.edgewall.com/ Edgewall Software]
     226 * [wiki:TitleIndex Title Index]
     227 * [wiki:ISO9000]
     228}}}
     229
     230Display:
     231 * [http://www.edgewall.com/ Edgewall Software]
     232 * [wiki:TitleIndex Title Index]
     233 * [wiki:ISO9000]
     234
     235== Trac Links ==
     236
     237Wiki 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
     245Display:
     246 * Tickets: #1 or ticket:1
     247 * Reports: {1} or report:1
     248 * Changesets: r1, [1] or changeset:1
     249 * ...
     250
     251There are many more flavors of Trac links, see TracLinks for more in-depth information.
     252
     253
     254== Escaping Links and WikiPageNames ==
     255
     256You may avoid making hyperlinks out of TracLinks by preceding an expression with a single "!" (exclamation mark).
     257
     258Example:
     259{{{
     260 !NoHyperLink
     261 !#42 is not a link
     262}}}
     263
     264Display:
     265 !NoHyperLink
     266 !#42 is not a link
     267
     268
     269== Images ==
     270
     271Urls ending with `.png`, `.gif` or `.jpg` are no longer automatically interpreted as image links, and converted to `<img>` tags.
     272
     273You now have to use the ![[Image]] macro. The simplest way to include an image is to upload it as attachment to the current page, and put the filename in a macro call like `[[Image(picture.gif)]]`.
     274
     275In addition to the current page, it is possible to refer to other resources:
     276 * `[[Image(wiki:WikiFormatting:picture.gif)]]` (referring to attachment on another page)
     277 * `[[Image(ticket:1:picture.gif)]]` (file attached to a ticket)
     278 * `[[Image(htdocs:picture.gif)]]` (referring to a file inside project htdocs)
     279 * `[[Image(source:/trunk/trac/htdocs/trac_logo_mini.png)]]` (a file in repository)
     280
     281Example display: [[Image(htdocs:../common/trac_logo_mini.png)]]
     282
     283
     284See WikiMacros for further documentation on the `[[Image()]]` macro.
     285
     286
     287== Macros ==
     288
     289Macros are ''custom functions'' to insert dynamic content in a page.
     290
     291Example:
     292{{{
     293 [[RecentChanges(Trac,3)]]
     294}}}
     295
     296Display:
     297 [[RecentChanges(Trac,3)]]
     298
     299See WikiMacros for more information, and a list of installed macros.
     300
     301
     302== Processors ==
     303
     304Trac supports alternative markup formats using WikiProcessors. For example, processors are used to write pages in
     305[wiki:WikiRestructuredText reStructuredText] or [wiki:WikiHtml HTML].
     306
     307Example 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
     316Display:
     317{{{
     318#!html
     319<h1 style="text-align: right; color: blue">HTML Test</h1>
     320}}}
     321
     322Example:
     323{{{
     324#!html
     325<pre class="wiki">{{{
     326#!python
     327class Test:
     328
     329    def __init__(self):
     330        print "Hello World"
     331if __name__ == '__main__':
     332   Test()
     333}}}</pre>
     334}}}
     335
     336Display:
     337{{{
     338#!python
     339class Test:
     340    def __init__(self):
     341        print "Hello World"
     342if __name__ == '__main__':
     343   Test()
     344}}}
     345
     346Perl:
     347{{{
     348#!perl
     349my ($test) = 0;
     350if ($test > 0) {
     351    print "hello";
     352}
     353}}}
     354
     355See WikiProcessors for more information.
     356
     357
     358== Comments ==
     359
     360Comments 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
     364Your comment here
     365}}}
     366}}}
     367
     368
     369== Miscellaneous ==
     370
     371Four or more dashes will be replaced by a horizontal line (<HR>)
     372
     373Example:
     374{{{
     375 ----
     376}}}
     377
     378Display:
     379----
     380
     381
     382
     383----
     384See also: TracLinks, TracGuide, WikiHtml, WikiMacros, WikiProcessors, TracSyntaxColoring.