Changes between Version 5 and Version 6 of WikiFormatting


Ignore:
Timestamp:
07/26/09 20:51:22 (16 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiFormatting

    v5 v6  
    1  
    21= WikiFormatting = 
    3  
    4 Wiki markup is a core feature in Trac, tightly integrating all the other parts of Trac into 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 especially [http://moin.sf.net/ MoinWiki].  
     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 
    79 
    810This page demonstrates the formatting syntax available anywhere WikiFormatting is allowed. 
    911 
    10 == Font styles == 
    11  
    12 The Trac wiki support the following font styles: '''bold''', ''italic'', 
    13 __underline__ and ~~strike-through~~. 
    14  
    15 {{{ 
    16 The Trac wiki support the following font styles: '''bold''', ''italic'', 
    17 __underline__ and ~~strike-through~~. 
    18 }}} 
    19  
    20  
    21 == Heading == 
    22  
    23 You can create heading by starting a line with one up to five ''equal\\ '=' characters 
     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 ("=") 
    2444followed by a single space and the headline text. The line should end with a space  
    25 followed by the same number of ''equal'' characters.  
    26  
    27 ''Note: As of writing, headings cannot contain TracLinks.'' 
    28  
    29 === Example: === 
     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: 
    3049{{{ 
    3150= Heading = 
    3251== Subheading == 
    33 }}} 
    34  
     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 
    3561 
    3662== Paragraphs == 
    3763 
    38 A new text paragraph is created whenever two blocks of text are separated 
    39 by one or more empty lines. 
     64A new text paragraph is created whenever two blocks of text are separated by one or more empty lines. 
    4065 
    4166A forced line break can also be inserted, using: 
     
    4772Line 1[[BR]]Line 2 
    4873 
    49   Text paragraphs can be indented by starting the lines with two or more spaces. 
    5074 
    5175== Lists == 
     76 
    5277The wiki supports both ordered/numbered and unordered lists. 
    5378 
     
    5681 * Item 1 
    5782   * Item 1.1 
     83      * Item 1.1.1    
     84      * Item 1.1.2 
     85      * Item 1.1.3 
     86   * Item 1.2 
    5887 * Item 2 
    5988 
    6089 1. Item 1 
    61    1. Item 1.1 
     90   a. Item 1.a 
     91   a. Item 1.b 
     92      i. Item 1.b.i 
     93      i. Item 1.b.ii 
    6294 1. Item 2 
    63 }}} 
     95And numbered lists can also be given an explicit number: 
     96 3. Item 3 
     97}}} 
     98 
    6499Display: 
    65100 * Item 1 
    66101   * Item 1.1 
     102      * Item 1.1.1 
     103      * Item 1.1.2 
     104      * Item 1.1.3 
     105   * Item 1.2 
    67106 * Item 2 
    68107 
    69108 1. Item 1 
    70    1. Item 1.1 
     109   a. Item 1.a 
     110   a. Item 1.b 
     111      i. Item 1.b.i 
     112      i. Item 1.b.ii 
    71113 1. Item 2 
    72  
    73 == Preformatted text == 
    74 Block quotes, preformatted text, are suitable for source code snippets, notes and examples. Use three ''curly braces'' wrapped around the text to define a block quote: 
     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. 
    75147   
    76148Example: 
    77149{{{ 
    78150 {{{ 
    79   def HelloWorld() 
    80       print "Hello World" 
     151  def HelloWorld(): 
     152      print "Hello World" 
    81153 }}} 
    82154}}} 
     
    84156Display: 
    85157{{{ 
    86  def HelloWorld() 
    87      print "Hello World" 
    88 }}} 
     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.'' 
    89192 
    90193== Tables == 
     
    95198||Cell 4||Cell 5||Cell 6|| 
    96199}}} 
     200 
    97201Display: 
    98202||Cell 1||Cell 2||Cell 3|| 
    99203||Cell 4||Cell 5||Cell 6|| 
    100204 
     205Note that more complex tables can be created using 
     206[wiki:WikiRestructuredText#BiggerReSTExample reStructuredText]. 
     207 
     208 
    101209== Links == 
    102210 
    103 !Hyperlinks are automatically created for WikiPageNames and urls. !WikiPageLinks can be disabled by 
    104 prepending an exclamation mark (!) character, such as {{{!WikiPageLink}}}. 
    105  
    106 Examples: 
    107  
    108  TitleIndex, http://www.edgewall.com/. 
    109  
    110 Links can be given a more descriptive title by writing the link followed by 
    111 a space and a title and all this inside two square brackets. Like this: 
     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: 
    112224{{{ 
    113225 * [http://www.edgewall.com/ Edgewall Software] 
    114226 * [wiki:TitleIndex Title Index] 
    115 }}} 
    116 Display: 
    117  
     227 * [wiki:ISO9000] 
     228}}} 
     229 
     230Display: 
    118231 * [http://www.edgewall.com/ Edgewall Software] 
    119232 * [wiki:TitleIndex Title Index] 
    120  
    121 === Trac Links === 
    122  
    123 Wiki pages can link directly to other parts of the Trac system. 
    124 Pages can refer to tickets, reports, changesets, milestones, source files and 
    125 other Wiki pages using the following notation: 
    126  * Tickets: '''!#1''' or '''!ticket:1''' 
    127  * Reports: '''!{1}''' or '''!report:1''' 
    128  * Changesets: '''![1]''' or '''!changeset:1''' 
    129  * Wiki pages: '''CamelCase''' or '''!wiki:CamelCase''' 
    130  * Milestones: '''!milestone:1.0''' 
    131  * Files: '''!source:trunk/COPYING''' 
    132  * A specific file revision: '''!source:/trunk/COPYING#200''' 
    133 Display: 
     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{{{ 
    134239 * Tickets: #1 or ticket:1 
    135240 * Reports: {1} or report:1 
    136  * Changesets: [1] or changeset:1 
    137  * Wiki pages: CamelCase or wiki:CamelCase 
    138  * Milestones: milestone:1.0 
    139  * Files: source:trunk/COPYING 
    140  * A specific file revision: source:/trunk/COPYING#200 
    141  
    142 See TracLinks for more in-depth information. 
    143  
    144 == Escaping Links and WikiNames == 
    145 You may avoid making hyperlinks out of TracLinks by preceding an expression with a single '!' (exclamation mark). 
    146  
     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: 
    147259{{{ 
    148260 !NoHyperLink 
     
    154266 !#42 is not a link 
    155267 
     268 
    156269== Images == 
    157270 
    158 Urls ending with .png, .gif or .jpg are automatically interpreted as image links, and converted to IMG tags. 
    159  
    160 Example: 
    161 {{{ 
    162 http://www.edgewall.com/gfx/trac_example_image.png 
    163 }}} 
    164 Display: 
    165  
    166 http://www.edgewall.com/gfx/trac_example_image.png 
     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 
    167286 
    168287== Macros == 
    169 Macros are ''custom functions'' to insert dynamic content in a page. See WikiMacros for usage. 
    170  
    171 Example: 
    172 {{{ 
    173  [[Timestamp]] 
    174 }}} 
    175 Display: 
    176  [[Timestamp]] 
     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 
    177301 
    178302== Processors == 
    179 Trac supports alternative markup formats using WikiProcessors. For example, processors are used to write pages in [wiki:WikiRestructuredText reStructuredText] or [wiki:WikiHtml HTML].  
    180  
    181 See WikiProcessors for more information. 
    182  
    183 '''Example 1:''' 
     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: 
    184308{{{ 
    185309#!html 
    186 &amp;lt;pre class=&amp;#34;wiki&amp;#34;&amp;gt;{{{ 
     310<pre class="wiki">{{{ 
    187311#!html 
    188 &amp;amp;lt;h1 style=&amp;#34;text-align: right; color: blue&amp;#34;&amp;amp;gt;HTML Test&amp;amp;lt;/h1&amp;amp;gt; 
    189 }}}&amp;lt;/pre&amp;gt; 
    190 }}} 
     312&lt;h1 style="text-align: right; color: blue"&gt;HTML Test&lt;/h1&gt; 
     313}}}</pre> 
     314}}} 
     315 
    191316Display: 
    192317{{{ 
    193318#!html 
    194 &amp;lt;h1 style=&amp;#34;text-align: right; color: blue&amp;#34;&amp;gt;HTML Test&amp;lt;/h1&amp;gt; 
    195 }}} 
    196  
    197 '''Example 2:''' 
     319<h1 style="text-align: right; color: blue">HTML Test</h1> 
     320}}} 
     321 
     322Example: 
    198323{{{ 
    199324#!html 
    200 &amp;lt;pre class=&amp;#34;wiki&amp;#34;&amp;gt;{{{ 
     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{{{ 
    201338#!python 
    202339class Test: 
    203340    def __init__(self): 
    204         print &amp;#34;Hello World&amp;#34; 
     341        print "Hello World" 
    205342if __name__ == '__main__': 
    206343   Test() 
    207 }}}&amp;lt;/pre&amp;gt; 
    208 }}} 
    209 Display: 
    210 {{{ 
    211 #!python 
    212 class Test: 
    213     def __init__(self): 
    214         print &amp;#34;Hello World&amp;#34; 
    215 if __name__ == '__main__': 
    216    Test() 
    217 }}} 
     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 
    218368 
    219369== Miscellaneous == 
    220370 
    221 Four or more dashes will be replaced by a horizontal line (&amp;lt;HR&amp;gt;) 
    222  
     371Four or more dashes will be replaced by a horizontal line (<HR>) 
     372 
     373Example: 
    223374{{{ 
    224375 ---- 
     
    227378Display: 
    228379---- 
     380 
    229381 
    230382 
    231383---- 
    232384See also: TracLinks, TracGuide, WikiHtml, WikiMacros, WikiProcessors, TracSyntaxColoring. 
    233