Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 23 and Version 24 of WikiFormatting


Ignore:
Timestamp:
Aug 30, 2006, 6:04:11 PM (18 years ago)
Author:
trac
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • WikiFormatting

    v23 v24  
    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
    912
    10 == Trac Hacks: !AddComment ==
    11 Add comments to a page:
    12 
    13 {{{ [[AddComment(appendonly)]] }}}
    14 
    15 Has following result:
    16 ==== Comment by patrick on Wed Mar 22 14:54:23 2006 ====
    17 Test a Test
    18 
    19 ==== Comment by patrick on Wed Apr 12 12:38:50 2006 ====
    20 another thest
    21 
    22 ==== Comment by anonymous on Tue Jun 20 12:28:04 2006 ====
    23 and another test
    24 
    25 ==== Comment by anonymous on Sat Jul 15 11:21:17 2006 ====
    26 ![[AddComment(appendonly)]]
    27 
    28 [[AddComment(appendonly)]]
    29 
    30 
    31 == Trac Hacks: Polling ==
    32 Adds a polling to a site, syntax:
    33 {{{ [[Poll(What do you think of the Poll macro?; Cool; Crap)]] }}}
    34 Results in:
    35 [[Poll(What do you think of the Poll macro?; Cool; Crap)]]
    36 
    37 
    38 == Trac Hacks: Ticket Box ==
    39 Simple list of tickets by specifiying ticket numbers. '#' character can be omitted:
    40 [[TicketBox(#1,#7,#31)]]
    41 {{{
    42 [[TicketBox(#1,#7,#31)]]
    43 [[TicketBox(1,7,31)]]
    44 }}}
    45 
    46 List tickets expanded from the report result. Third example uses dynamic variable. The special variable 'USER' can be specified. If not specified, login name (or anonymous) is used:
    47 {{{
    48 [[TicketBox({1})]]
    49 [[TicketBox([report:1])]]
    50 [[TicketBox([report:9?COMPONENT=TicketBox])]]
    51 [[TicketBox([report:9?USER=foo])]]
    52 }}}
    53 Combination of above is allowed. The tickets are listed as sorted and uniq'ed:
    54 {{{
    55 [[TicketBox({1),#50,{2},100)]]
    56 }}}
    57 Specifying a size of the box:
    58 {{{
    59 [[TicketBox(500pt,{1})]]
    60 [[TicketBox(200px,{1})]]
    61 [[TicketBox(25%,{1})]]
    62 }}}
    63 Specifying a title of the box. single and double quoted string are allowed. If '%d' in title string will be replaced with count of tickets:
    64 {{{
    65 [[TicketBox('Related Tickets',#1,#2)]]
    66 [[TicketBox("Related Tickets",#1,#2)]]
    67 [[TicketBox("There are %d tickets",{1})]]
    68 }}}
    69 
    70 
    71 == Trac Hack: Repos log ==
    72 Display change log for this plugin, back 5 revisions.
    73 
    74 {{{ [[ChangeLog(/changelogplugin, 5)]] }}}
    75 
    76 results in:
    77 [[ChangeLog(/trunk, 5)]]
    78 
    79 
    80 == Trac Hack: Table of Content ==
    81 The TocMacro generates a table of contents for the current page or a set of pages.
    82 
    83 If no arguments are given, a table of contents is generated for the current page, with the top-level title stripped:
    84 
    85 {{{
    86 [[TOC]]
    87 }}}
    88 [[TOC]]
    89 To generate a table of contents for a set of pages, simply pass them as comma separated arguments to the TOC macro. This is the macro call for the table of contents visible on the right side of this page:
    90 
    91 {{{
    92 [[TOC(TracGuide, TracInstall, TracUpgrade, TracIni, TracAdmin, TracBackup, TracLogging,
    93 TracPermissions, TracWiki, WikiFormatting, TracBrowser, TracRoadmap, TracChangeset,
    94 TracTickets, TracReports, TracQuery, TracTimeline, TracRss, TracNotification)]]
    95 }}}
    96 
    97 The following ''control'' arguments change the default behaviour of the TOC macro:
    98 
    99 || '''Argument''' || '''Meaning''' ||
    100 || {{{heading=<x>}}} || Override the default heading of "Table of Contents" ||
    101 || {{{noheading}}} || Suppress display of the heading. ||
    102 || {{{depth=<n>}}} || Display headings of ''subsequent'' pages to a maximum depth of '''<n>'''. ||
    103 || {{{inline}}} || Display TOC inline rather than as a side-bar. ||
    104 || {{{titleindex}}} || Only display the page name and title of each page, similar to TitleIndex. ||
    105 
    106 
    107 == Track Hack: Emoticons ==
    108 Recognized patterns:
    109 || smile ||  :-) || `:-)` || `:)` || || ||
    110 || happy || :-D || `:-D` || `:D` || || ||
    111 || wink || ;-) || `;-)` || `;)` || || ||
    112 || cool || B-) || `B-)` || `B)` || `8-)` || `8)` ||
    113 || suprised || :-o || `:-o` || `:o` || `:-O` || `:O` ||
    114 || razz || :-P || `:-P` || `:P` || || ||
    115 || frown || :-( || `:-(` || `:(` || || ||
    116 || stoic || :-| || `:-|` || `:|` || || ||
    117 || annoyed || :-/ || `:-/` || `:/` || || ||
    118 
    119 
    120 == Trac Hack: Wikiinfo ==
    121 Latest version of wikipage:
    122 {{{
    123 Version [[Wikinfo(version)]]
    124 }}}
    125 result: Version [[Wikinfo(version)]]
    126 
    127 Page originally created by:
    128 {{{
    129 Created by [[Wikinfo(author)]]
    130 }}}
    131 resulst: Created by [[Wikinfo(author)]]
    132 
    133 Page last modified by:
    134 {{{
    135 Modified by [[Wikinfo(changed_by)]]
    136 }}}
    137 result: Modified by [[Wikinfo(changed_by)]]
    138 
    139 Page last modified timestamp:
    140 {{{
    141 [[Wikinfo(changed_ts)]]
    142 }}}
    143 result: [[Wikinfo(changed_ts)]]
    144 
    145 Last edit comment:
    146 {{{
    147 ([[Wikinfo(comment)]])
    148 }}}
    149 result: ([[Wikinfo(comment)]])
    150 
    151 
    152 
    153 == Font styles ==
    154 
    155 The Trac wiki support the following font styles: '''bold''', ''italic'',
    156 __underline__ and ~~strike-through~~.
    157 
    158 {{{
    159 The Trac wiki support the following font styles: '''bold''', ''italic'',
    160 __underline__ and ~~strike-through~~.
    161 }}}
    162 
    163 
    164 == Heading ==
    165 
    166 You can create heading by starting a line with one up to five ''equal\\ '=' characters
     13== Font Styles ==
     14
     15The 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
     27Display:
     28 * '''bold'''
     29 * ''italic''
     30 * '''''bold italic'''''
     31 * __underline__
     32 * {{{monospace}}} or `monospace`
     33 * ~~strike-through~~
     34 * ^superscript^
     35 * ,,subscript,,
     36
     37Note 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
     41You can create heading by starting a line with one up to five ''equal'' characters ("=")
    16742followed by a single space and the headline text. The line should end with a space
    168 followed by the same number of ''equal'' characters.
    169 
    170 ''Note: As of writing, headings cannot contain TracLinks.''
    171 
    172 === Example: ===
     43followed by the same number of ''='' characters.
     44
     45Example:
    17346{{{
    17447= Heading =
    17548== Subheading ==
    176 }}}
     49=== About ''this'' ===
     50}}}
     51
     52Display:
     53= Heading =
     54== Subheading ==
     55=== About ''this'' ===
    17756
    17857
    17958== Paragraphs ==
    18059
    181 A new text paragraph is created whenever two blocks of text are separated
    182 by one or more empty lines.
     60A new text paragraph is created whenever two blocks of text are separated by one or more empty lines.
    18361
    18462A forced line break can also be inserted, using:
     
    19068Line 1[[BR]]Line 2
    19169
    192   Text paragraphs can be indented by starting the lines with two or more spaces.
    19370
    19471== Lists ==
     72
    19573The wiki supports both ordered/numbered and unordered lists.
    19674
     
    20583 1. Item 2
    20684}}}
     85
    20786Display:
    20887 * Item 1
     
    21493 1. Item 2
    21594
    216 == Preformatted text ==
    217 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:
     95Note 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
     100The wiki also supports definition lists.
     101
     102Example:
     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
     111Display:
     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
     118Note that you need a space in front of the defined term.
     119
     120
     121== Preformatted Text ==
     122
     123Block 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.
    218124 
    219125Example:
    220126{{{
    221127 {{{
    222   def HelloWorld()
     128  def HelloWorld():
    223129      print "Hello World"
    224130 }}}
     
    227133Display:
    228134{{{
    229  def HelloWorld()
     135 def HelloWorld():
    230136     print "Hello World"
    231137}}}
     138
     139
     140== Blockquotes ==
     141
     142In order to mark a paragraph as blockquote, indent that paragraph with two spaces.
     143
     144Example:
     145{{{
     146  This text is a quote from someone else.
     147}}}
     148
     149Display:
     150  This text is a quote from someone else.
    232151
    233152== Tables ==
     
    238157||Cell 4||Cell 5||Cell 6||
    239158}}}
     159
    240160Display:
    241161||Cell 1||Cell 2||Cell 3||
    242162||Cell 4||Cell 5||Cell 6||
    243163
     164Note that more complex tables can be created using
     165[wiki:WikiRestructuredText#BiggerReSTExample reStructuredText].
     166
     167
    244168== Links ==
    245169
    246 !Hyperlinks are automatically created for WikiPageNames and urls. !WikiPageLinks can be disabled by
    247 prepending an exclamation mark (!) character, such as {{{!WikiPageLink}}}.
    248 
    249 Examples:
    250 
    251  TitleIndex, http://www.edgewall.com/.
    252 
    253 Links can be given a more descriptive title by writing the link followed by
    254 a space and a title and all this inside two square brackets. Like this:
     170Hyperlinks are automatically created for WikiPageNames and URLs. !WikiPageLinks can be disabled by prepending an exclamation mark "!" character, such as {{{!WikiPageLink}}}.
     171
     172Example:
     173{{{
     174 TitleIndex, http://www.edgewall.com/, !NotAlink
     175}}}
     176
     177Display:
     178 TitleIndex, http://www.edgewall.com/, !NotAlink
     179
     180Links 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
     182Example:
    255183{{{
    256184 * [http://www.edgewall.com/ Edgewall Software]
    257185 * [wiki:TitleIndex Title Index]
    258 }}}
    259 Display:
    260 
     186 * [wiki:ISO9000]
     187}}}
     188
     189Display:
    261190 * [http://www.edgewall.com/ Edgewall Software]
    262191 * [wiki:TitleIndex Title Index]
     192 * [wiki:ISO9000]
     193
    263194
    264195=== Trac Links ===
    265196
    266 Wiki pages can link directly to other parts of the Trac system.
    267 Pages can refer to tickets, reports, changesets, milestones, source files and
    268 other Wiki pages using the following notation:
    269  * Tickets: '''!#1''' or '''!ticket:1'''
    270  * Reports: '''!{1}''' or '''!report:1'''
    271  * Changesets: '''![1]''' or '''!changeset:1'''
    272  * Wiki pages: '''CamelCase''' or '''!wiki:CamelCase'''
    273  * Milestones: '''!milestone:1.0'''
    274  * Files: '''!source:trunk/COPYING'''
    275  * A specific file revision: '''!source:/trunk/COPYING#200'''
    276 Display:
     197Wiki 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{{{
    277199 * Tickets: #1 or ticket:1
    278200 * Reports: {1} or report:1
    279  * Changesets: [1] or changeset:1
     201 * Changesets: r1, [1] or changeset:1
     202 * Revision Logs: r1:3, [1:3] or log:branches/0.8-stable#1:3
    280203 * Wiki pages: CamelCase or wiki:CamelCase
    281  * Milestones: milestone:1.0
     204 * Milestones: milestone:1.0 or milestone:"End-of-days Release"
    282205 * Files: source:trunk/COPYING
     206 * Attachments: attachment:"file name.doc"
    283207 * A specific file revision: source:/trunk/COPYING#200
     208 * A filename with embedded space: source:"/trunk/README FIRST"
     209}}}
     210
     211Display:
     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"
    284222
    285223See TracLinks for more in-depth information.
    286224
    287 == Escaping Links and WikiNames ==
    288 You may avoid making hyperlinks out of TracLinks by preceding an expression with a single '!' (exclamation mark).
    289 
     225
     226== Escaping Links and WikiPageNames ==
     227
     228You may avoid making hyperlinks out of TracLinks by preceding an expression with a single "!" (exclamation mark).
     229
     230Example:
    290231{{{
    291232 !NoHyperLink
     
    297238 !#42 is not a link
    298239
     240
    299241== Images ==
    300242
    301 Urls ending with .png, .gif or .jpg are automatically interpreted as image links, and converted to IMG tags.
     243Urls ending with `.png`, `.gif` or `.jpg` are automatically interpreted as image links, and converted to `<img>` tags.
    302244
    303245Example:
     
    305247http://www.edgewall.com/gfx/trac_example_image.png
    306248}}}
     249
    307250Display:
    308251
    309252http://www.edgewall.com/gfx/trac_example_image.png
    310253
     254However, 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
    311257== Macros ==
    312 Macros are ''custom functions'' to insert dynamic content in a page. See WikiMacros for usage.
     258
     259Macros are ''custom functions'' to insert dynamic content in a page.
    313260
    314261Example:
     
    316263 [[Timestamp]]
    317264}}}
     265
    318266Display:
    319267 [[Timestamp]]
    320268
     269See WikiMacros for more information, and a list of installed macros.
     270
     271
    321272== Processors ==
    322 Trac supports alternative markup formats using WikiProcessors. For example, processors are used to write pages in [wiki:WikiRestructuredText reStructuredText] or [wiki:WikiHtml HTML].
    323 
    324 See WikiProcessors for more information.
    325 
    326 '''Example 1:'''
     273
     274Trac supports alternative markup formats using WikiProcessors. For example, processors are used to write pages in
     275[wiki:WikiRestructuredText reStructuredText] or [wiki:WikiHtml HTML].
     276
     277Example 1:
    327278{{{
    328279#!html
     
    332283}}}</pre>
    333284}}}
     285
    334286Display:
    335287{{{
     
    338290}}}
    339291
    340 '''Example 2:'''
     292Example:
    341293{{{
    342294#!html
     
    350302}}}</pre>
    351303}}}
     304
    352305Display:
    353306{{{
     
    360313}}}
    361314
     315Perl:
     316{{{
     317#!perl
     318my ($test) = 0;
     319if ($test > 0) {
     320echo "hello";
     321}
     322}}}
     323
     324See WikiProcessors for more information.
     325
     326
    362327== Miscellaneous ==
    363328
    364329Four or more dashes will be replaced by a horizontal line (<HR>)
    365330
     331Example:
    366332{{{
    367333 ----
     
    373339
    374340----
    375 
    376 
    377 
    378341See also: TracLinks, TracGuide, WikiHtml, WikiMacros, WikiProcessors, TracSyntaxColoring.
    379 
    380 Most of the Makros and Plugins are from:
    381 http://projects.edgewall.com/trac/wiki/MacroBazaar
    382 http://trac-hacks.org/wiki/