Changes between Version 1 and Version 2 of WikiFormatting


Ignore:
Timestamp:
01/23/07 01:33:03 (18 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiFormatting

    v1 v2  
    11= WikiFormatting = 
    2  
    3 Wiki markup is a core feature in Trac, tightly integrating all the other parts of Trac into flexible and powerful whole. 
    4  
    5 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 
    69 
    710This page demonstrates the formatting syntax available anywhere WikiFormatting is allowed. 
    811 
    9 == Font styles == 
    10  
    11 The Trac wiki support the following font styles: '''bold''', ''italic'', 
    12 __underline__ and ~~strike-through~~. 
    13  
    14 {{{ 
    15 The Trac wiki support the following font styles: '''bold''', ''italic'', 
    16 __underline__ and ~~strike-through~~. 
    17 }}} 
    18  
    19  
    20 == Heading == 
    21  
    22 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 ("=") 
    2344followed by a single space and the headline text. The line should end with a space  
    24 followed by the same number of ''equal'' characters.  
    25  
    26 ''Note: As of writing, headings cannot contain TracLinks.'' 
    27  
    28 === 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: 
    2949{{{ 
    3050= Heading = 
    3151== Subheading == 
    32 }}} 
    33  
     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 
    3461 
    3562== Paragraphs == 
    3663 
    37 A new text paragraph is created whenever two blocks of text are separated 
    38 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. 
    3965 
    4066A forced line break can also be inserted, using: 
     
    4672Line 1[[BR]]Line 2 
    4773 
    48   Text paragraphs can be indented by starting the lines with two or more spaces. 
    4974 
    5075== Lists == 
     76 
    5177The wiki supports both ordered/numbered and unordered lists. 
    5278 
     
    5884 
    5985 1. Item 1 
    60    1. Item 1.1 
     86   a. Item 1.a 
     87   a. Item 1.b 
     88      i. Item 1.b.i 
     89      i. Item 1.b.ii 
    6190 1. Item 2 
    62 }}} 
     91And numbered lists can also be given an explicit number: 
     92 3. Item 3 
     93}}} 
     94 
    6395Display: 
    6496 * Item 1 
     
    6799 
    68100 1. Item 1 
    69    1. Item 1.1 
     101   a. Item 1.a 
     102   a. Item 1.b 
     103      i. Item 1.b.i 
     104      i. Item 1.b.ii 
    70105 1. Item 2 
    71  
    72 == Preformatted text == 
    73 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: 
     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. 
    74139   
    75140Example: 
    76141{{{ 
    77142 {{{ 
    78   def HelloWorld() 
     143  def HelloWorld(): 
    79144      print "Hello World" 
    80145 }}} 
     
    83148Display: 
    84149{{{ 
    85  def HelloWorld() 
     150 def HelloWorld(): 
    86151     print "Hello World" 
    87152}}} 
     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.'' 
    88184 
    89185== Tables == 
     
    94190||Cell 4||Cell 5||Cell 6|| 
    95191}}} 
     192 
    96193Display: 
    97194||Cell 1||Cell 2||Cell 3|| 
    98195||Cell 4||Cell 5||Cell 6|| 
    99196 
     197Note that more complex tables can be created using 
     198[wiki:WikiRestructuredText#BiggerReSTExample reStructuredText]. 
     199 
     200 
    100201== Links == 
    101202 
    102 !Hyperlinks are automatically created for WikiPageNames and urls. !WikiPageLinks can be disabled by 
    103 prepending an exclamation mark (!) character, such as {{{!WikiPageLink}}}. 
    104  
    105 Examples: 
    106  
    107  TitleIndex, http://www.edgewall.com/. 
    108  
    109 Links can be given a more descriptive title by writing the link followed by 
    110 a space and a title and all this inside two square brackets. Like this: 
     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: 
    111216{{{ 
    112217 * [http://www.edgewall.com/ Edgewall Software] 
    113218 * [wiki:TitleIndex Title Index] 
    114 }}} 
    115 Display: 
    116  
     219 * [wiki:ISO9000] 
     220}}} 
     221 
     222Display: 
    117223 * [http://www.edgewall.com/ Edgewall Software] 
    118224 * [wiki:TitleIndex Title Index] 
     225 * [wiki:ISO9000] 
     226 
    119227 
    120228=== Trac Links === 
    121229 
    122 Wiki pages can link directly to other parts of the Trac system. 
    123 Pages can refer to tickets, reports, changesets, milestones, source files and 
    124 other Wiki pages using the following notation: 
    125  * Tickets: '''!#1''' or '''!ticket:1''' 
    126  * Reports: '''!{1}''' or '''!report:1''' 
    127  * Changesets: '''![1]''' or '''!changeset:1''' 
    128  * Wiki pages: '''CamelCase''' or '''!wiki:CamelCase''' 
    129  * Milestones: '''!milestone:1.0''' 
    130  * Files: '''!source:trunk/COPYING''' 
    131  * A specific file revision: '''!source:/trunk/COPYING#200''' 
    132 Display: 
     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{{{ 
    133232 * Tickets: #1 or ticket:1 
    134233 * Reports: {1} or report:1 
    135  * Changesets: [1] or changeset:1 
    136  * Wiki pages: CamelCase or wiki:CamelCase 
    137  * Milestones: milestone:1.0 
    138  * Files: source:trunk/COPYING 
    139  * A specific file revision: source:/trunk/COPYING#200 
     234 * Changesets: r1, [1] or changeset:1 
     235 * ... 
     236}}} 
     237 
     238Display: 
     239 * Tickets: #1 or ticket:1 
     240 * Reports: {1} or report:1 
     241 * Changesets: r1, [1] or changeset:1 
     242 * ...  
    140243 
    141244See TracLinks for more in-depth information. 
    142245 
    143 == Escaping Links and WikiNames == 
    144 You may avoid making hyperlinks out of TracLinks by preceding an expression with a single '!' (exclamation mark). 
    145  
     246 
     247== Escaping Links and WikiPageNames == 
     248 
     249You may avoid making hyperlinks out of TracLinks by preceding an expression with a single "!" (exclamation mark). 
     250 
     251Example: 
    146252{{{ 
    147253 !NoHyperLink 
     
    153259 !#42 is not a link 
    154260 
     261 
    155262== Images == 
    156263 
    157 Urls ending with .png, .gif or .jpg are automatically interpreted as image links, and converted to IMG tags. 
    158  
    159 Example: 
    160 {{{ 
    161 http://www.edgewall.com/gfx/trac_example_image.png 
    162 }}} 
    163 Display: 
    164  
    165 http://www.edgewall.com/gfx/trac_example_image.png 
     264Urls ending with `.png`, `.gif` or `.jpg` are no longer automatically interpreted as image links, and converted to `<img>` tags. 
     265 
     266You now have to use the ![[Image]] macro (see below). 
     267 
    166268 
    167269== Macros == 
    168 Macros are ''custom functions'' to insert dynamic content in a page. See WikiMacros for usage. 
     270 
     271Macros are ''custom functions'' to insert dynamic content in a page. 
    169272 
    170273Example: 
     
    172275 [[Timestamp]] 
    173276}}} 
     277 
    174278Display: 
    175279 [[Timestamp]] 
    176280 
     281See WikiMacros for more information, and a list of installed macros. 
     282 
     283 
    177284== Processors == 
    178 Trac supports alternative markup formats using WikiProcessors. For example, processors are used to write pages in [wiki:WikiRestructuredText reStructuredText] or [wiki:WikiHtml HTML].  
    179  
    180 See WikiProcessors for more information. 
    181  
    182 '''Example 1:''' 
     285 
     286Trac supports alternative markup formats using WikiProcessors. For example, processors are used to write pages in  
     287[wiki:WikiRestructuredText reStructuredText] or [wiki:WikiHtml HTML].  
     288 
     289Example 1: 
    183290{{{ 
    184291#!html 
     
    188295}}}</pre> 
    189296}}} 
     297 
    190298Display: 
    191299{{{ 
     
    194302}}} 
    195303 
    196 '''Example 2:''' 
     304Example: 
    197305{{{ 
    198306#!html 
    199307<pre class="wiki">{{{ 
     308#!python 
     309class Test: 
     310 
     311    def __init__(self): 
     312        print "Hello World" 
     313if __name__ == '__main__': 
     314   Test() 
     315}}}</pre> 
     316}}} 
     317 
     318Display: 
     319{{{ 
    200320#!python 
    201321class Test: 
     
    204324if __name__ == '__main__': 
    205325   Test() 
    206 }}}</pre> 
    207 }}} 
    208 Display: 
    209 {{{ 
    210 #!python 
    211 class Test: 
    212     def __init__(self): 
    213         print "Hello World" 
    214 if __name__ == '__main__': 
    215    Test() 
    216 }}} 
     326}}} 
     327 
     328Perl: 
     329{{{ 
     330#!perl 
     331my ($test) = 0; 
     332if ($test > 0) { 
     333    print "hello"; 
     334} 
     335}}} 
     336 
     337See WikiProcessors for more information. 
     338 
    217339 
    218340== Miscellaneous == 
     
    220342Four or more dashes will be replaced by a horizontal line (<HR>) 
    221343 
     344Example: 
    222345{{{ 
    223346 ---- 
     
    230353---- 
    231354See also: TracLinks, TracGuide, WikiHtml, WikiMacros, WikiProcessors, TracSyntaxColoring. 
    232