close
Warning:
Can't synchronize with repository "(default)" (/common/SVN/crkit does not appear to be a Subversion repository.). Look in the Trac log for more information.
- Timestamp:
-
Jan 30, 2019, 11:46:21 PM (5 years ago)
- Author:
-
trac
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v3
|
v4
|
|
4 | 4 | [[PageOutline(2-5,Contents,pullout)]] |
5 | 5 | |
6 | | TracLinks are a fundamental feature of Trac, allowing easy hyperlinking between the various entities in the system — such as tickets, reports, changesets, Wiki pages, milestones, and source files — from anywhere WikiFormatting is used. |
| 6 | TracLinks are a fundamental feature of Trac, because they allow easy hyperlinking between the various entities in the system — such as tickets, reports, changesets, Wiki pages, milestones, and source files — from anywhere where WikiFormatting is used. |
7 | 7 | |
8 | 8 | TracLinks are generally of the form '''type:id''' (where ''id'' represents the number, name or path of the item) though some frequently used kinds of items also have short-hand notations. |
… |
… |
|
34 | 34 | `diff:tags/trac-0.9.2/wiki-default//tags/trac-0.9.3/wiki-default` |
35 | 35 | or `diff:trunk/trac@3538//sandbox/vc-refactoring@3539` |
36 | | Files :: `source:trunk/COPYING`, `source:/trunk/COPYING@200` (at version 200), `source:/trunk/COPYING@200#L25` (at version 200, line 25), `source:/trunk/COPYING@200:27-30#L25` (at version 200, line 25, highlighting lines 27-30) |
| 36 | Files :: `source:trunk/COPYING`, `source:/trunk/COPYING@200` (at version 200), `source:/trunk/COPYING@200#L25` (at version 200, line 25) |
37 | 37 | }}} |
38 | 38 | {{{#!td |
… |
… |
|
49 | 49 | diff:tags/trac-0.9.2/wiki-default//tags/trac-0.9.3/wiki-default |
50 | 50 | or diff:trunk/trac@3538//sandbox/vc-refactoring@3539 |
51 | | Files :: source:trunk/COPYING, source:/trunk/COPYING@200 (at version 200), source:/trunk/COPYING@200#L25 (at version 200, line 25) source:/trunk/COPYING@200:28-31#L25 (at version 200, line 25, highlighting lines 28-31) |
| 51 | Files :: source:trunk/COPYING, source:/trunk/COPYING@200 (at version 200), source:/trunk/COPYING@200#L25 (at version 200, line 25) |
52 | 52 | }}} |
53 | 53 | |
… |
… |
|
98 | 98 | {{{#!td |
99 | 99 | <wiki:Strange(page@!)> |
100 | | }}} |
101 | | |-------------------------------------------------------------------------------------- |
102 | | |||| Quoting can be used with the full notation to allow brackets in the label. || |
103 | | {{{#!td |
104 | | {{{ |
105 | | [TracIni#logging-log_type-option "[logging] log_type"] |
106 | | }}} |
107 | | }}} |
108 | | {{{#!td |
109 | | [TracIni#logging-log_type-option "[logging] log_type"] |
110 | 100 | }}} |
111 | 101 | }}} |
… |
… |
|
261 | 251 | |
262 | 252 | The link syntax for attachments is as follows: |
263 | | * !attachment:the_file.txt creates a link to the attachment the_file.txt of the current page |
| 253 | * !attachment:the_file.txt creates a link to the attachment the_file.txt of the current object |
264 | 254 | * !attachment:the_file.txt:wiki:MyPage creates a link to the attachment the_file.txt of the !MyPage wiki page |
265 | 255 | * !attachment:the_file.txt:ticket:753 creates a link to the attachment the_file.txt of the ticket 753 |
266 | 256 | |
267 | | Note that the older way, putting the filename at the end, is still supported: !attachment:ticket:753:the_file.txt, but is not recommended. |
| 257 | Note that the older way, putting the filename at the end, is still supported: !attachment:ticket:753:the_file.txt. |
268 | 258 | |
269 | 259 | If you'd like to create a direct link to the content of the attached file instead of a link to the attachment page, simply use `raw-attachment:` instead of `attachment:`. |
270 | 260 | |
271 | | This can be useful for pointing directly to an HTML document, for example. Note that for this use case, you'd have to allow the web browser to render the content by setting [[TracIni#attachment-render_unsafe_content-option|"[attachment] render_unsafe_content"]] = `enabled`. Caveat: only do that in environments for which you're 100% confident you can trust the people who are able to attach files, as this opens up your site to [wikipedia:Cross-site_scripting cross-site scripting] attacks. |
| 261 | This can be useful for pointing directly to an HTML document, for example. Note that for this use case, you'd have to allow the web browser to render the content by setting `[attachment] render_unsafe_content = yes` (see TracIni#attachment-section). Caveat: only do that in environments for which you're 100% confident you can trust the people who are able to attach files, as otherwise this would open up your site to [wikipedia:Cross-site_scripting cross-site scripting] attacks. |
272 | 262 | |
273 | 263 | See also [#export:links]. |
… |
… |
|
294 | 284 | === search: links |
295 | 285 | |
296 | | See TracSearch#SearchTracLinks |
| 286 | See TracSearch#SearchLinks |
297 | 287 | |
298 | 288 | === ticket: links |
… |
… |
|
322 | 312 | See 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. |
323 | 313 | |
324 | | === Version Control system 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 link directs to the latter. One can always access such folder by fully qualifying it. The default repository can be an alias of a named repository, or conversely, there may be one or more aliases for the default repository, ask your Trac administrator. |
| 314 | === Version Control related links |
| 315 | |
| 316 | 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 | 317 | |
328 | 318 | 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'`. |
… |
… |
|
358 | 348 | * `export:/some/file@named-branch` - get latest revision of the specified file in `named-branch` (DVCS such as Git or Mercurial). |
359 | 349 | |
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 [[TracIni#browser-render_unsafe_content-option|"[browser] render_unsafe_content"]] = `enabled`, otherwise Trac will force the files to be downloaded as attachments for security concerns. |
| 350 | 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. |
361 | 351 | |
362 | 352 | If the path is to a directory in the repository instead of a specific file, the source browser will be used to display the directory (identical to the result of `source:/some/dir`). |
… |
… |
|
379 | 369 | Finally, note that in all of the above, a revision range can be written either as `x:y` or `x-y`. |
380 | 370 | |
381 | | ==== Multi-repository links |
382 | | |
383 | | In the presence of multiple repositories, the name of the repository should be specified as the first part of the path: |
384 | | - `log:repos/branch` |
385 | | - `[20-40/repos]` |
386 | | - `r20/repos` |
| 371 | In the presence of multiple repositories, the name of the repository should be specified as the first part of the path, e.g. `log:repos/branches` or `[20-40/repos]`. |
387 | 372 | |
388 | 373 | ---- |