Changes between Version 1 and Version 2 of TracLinks
- Timestamp:
- Nov 29, 2015, 3:01:08 AM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracLinks
v1 v2 26 26 Ticket comments :: `comment:1:ticket:2` 27 27 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:[email protected]: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/[email protected]//sandbox/[email protected]`32 28 Milestones :: `milestone:1.0` 33 29 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/[email protected]` 36 A particular line of a specific file revision :: `source:/trunk/[email protected]#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:[email protected]:3`, `[2:5/trunk]` 32 Diffs :: `diff:@1:3`, `diff:plugins/0.12/[email protected]:9953`, 33 `diff:tags/trac-0.9.2/wiki-default//tags/trac-0.9.3/wiki-default` 34 or `diff:trunk/[email protected]//sandbox/[email protected]` 35 Files :: `source:trunk/COPYING`, `source:/trunk/[email protected]` (at version 200), `source:/trunk/[email protected]#L25` (at version 200, line 25) 37 36 }}} 38 37 {{{#!td … … 42 41 Ticket comments :: comment:1:ticket:2 43 42 Reports :: {1} or report:1 44 Changesets :: r1, [1], changeset:1 or (restricted) [1/trunk], changeset:1/trunk45 Revision log :: r1:3, [1:3] or log:@1:3, log:[email protected]:3, [2:5/trunk]46 Diffs :: diff:@1:3, diff:tags/trac-0.9.2/wiki-default//tags/trac-0.9.3/wiki-default47 or diff:trunk/[email protected]//sandbox/[email protected]48 43 Milestones :: milestone:1.0 49 44 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/[email protected] 52 A particular line of a specific file revision :: source:/trunk/[email protected]#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:[email protected]:3, [2:5/trunk] 47 Diffs :: diff:@1:3, diff:plugins/0.12/[email protected]:9953, 48 diff:tags/trac-0.9.2/wiki-default//tags/trac-0.9.3/wiki-default 49 or diff:trunk/[email protected]//sandbox/[email protected] 50 Files :: source:trunk/COPYING, source:/trunk/[email protected] (at version 200), source:/trunk/[email protected]#L25 (at version 200, line 25) 53 51 }}} 54 52 … … 111 109 112 110 === 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.122 111 123 112 To create a link to a [trac:SubWiki SubWiki]-page just use a '/': … … 145 134 146 135 In order to link explicitly to a [=#toplevel toplevel] Wiki page, 147 use the `wiki:/` prefix. 148 Be careful **not** to use the `/` prefix alone, as this corresponds to the 149 [#Server-relativelinks] syntax and with such a link you will lack the `/wiki/` 150 part in the resulting URL. 151 152 ''(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. 153 See [#Server-relativelinks] for the new syntax. 136 use the `wiki:/` prefix. Be careful **not** to use the `/` prefix alone, as this corresponds to the [#Server-relativelinks] syntax and with such a link you will lack the `/wiki/` part in the resulting URL. A link such as `[../newticket]` will stay in the wiki namespace and therefore link to a sibling page. 137 138 === Link anchors === 139 140 To create a link to a specific anchor in a page, use '#': 141 {{{ 142 [#Linkanchors Link anchors] or [[#Linkanchors|Link anchors]] 143 }}} 144 [#Linkanchors Link anchors] or [[#Linkanchors|Link anchors]] 145 146 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. 147 148 To create a link to the first or last occurrence of a term on a page, use a ''pseudo anchor'' starting with '#/' or '#?': 149 {{{ 150 [#/Milestone first occurrence of Milestone] or 151 [#?Milestone last occurrence of Milestone] 152 }}} 153 [#/Milestone first occurrence of Milestone] or 154 [#?Milestone last occurrence of Milestone] 155 This 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': 156 {{{ 157 [#/Milestone/i first occurrence of Milestone or milestone] or 158 [#?Milestone/i last occurrence of Milestone or milestone] 159 }}} 160 [#/Milestone/i first occurrence of Milestone or milestone] or 161 [#?Milestone/i last occurrence of Milestone or milestone] 162 163 ''(since Trac 1.0)'' 164 165 Such anchors can be very useful for linking to specific lines in a file in the source browser: 166 {{{ 167 [trac:source:tags/trac-0.12/trac/wiki/api.py#L127 Line 127] or 168 [trac:source:tags/trac-0.12/trac/ticket/roadmap.py#L47 Line 47] 169 }}} 170 [trac:source:tags/trac-0.12/trac/wiki/api.py#L127 Line 127] or 171 [trac:source:tags/trac-0.12/trac/ticket/roadmap.py#L47 Line 47] 172 (Hint: The line numbers displayed in the source browser are links to anchors on the respective lines.) 173 174 Since such links become outdated when the file changes, it can be useful to link using a '#/' pseudo anchor instead: 175 {{{ 176 [trac:source:trunk/trac/wiki/api.py#/IWikiSyntaxProvider IWikiSyntaxProvider] or 177 [trac:source:trunk/trac/env.py#/ISystemInfoProvider ISystemInfoProvider] 178 }}} 179 [trac:source:trunk/trac/wiki/api.py#/IWikiSyntaxProvider IWikiSyntaxProvider] or 180 [trac:source:trunk/trac/env.py#/ISystemInfoProvider ISystemInfoProvider] 154 181 155 182 === InterWiki links === … … 258 285 - `ticket:123#comment:description` 259 286 287 === htdocs: links === 288 289 Use `htdocs:path/to/file` to reference files in the `htdocs` directory of the Trac environment, the [TracEnvironment#DirectoryStructure web resource directory]. 290 260 291 === query: links === 261 292 … … 275 306 - `ticket:1,150` 276 307 277 ''(since Trac 0.11)''278 279 308 === timeline: links === 280 309 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.310 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 if you don't want to compute the UTC time, you can specify a local time followed by your timezone offset relative to UTC. 282 311 283 312 Examples: … … 286 315 - `timeline:2008-01-29T15:48Z` 287 316 - `timeline:2008-01-29T16:48+01` 288 289 ''(since Trac 0.11)'' 317 - `timeline:2008-01-29T16:48+0100` 318 - `timeline:2008-01-29T16:48+01:00` 290 319 291 320 === wiki: links === 292 321 293 See WikiPageNames and [#QuotingspaceinTracLinks quoting space in TracLinks] above. 322 See WikiPageNames and [#QuotingspaceinTracLinks quoting space in TracLinks] above. It is possible to create a link to a specific page revision using the syntax [email protected] 294 323 295 324 === Version Control related links === 325 326 It 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). 327 328 For 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'`. 329 296 330 ==== source: links ==== 297 331 ''aliases:'' `browser:`, `repos:` 298 332 299 The default behavior for a source:/some/path linkis to open the browser in that directory directory333 The default behavior for a `source:/some/path link` is to open the browser in that directory directory 300 334 if the path points to a directory or to show the latest content of the file. 301 335 … … 303 337 - `source:/some/[email protected]` - link to the file's revision 123 304 338 - `source:/some/[email protected]` - link explicitly to the latest revision of the file 339 - `source:/some/[email protected]` - link to latest revision of the specified file in `named-branch` (DVCS such as Git or Mercurial) 305 340 306 341 If the revision is specified, one can even link to a specific line number: 307 342 - `source:/some/[email protected]#L10` 308 343 - `source:/tag/[email protected]#L10` 344 - `source:/some/[email protected]#L10` 309 345 310 346 Finally, one can also highlight an arbitrary set of lines: 311 - `source:/some/[email protected]:10-20,100,103#L99` - highlight lines 10 to 20, and lines 100 and 103 .312 ''(since 0.11)''347 - `source:/some/[email protected]:10-20,100,103#L99` - highlight lines 10 to 20, and lines 100 and 103, and target line 99 348 - or without version number (the `@` is still needed): `source:/some/[email protected]: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 313 349 314 350 Note 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)'' … … 320 356 * `export:123:/some/file` - get revision 123 of the specified file 321 357 * `export:/some/[email protected]` - get revision 123 of the specified file 358 * `export:/some/[email protected]` - get latest revision of the specified file in `named-branch` (DVCS such as Git or Mercurial). 322 359 323 360 This can be very useful for displaying XML or HTML documentation with correct stylesheets and images, in case that has been checked in into the repository. Note that for this use case, you'd have to allow the web browser to render the content by setting `[browser] render_unsafe_content = yes` (see TracIni#browser-section), otherwise Trac will force the files to be downloaded as attachments for security concerns. … … 333 370 - `log:@20788,20791:20795` - list revision 20788 and the revisions from 20791 to 20795 334 371 - `log:/trunk/[email protected],20791:20795` - list revision 20788 and the revisions from 20791 to 20795 which affect the given path 372 - `log:/[email protected]` - the revisions in `tools` starting from the latest revision in `named-branch` (DVCS such as Git or Mercurial) 335 373 336 374 There are short forms for revision ranges as well: