Changes between Version 23 and Version 24 of WikiFormatting
- Timestamp:
- Aug 30, 2006, 6:04:11 PM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WikiFormatting
v23 v24 1 1 = 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 4 Wiki markup is a core feature in Trac, tightly integrating all the other parts of Trac into a 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, 7 especially [http://moinmoin.wikiwikiweb.de/ MoinMoin]. 8 6 9 7 10 This page demonstrates the formatting syntax available anywhere WikiFormatting is allowed. 8 11 9 12 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 15 The 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 27 Display: 28 * '''bold''' 29 * ''italic'' 30 * '''''bold italic''''' 31 * __underline__ 32 * {{{monospace}}} or `monospace` 33 * ~~strike-through~~ 34 * ^superscript^ 35 * ,,subscript,, 36 37 Note 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 41 You can create heading by starting a line with one up to five ''equal'' characters ("=") 167 42 followed 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: === 43 followed by the same number of ''='' characters. 44 45 Example: 173 46 {{{ 174 47 = Heading = 175 48 == Subheading == 176 }}} 49 === About ''this'' === 50 }}} 51 52 Display: 53 = Heading = 54 == Subheading == 55 === About ''this'' === 177 56 178 57 179 58 == Paragraphs == 180 59 181 A new text paragraph is created whenever two blocks of text are separated 182 by one or more empty lines. 60 A new text paragraph is created whenever two blocks of text are separated by one or more empty lines. 183 61 184 62 A forced line break can also be inserted, using: … … 190 68 Line 1[[BR]]Line 2 191 69 192 Text paragraphs can be indented by starting the lines with two or more spaces.193 70 194 71 == Lists == 72 195 73 The wiki supports both ordered/numbered and unordered lists. 196 74 … … 205 83 1. Item 2 206 84 }}} 85 207 86 Display: 208 87 * Item 1 … … 214 93 1. Item 2 215 94 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: 95 Note 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 100 The wiki also supports definition lists. 101 102 Example: 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 111 Display: 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 118 Note that you need a space in front of the defined term. 119 120 121 == Preformatted Text == 122 123 Block 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. 218 124 219 125 Example: 220 126 {{{ 221 127 {{{ 222 def HelloWorld() 128 def HelloWorld(): 223 129 print "Hello World" 224 130 }}} … … 227 133 Display: 228 134 {{{ 229 def HelloWorld() 135 def HelloWorld(): 230 136 print "Hello World" 231 137 }}} 138 139 140 == Blockquotes == 141 142 In order to mark a paragraph as blockquote, indent that paragraph with two spaces. 143 144 Example: 145 {{{ 146 This text is a quote from someone else. 147 }}} 148 149 Display: 150 This text is a quote from someone else. 232 151 233 152 == Tables == … … 238 157 ||Cell 4||Cell 5||Cell 6|| 239 158 }}} 159 240 160 Display: 241 161 ||Cell 1||Cell 2||Cell 3|| 242 162 ||Cell 4||Cell 5||Cell 6|| 243 163 164 Note that more complex tables can be created using 165 [wiki:WikiRestructuredText#BiggerReSTExample reStructuredText]. 166 167 244 168 == Links == 245 169 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: 170 Hyperlinks are automatically created for WikiPageNames and URLs. !WikiPageLinks can be disabled by prepending an exclamation mark "!" character, such as {{{!WikiPageLink}}}. 171 172 Example: 173 {{{ 174 TitleIndex, http://www.edgewall.com/, !NotAlink 175 }}} 176 177 Display: 178 TitleIndex, http://www.edgewall.com/, !NotAlink 179 180 Links 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 182 Example: 255 183 {{{ 256 184 * [http://www.edgewall.com/ Edgewall Software] 257 185 * [wiki:TitleIndex Title Index] 258 }}} 259 Display: 260 186 * [wiki:ISO9000] 187 }}} 188 189 Display: 261 190 * [http://www.edgewall.com/ Edgewall Software] 262 191 * [wiki:TitleIndex Title Index] 192 * [wiki:ISO9000] 193 263 194 264 195 === Trac Links === 265 196 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: 197 Wiki 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 {{{ 277 199 * Tickets: #1 or ticket:1 278 200 * 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 280 203 * Wiki pages: CamelCase or wiki:CamelCase 281 * Milestones: milestone:1.0 204 * Milestones: milestone:1.0 or milestone:"End-of-days Release" 282 205 * Files: source:trunk/COPYING 206 * Attachments: attachment:"file name.doc" 283 207 * A specific file revision: source:/trunk/COPYING#200 208 * A filename with embedded space: source:"/trunk/README FIRST" 209 }}} 210 211 Display: 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" 284 222 285 223 See TracLinks for more in-depth information. 286 224 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 228 You may avoid making hyperlinks out of TracLinks by preceding an expression with a single "!" (exclamation mark). 229 230 Example: 290 231 {{{ 291 232 !NoHyperLink … … 297 238 !#42 is not a link 298 239 240 299 241 == Images == 300 242 301 Urls ending with .png, .gif or .jpg are automatically interpreted as image links, and converted to IMGtags.243 Urls ending with `.png`, `.gif` or `.jpg` are automatically interpreted as image links, and converted to `<img>` tags. 302 244 303 245 Example: … … 305 247 http://www.edgewall.com/gfx/trac_example_image.png 306 248 }}} 249 307 250 Display: 308 251 309 252 http://www.edgewall.com/gfx/trac_example_image.png 310 253 254 However, 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 311 257 == Macros == 312 Macros are ''custom functions'' to insert dynamic content in a page. See WikiMacros for usage. 258 259 Macros are ''custom functions'' to insert dynamic content in a page. 313 260 314 261 Example: … … 316 263 [[Timestamp]] 317 264 }}} 265 318 266 Display: 319 267 [[Timestamp]] 320 268 269 See WikiMacros for more information, and a list of installed macros. 270 271 321 272 == 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 274 Trac supports alternative markup formats using WikiProcessors. For example, processors are used to write pages in 275 [wiki:WikiRestructuredText reStructuredText] or [wiki:WikiHtml HTML]. 276 277 Example 1: 327 278 {{{ 328 279 #!html … … 332 283 }}}</pre> 333 284 }}} 285 334 286 Display: 335 287 {{{ … … 338 290 }}} 339 291 340 '''Example 2:''' 292 Example: 341 293 {{{ 342 294 #!html … … 350 302 }}}</pre> 351 303 }}} 304 352 305 Display: 353 306 {{{ … … 360 313 }}} 361 314 315 Perl: 316 {{{ 317 #!perl 318 my ($test) = 0; 319 if ($test > 0) { 320 echo "hello"; 321 } 322 }}} 323 324 See WikiProcessors for more information. 325 326 362 327 == Miscellaneous == 363 328 364 329 Four or more dashes will be replaced by a horizontal line (<HR>) 365 330 331 Example: 366 332 {{{ 367 333 ---- … … 373 339 374 340 ---- 375 376 377 378 341 See also: TracLinks, TracGuide, WikiHtml, WikiMacros, WikiProcessors, TracSyntaxColoring. 379 380 Most of the Makros and Plugins are from:381 http://projects.edgewall.com/trac/wiki/MacroBazaar382 http://trac-hacks.org/wiki/