| 1 | = Trac Links = |
---|
| 2 | As you might have guessed, TracLinks are a very fundamental feature of Trac. |
---|
| 3 | |
---|
| 4 | They allow hyperlinking between Trac entities (tickets, reports, changesets, Wiki |
---|
| 5 | pages, milestones and source files) from anywhere WikiFormatting is used. |
---|
| 6 | |
---|
| 7 | TracLinks are generally of the form '''type:id''' (where ''id'' represents the |
---|
| 8 | number, name or path of the item) though some frequently used kinds of items |
---|
| 9 | also have short-hand notations. |
---|
| 10 | |
---|
| 11 | Some examples: |
---|
| 12 | * Tickets: '''!#1''' or '''!ticket:1''' |
---|
| 13 | * Reports: '''!{1}''' or '''!report:1''' |
---|
| 14 | * Changesets: '''!r1''', '''![1]''' or '''!changeset:1''' |
---|
| 15 | * Revision log: '''!r1:3''', '''![1:3]''' or '''!log:#1:3''' |
---|
| 16 | * Wiki pages: '''CamelCase''' or '''!wiki:CamelCase''' |
---|
| 17 | * Milestones: '''!milestone:1.0''' |
---|
| 18 | * Files: '''!source:trunk/COPYING''' |
---|
| 19 | * A specific file revision: '''!source:/trunk/COPYING#200''' |
---|
| 20 | Display: |
---|
| 21 | * Tickets: #1 or ticket:1 |
---|
| 22 | * Reports: {1} or report:1 |
---|
| 23 | * Changesets: r1, [1] or changeset:1 |
---|
| 24 | * Differences: r1:3, [1:3] or log:#1:3 |
---|
| 25 | * Wiki pages: CamelCase or wiki:CamelCase |
---|
| 26 | * Milestones: milestone:1.0 |
---|
| 27 | * Files: source:trunk/COPYING |
---|
| 28 | * A specific file revision: source:/trunk/COPYING#200 |
---|
| 29 | |
---|
| 30 | '''Note:''' The wiki:CamelCase form is rarely used, but it can be convenient to refer to |
---|
| 31 | pages whose names do not follow WikiPageNames rules, i.e., single words, |
---|
| 32 | non-alphabetic characters, etc. |
---|
| 33 | |
---|
| 34 | Trac links using the full (non-shorthand) notation can also be given a custom |
---|
| 35 | link title like this: |
---|
| 36 | |
---|
| 37 | {{{ |
---|
| 38 | [ticket:1 This is a link to ticket number one]. |
---|
| 39 | }}} |
---|
| 40 | |
---|
| 41 | Display: [ticket:1 This is a link to ticket number one]. |
---|
| 42 | |
---|
| 43 | If the title is be omitted, only the id (the part after the colon) is displayed: |
---|
| 44 | |
---|
| 45 | {{{ |
---|
| 46 | [ticket:1] |
---|
| 47 | }}} |
---|
| 48 | |
---|
| 49 | Display: [ticket:1] |
---|
| 50 | |
---|
| 51 | It might seem a simple enough concept at a glance, but actually allows quite a complex network of information. In practice, it's very intuitive and simple to use, and we've found the "link trail" extremely helpful to better understand what's happening in a project or why a particular change was made. |
---|
| 52 | |
---|
| 53 | == source: links == |
---|
| 54 | The default behavior for a source:/some/path link is to open the directory browser if the path points |
---|
| 55 | to a directory and otherwise open the log view. It's also possible to link directly to a specific |
---|
| 56 | revision of a file like this: source:/some/file#123 or like this to link to the latest revision: |
---|
| 57 | source:/some/file#latest. |
---|
| 58 | |
---|
| 59 | == Where to use TracLinks == |
---|
| 60 | You can use TracLinks in: |
---|
| 61 | |
---|
| 62 | * Source code (Subversion) commit messages |
---|
| 63 | * Wiki pages |
---|
| 64 | * Full descriptions for tickets, reports and milestones |
---|
| 65 | |
---|
| 66 | and any other text fields explicitly marked as supporting WikiFormatting. |
---|
| 67 | |
---|
| 68 | == Escaping Links == |
---|
| 69 | |
---|
| 70 | To prevent parsing of a !TracLink, you can escape it by preceding it with a '!' (exclamation mark). |
---|
| 71 | {{{ |
---|
| 72 | !NoLinkHere. |
---|
| 73 | ![42] is not a link either. |
---|
| 74 | }}} |
---|
| 75 | |
---|
| 76 | Display: |
---|
| 77 | !NoLinkHere. |
---|
| 78 | ![42] is not a link either. |
---|
| 79 | |
---|
| 80 | ---- |
---|
| 81 | See also: WikiFormatting, TracWiki |
---|
| 82 | |