Changes between Initial Version and Version 1 of WikiFormatting


Ignore:
Timestamp:
Feb 12, 2010, 3:46:17 PM (15 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiFormatting

    v1 v1  
     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
     205
     206Cell headings can be specified by wrapping the content in a pair of '=' characters.
     207Note that the '=' characters have to stick to the cell separators, like this:
     208{{{
     209||        ||= stable =||= latest =||
     210||= 0.10 =||  0.10.5  || 0.10.6dev||
     211||= 0.11 =||  0.11.6  || 0.11.7dev||
     212}}}
     213
     214Display:
     215||        ||= stable =||= latest =||
     216||= 0.10 =||  0.10.5  || 0.10.6dev||
     217||= 0.11 =||  0.11.6  || 0.11.7dev||
     218
     219Finally, specifying an empty cell means that the next non empty cell will span the empty cells. For example:
     220{{{
     221|| 1 || 2 || 3 ||
     222|||| 1 2 || 3 ||
     223|| 1 |||| 2 3 ||
     224|||||| 1 2 3 ||
     225}}}
     226
     227Display:
     228|| 1 || 2 || 3 ||
     229|||| 1 2 || 3 ||
     230|| 1 |||| 2 3 ||
     231|||||| 1 2 3 ||
     232
     233Note that more complex tables can be created using
     234[wiki:WikiRestructuredText#BiggerReSTExample reStructuredText].
     235
     236
     237== Links ==
     238
     239Hyperlinks are automatically created for WikiPageNames and URLs. !WikiPageLinks can be disabled by prepending an exclamation mark "!" character, such as {{{!WikiPageLink}}}.
     240
     241Example:
     242{{{
     243 TitleIndex, http://www.edgewall.com/, !NotAlink
     244}}}
     245
     246Display:
     247 TitleIndex, http://www.edgewall.com/, !NotAlink
     248
     249Links 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.
     250
     251Example:
     252{{{
     253 * [http://www.edgewall.com/ Edgewall Software]
     254 * [wiki:TitleIndex Title Index]
     255 * [wiki:ISO9000]
     256}}}
     257
     258Display:
     259 * [http://www.edgewall.com/ Edgewall Software]
     260 * [wiki:TitleIndex Title Index]
     261 * [wiki:ISO9000]
     262
     263== Trac Links ==
     264
     265Wiki 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:
     266{{{
     267 * Tickets: #1 or ticket:1
     268 * Reports: {1} or report:1
     269 * Changesets: r1, [1] or changeset:1
     270 * ...
     271}}}
     272
     273Display:
     274 * Tickets: #1 or ticket:1
     275 * Reports: {1} or report:1
     276 * Changesets: r1, [1] or changeset:1
     277 * ...
     278
     279There are many more flavors of Trac links, see TracLinks for more in-depth information.
     280
     281
     282== Escaping Links and WikiPageNames ==
     283
     284You may avoid making hyperlinks out of TracLinks by preceding an expression with a single "!" (exclamation mark).
     285
     286Example:
     287{{{
     288 !NoHyperLink
     289 !#42 is not a link
     290}}}
     291
     292Display:
     293 !NoHyperLink
     294 !#42 is not a link
     295
     296
     297== Images ==
     298
     299Urls ending with `.png`, `.gif` or `.jpg` are no longer automatically interpreted as image links, and converted to `<img>` tags.
     300
     301You 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)]]`.
     302
     303In addition to the current page, it is possible to refer to other resources:
     304 * `[[Image(wiki:WikiFormatting:picture.gif)]]` (referring to attachment on another page)
     305 * `[[Image(ticket:1:picture.gif)]]` (file attached to a ticket)
     306 * `[[Image(htdocs:picture.gif)]]` (referring to a file inside project htdocs)
     307 * `[[Image(source:/trunk/trac/htdocs/trac_logo_mini.png)]]` (a file in repository)
     308
     309Example display: [[Image(htdocs:../common/trac_logo_mini.png)]]
     310
     311See WikiMacros for further documentation on the `[[Image()]]` macro.
     312
     313
     314== Macros ==
     315
     316Macros are ''custom functions'' to insert dynamic content in a page.
     317
     318Example:
     319{{{
     320 [[RecentChanges(Trac,3)]]
     321}}}
     322
     323Display:
     324 [[RecentChanges(Trac,3)]]
     325
     326See WikiMacros for more information, and a list of installed macros.
     327
     328
     329== Processors ==
     330
     331Trac supports alternative markup formats using WikiProcessors. For example, processors are used to write pages in
     332[wiki:WikiRestructuredText reStructuredText] or [wiki:WikiHtml HTML].
     333
     334Example 1:
     335{{{
     336#!html
     337<pre class="wiki">{{{
     338#!html
     339&lt;h1 style="text-align: right; color: blue"&gt;HTML Test&lt;/h1&gt;
     340}}}</pre>
     341}}}
     342
     343Display:
     344{{{
     345#!html
     346<h1 style="text-align: right; color: blue">HTML Test</h1>
     347}}}
     348
     349Example:
     350{{{
     351#!html
     352<pre class="wiki">{{{
     353#!python
     354class Test:
     355
     356    def __init__(self):
     357        print "Hello World"
     358if __name__ == '__main__':
     359   Test()
     360}}}</pre>
     361}}}
     362
     363Display:
     364{{{
     365#!python
     366class Test:
     367    def __init__(self):
     368        print "Hello World"
     369if __name__ == '__main__':
     370   Test()
     371}}}
     372
     373Perl:
     374{{{
     375#!perl
     376my ($test) = 0;
     377if ($test > 0) {
     378    print "hello";
     379}
     380}}}
     381
     382See WikiProcessors for more information.
     383
     384
     385== Comments ==
     386
     387Comments can be added to the plain text. These will not be rendered and will not display in any other format than plain text.
     388{{{
     389{{{
     390#!comment
     391Your comment here
     392}}}
     393}}}
     394
     395
     396== Miscellaneous ==
     397
     398Four or more dashes will be replaced by a horizontal line (<HR>)
     399
     400Example:
     401{{{
     402 ----
     403}}}
     404
     405Display:
     406----
     407
     408
     409
     410----
     411See also: TracLinks, TracGuide, WikiHtml, WikiMacros, WikiProcessors, TracSyntaxColoring.