Changes between Initial Version and Version 1 of WikiFormatting


Ignore:
Timestamp:
Sep 9, 2006, 9:15:00 AM (11 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'''
     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'''
     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.
     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 2
     84
     85 1. Item 1
     86   a. Item 1.a
     87   a. Item 1.b
     88      i. Item 1.b.i
     89      i. Item 1.b.ii
     90 1. Item 2
     91And numbered lists can also be given an explicit number:
     92 3. Item 3
     93}}}
     94
     95Display:
     96 * Item 1
     97   * Item 1.1
     98 * Item 2
     99
     100 1. Item 1
     101   a. Item 1.a
     102   a. Item 1.b
     103      i. Item 1.b.i
     104      i. Item 1.b.ii
     105 1. Item 2
     106And numbered lists can also be given an explicit number:
     107 3. Item 3
     108
     109Note that there must be one or more spaces preceding the list item markers, otherwise the list will be treated as a normal paragraph.
     110
     111
     112== Definition Lists ==
     113
     114
     115The wiki also supports definition lists.
     116
     117Example:
     118{{{
     119 llama::
     120   some kind of mammal, with hair
     121 ppython::
     122   some kind of reptile, without hair
     123   (can you spot the typo?)
     124}}}
     125
     126Display:
     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
     133Note that you need a space in front of the defined term.
     134
     135
     136== Preformatted Text ==
     137
     138Block 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.
     139 
     140Example:
     141{{{
     142 {{{
     143  def HelloWorld():
     144      print "Hello World"
     145 }}}
     146}}}
     147
     148Display:
     149{{{
     150 def HelloWorld():
     151     print "Hello World"
     152}}}
     153
     154
     155== Blockquotes ==
     156
     157In order to mark a paragraph as blockquote, indent that paragraph with two spaces.
     158
     159Example:
     160{{{
     161  This text is a quote from someone else.
     162}}}
     163
     164Display:
     165  This text is a quote from someone else.
     166
     167== Discussion Citations ==
     168
     169To delineate a citation in an ongoing discussion thread, such as the ticket comment area, e-mail-like citation marks (">", ">>", etc.) may be used. 
     170
     171Example:
     172{{{
     173>> Someone's original text
     174> Someone else's reply text
     175My reply text
     176}}}
     177
     178Display:
     179>> Someone's original text
     180> Someone else's reply text
     181My reply text
     182
     183''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.''
     184
     185== Tables ==
     186
     187Simple tables can be created like this:
     188{{{
     189||Cell 1||Cell 2||Cell 3||
     190||Cell 4||Cell 5||Cell 6||
     191}}}
     192
     193Display:
     194||Cell 1||Cell 2||Cell 3||
     195||Cell 4||Cell 5||Cell 6||
     196
     197Note that more complex tables can be created using
     198[wiki:WikiRestructuredText#BiggerReSTExample reStructuredText].
     199
     200
     201== Links ==
     202
     203Hyperlinks are automatically created for WikiPageNames and URLs. !WikiPageLinks can be disabled by prepending an exclamation mark "!" character, such as {{{!WikiPageLink}}}.
     204
     205Example:
     206{{{
     207 TitleIndex, http://www.edgewall.com/, !NotAlink
     208}}}
     209
     210Display:
     211 TitleIndex, http://www.edgewall.com/, !NotAlink
     212
     213Links 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.
     214
     215Example:
     216{{{
     217 * [http://www.edgewall.com/ Edgewall Software]
     218 * [wiki:TitleIndex Title Index]
     219 * [wiki:ISO9000]
     220}}}
     221
     222Display:
     223 * [http://www.edgewall.com/ Edgewall Software]
     224 * [wiki:TitleIndex Title Index]
     225 * [wiki:ISO9000]
     226
     227
     228=== Trac Links ===
     229
     230Wiki 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:
     231{{{
     232 * Tickets: #1 or ticket:1
     233 * Reports: {1} or report:1
     234 * Changesets: r1, [1] or changeset:1
     235 * Revision Logs: r1:3, [1:3] or log:branches/0.8-stable@1:3
     236 * Wiki pages: CamelCase or wiki:CamelCase
     237 * Milestones: milestone:1.0 or milestone:"End-of-days Release"
     238 * Files: source:trunk/COPYING
     239 * Wiki Attachments: attachment:sample_attachment.txt
     240 * Ticket Attachments: attachment:ticket:944:attachment.1073.diff
     241 * A specific file revision: source:/trunk/COPYING@200
     242 * A particular line of a specific file revision: source:/trunk/COPYING@200#L25
     243 * A filename with embedded space: source:"/trunk/README FIRST"
     244}}}
     245
     246Display:
     247 * Tickets: #1 or ticket:1
     248 * Reports: {1} or report:1
     249 * Changesets: r1, [1] or changeset:1
     250 * Revision Logs: r1:3, [1:3] or log:branches/0.8-stable@1:3
     251 * Wiki pages: CamelCase or wiki:CamelCase
     252 * Milestones: milestone:1.0 or milestone:"End-of-days Release"
     253 * Files: source:trunk/COPYING
     254 * Wiki Attachments: attachment:sample_attachment.txt
     255 * Ticket Attachments: attachment:ticket:944:attachment.1073.diff
     256 * A specific file revision: source:/trunk/COPYING@200
     257 * A particular line of a specific file revision: source:/trunk/COPYING@200#L25
     258 * A filename with embedded space: source:"/trunk/README FIRST"
     259
     260See TracLinks for more in-depth information.
     261
     262
     263== Escaping Links and WikiPageNames ==
     264
     265You may avoid making hyperlinks out of TracLinks by preceding an expression with a single "!" (exclamation mark).
     266
     267Example:
     268{{{
     269 !NoHyperLink
     270 !#42 is not a link
     271}}}
     272
     273Display:
     274 !NoHyperLink
     275 !#42 is not a link
     276
     277
     278== Images ==
     279
     280Urls ending with `.png`, `.gif` or `.jpg` are automatically interpreted as image links, and converted to `<img>` tags.
     281
     282Example:
     283{{{
     284http://www.edgewall.com/gfx/trac_example_image.png
     285}}}
     286
     287Display:
     288
     289http://www.edgewall.com/gfx/trac_example_image.png
     290
     291However, 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).
     292
     293
     294== Macros ==
     295
     296Macros are ''custom functions'' to insert dynamic content in a page.
     297
     298Example:
     299{{{
     300 [[Timestamp]]
     301}}}
     302
     303Display:
     304 [[Timestamp]]
     305
     306See WikiMacros for more information, and a list of installed macros.
     307
     308
     309== Processors ==
     310
     311Trac supports alternative markup formats using WikiProcessors. For example, processors are used to write pages in
     312[wiki:WikiRestructuredText reStructuredText] or [wiki:WikiHtml HTML].
     313
     314Example 1:
     315{{{
     316#!html
     317<pre class="wiki">{{{
     318#!html
     319&lt;h1 style="text-align: right; color: blue"&gt;HTML Test&lt;/h1&gt;
     320}}}</pre>
     321}}}
     322
     323Display:
     324{{{
     325#!html
     326<h1 style="text-align: right; color: blue">HTML Test</h1>
     327}}}
     328
     329Example:
     330{{{
     331#!html
     332<pre class="wiki">{{{
     333#!python
     334class Test:
     335
     336    def __init__(self):
     337        print "Hello World"
     338if __name__ == '__main__':
     339   Test()
     340}}}</pre>
     341}}}
     342
     343Display:
     344{{{
     345#!python
     346class Test:
     347    def __init__(self):
     348        print "Hello World"
     349if __name__ == '__main__':
     350   Test()
     351}}}
     352
     353Perl:
     354{{{
     355#!perl
     356my ($test) = 0;
     357if ($test > 0) {
     358echo "hello";
     359}
     360}}}
     361
     362See WikiProcessors for more information.
     363
     364
     365== Miscellaneous ==
     366
     367Four or more dashes will be replaced by a horizontal line (<HR>)
     368
     369Example:
     370{{{
     371 ----
     372}}}
     373
     374Display:
     375----
     376
     377
     378----
     379See also: TracLinks, TracGuide, WikiHtml, WikiMacros, WikiProcessors, TracSyntaxColoring.