Changes between Version 3 and Version 4 of TracLinks


Ignore:
Timestamp:
01/23/15 16:42:55 (10 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracLinks

    v3 v4  
    2626 Ticket comments :: `comment:1:ticket:2`
    2727 Reports :: `{1}` or `report:1`
    28  Changesets :: `r1`, `[1]`, `changeset:1` or (restricted) `[1/trunk]`, `changeset:1/trunk`
    29  Revision log :: `r1:3`, `[1:3]` or `log:@1:3`, `log:trunk@1:3`, `[2:5/trunk]`
    30  Diffs :: `diff:@1:3`, `diff:tags/trac-0.9.2/wiki-default//tags/trac-0.9.3/wiki-default`
    31           or `diff:trunk/trac@3538//sandbox/vc-refactoring@3539`
    3228 Milestones :: `milestone:1.0`
    3329 Attachment :: `attachment:example.tgz` (for current page attachment), `attachment:attachment.1073.diff:ticket:944` (absolute path)
    34  Files :: `source:trunk/COPYING`
    35  A specific file revision :: `source:/trunk/COPYING@200`
    36  A particular line of a specific file revision :: `source:/trunk/COPYING@200#L25`
     30 Changesets :: `r1`, `[1]`, `changeset:1` or (restricted) `[1/trunk]`, `changeset:1/trunk`, `[1/repository]`
     31 Revision log :: `r1:3`, `[1:3]` or `log:@1:3`, `log:trunk@1:3`, `[2:5/trunk]`
     32 Diffs :: `diff:@1:3`, `diff:plugins/0.12/mercurial-plugin@9128:9953`,
     33          `diff:tags/trac-0.9.2/wiki-default//tags/trac-0.9.3/wiki-default`
     34          or `diff:trunk/trac@3538//sandbox/vc-refactoring@3539`
     35 Files :: `source:trunk/COPYING`, `source:/trunk/COPYING@200` (at version 200), `source:/trunk/COPYING@200#L25` (at version 200, line 25)
    3736}}}
    3837{{{#!td
     
    4241 Ticket comments :: comment:1:ticket:2
    4342 Reports :: {1} or report:1
    44  Changesets :: r1, [1], changeset:1 or (restricted) [1/trunk], changeset:1/trunk
    45  Revision log :: r1:3, [1:3] or log:@1:3, log:trunk@1:3, [2:5/trunk]
    46  Diffs :: diff:@1:3, diff:tags/trac-0.9.2/wiki-default//tags/trac-0.9.3/wiki-default
    47           or diff:trunk/trac@3538//sandbox/vc-refactoring@3539
    4843 Milestones :: milestone:1.0
    4944 Attachment :: attachment:example.tgz (for current page attachment), attachment:attachment.1073.diff:ticket:944 (absolute path)
    50  Files :: source:trunk/COPYING
    51  A specific file revision :: source:/trunk/COPYING@200
    52  A particular line of a specific file revision :: source:/trunk/COPYING@200#L25
     45 Changesets :: r1, [1], changeset:1 or (restricted) [1/trunk], changeset:1/trunk, [1/repository]
     46 Revision log :: r1:3, [1:3] or log:@1:3, log:trunk@1:3, [2:5/trunk]
     47 Diffs :: diff:@1:3, diff:plugins/0.12/mercurial-plugin@9128:9953,
     48          diff:tags/trac-0.9.2/wiki-default//tags/trac-0.9.3/wiki-default
     49          or diff:trunk/trac@3538//sandbox/vc-refactoring@3539
     50 Files :: source:trunk/COPYING, source:/trunk/COPYING@200 (at version 200), source:/trunk/COPYING@200#L25 (at version 200, line 25)
    5351}}}
    5452
     
    111109
    112110=== Relative links ===
    113 
    114 To create a link to a specific anchor in a page, use '#':
    115 {{{
    116  [#Relativelinks relative links] or [[#Relativelinks|relative links]]
    117 }}}
    118 Displays:
    119   [#Relativelinks relative links] or [[#Relativelinks|relative links]]
    120 
    121 Hint: when you move your mouse over the title of a section, a '¶' character will be displayed. This is a link to that specific section and you can use this to copy the `#...` part inside a relative link to an anchor.
    122111
    123112To create a link to a [trac:SubWiki SubWiki]-page just use a '/':
     
    152141''(Changed in 0.11)'' Note that in Trac 0.10, using e.g. `[../newticket]`  may have worked for linking to the `/newticket` top-level URL, but since 0.11, such a link will stay in the wiki namespace and therefore link to a sibling page.
    153142See [#Server-relativelinks] for the new syntax.
     143
     144=== Link anchors ===
     145
     146To create a link to a specific anchor in a page, use '#':
     147{{{
     148 [#Linkanchors Link anchors] or [[#Linkanchors|Link anchors]]
     149}}}
     150  [#Linkanchors Link anchors] or [[#Linkanchors|Link anchors]]
     151
     152Hint: when you move your mouse over the title of a section, a '¶' character will be displayed. This is a link to that specific section and you can use this to copy the `#...` part inside a relative link to an anchor.
     153
     154To create a link to the first or last occurrence of a term on a page, use a ''pseudo anchor'' starting with '#/' or '#?':
     155{{{
     156 [#/Milestone first occurrence of Milestone] or
     157 [#?Milestone last occurrence of Milestone]
     158}}}
     159 [#/Milestone first occurrence of Milestone] or
     160 [#?Milestone last occurrence of Milestone]
     161This will also highlight all other matches on the linked page. By default only case sensitive matches are considered. To include case insensitive matches append '/i':
     162{{{
     163 [#/Milestone/i first occurrence of Milestone or milestone] or
     164 [#?Milestone/i last occurrence of Milestone or milestone]
     165}}}
     166 [#/Milestone/i first occurrence of Milestone or milestone] or
     167 [#?Milestone/i last occurrence of Milestone or milestone]
     168
     169''(since Trac 1.0)''
     170
     171Such anchors can be very useful for linking to specific lines in a file in the source browser:
     172{{{
     173 [trac:source:tags/trac-0.12/trac/wiki/api.py#L127 Line 127] or
     174 [trac:source:tags/trac-0.12/trac/ticket/roadmap.py#L47 Line 47]
     175}}}
     176 [trac:source:tags/trac-0.12/trac/wiki/api.py#L127 Line 127] or
     177 [trac:source:tags/trac-0.12/trac/ticket/roadmap.py#L47 Line 47]
     178(Hint: The line numbers displayed in the source browser are links to anchors on the respective lines.)
     179
     180Since such links become outdated when the file changes, it can be useful to link using a '#/' pseudo anchor instead:
     181{{{
     182 [trac:source:trunk/trac/wiki/api.py#/IWikiSyntaxProvider IWikiSyntaxProvider] or
     183 [trac:source:trunk/trac/env.py#/ISystemInfoProvider ISystemInfoProvider]
     184}}}
     185 [trac:source:trunk/trac/wiki/api.py#/IWikiSyntaxProvider IWikiSyntaxProvider] or
     186 [trac:source:trunk/trac/env.py#/ISystemInfoProvider ISystemInfoProvider]
    154187
    155188=== InterWiki links ===
     
    258291 - `ticket:123#comment:description`
    259292
     293=== htdocs: links ===
     294
     295Use `htdocs:path/to/file` to reference files in the `htdocs` directory of the Trac environment, the [TracEnvironment#DirectoryStructure web resource directory].
     296
    260297=== query: links ===
    261298
     
    279316=== timeline: links ===
    280317
    281 Links to the timeline can be created by specifying a date in the ISO:8601 format. The date can be optionally followed by a time specification. The time is interpreted as being UTC time, but alternatively you can specify your local time, followed by your timezone if you don't want to compute the UTC time.
     318Links to the timeline can be created by specifying a date in the ISO:8601 format. The date can be optionally followed by a time specification. The time is interpreted as being UTC time, but if you don't want to compute the UTC time, you can specify a local time followed by your timezone offset relative to UTC.
    282319
    283320Examples:
     
    286323 - `timeline:2008-01-29T15:48Z`
    287324 - `timeline:2008-01-29T16:48+01`
     325 - `timeline:2008-01-29T16:48+0100`
     326 - `timeline:2008-01-29T16:48+01:00`
    288327
    289328''(since Trac 0.11)''
     
    291330=== wiki: links ===
    292331
    293 See WikiPageNames and [#QuotingspaceinTracLinks quoting space in TracLinks] above.
     332See WikiPageNames and [#QuotingspaceinTracLinks quoting space in TracLinks] above. It is possible to create a link to a specific page revision using the syntax WikiStart@1.
    294333
    295334=== Version Control related links ===
     335
     336It should be noted that multiple repository support works by creating a kind of virtual namespace for versioned files in which the toplevel folders correspond to the repository names. Therefore, in presence of multiple repositories, a ''/path'' specification in the syntax of links detailed below should start with the name of the repository. If omitted, the default repository is used. In case a toplevel folder of the default repository has the same name as a repository, the latter "wins". One can always access such folder by fully qualifying it (the default repository can be an alias of a named repository, or conversely, it is always possible to create an alias for the default repository, ask your Trac administrator).
     337
     338For example, `source:/trunk/COPYING` targets the path `/trunk/COPYING` in the default repository, whereas `source:/projectA/trunk/COPYING` targets the path `/trunk/COPYING` in the repository named `projectA`. This can be the same file if `'projectA'` is an alias to the default repository or if `''` (the default repository) is an alias to `'projectA'`.
     339
    296340==== source: links ====
    297341 ''aliases:'' `browser:`, `repos:`
     
    308352 - `source:/tag/0.10@head#L10`
    309353
    310 Finally, one can also highlight an arbitrary set of lines:
    311  - `source:/some/file@123:10-20,100,103#L99` - highlight lines 10 to 20, and lines 100 and 103.
    312    ''(since 0.11)''
     354Finally, one can also highlight an arbitrary set of lines ''(since 0.11)'':
     355 - `source:/some/file@123:10-20,100,103#L99` - highlight lines 10 to 20, and lines 100 and 103, and target line 99
     356 - or without version number (the `@` is still needed): `source:/some/file@:10-20,100,103#L99`. Version can be omitted when the path is pointing to a source file that will no longer change (like `source:/tags/...`), otherwise it's better to specify which lines of //which version// of the file you're talking about
    313357
    314358Note that in presence of multiple repositories, the name of the repository is simply integrated in the path you specify for `source:` (e.g. `source:reponame/trunk/README`). ''(since 0.12)''