Changes between Version 4 and Version 5 of TracLinks
- Timestamp:
- Sep 24, 2024, 8:55:51 AM (5 weeks ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracLinks
v4 v5 32 32 Revision log :: `r1:3`, `[1:3]` or `log:@1:3`, `log:trunk@1:3`, `[2:5/trunk]` 33 33 Diffs :: `diff:@1:3`, `diff:plugins/0.12/mercurial-plugin@9128:9953`, 34 `diff:tags/trac-0.9.2/wiki-default//tags/trac-0.9.3/wiki-default` 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 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) … … 40 40 Parent page :: [..] 41 41 Tickets :: #1 or ticket:1 42 Ticket comments :: comment:1:ticket:2 42 Ticket comments :: comment:1:ticket:2 43 43 Reports :: {1} or report:1 44 44 Milestones :: milestone:1.0 … … 47 47 Revision log :: r1:3, [1:3] or log:@1:3, log:trunk@1:3, [2:5/trunk] 48 48 Diffs :: diff:@1:3, diff:plugins/0.12/mercurial-plugin@9128:9953, 49 diff:tags/trac-0.9.2/wiki-default//tags/trac-0.9.3/wiki-default 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 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) … … 78 78 }}} 79 79 |-------------------------------------------------------------------------------------- 80 |||| `wiki` is the default if the namespace part of a full link is omitted: || 80 |||| `wiki` is the default if the namespace part of a full link is omitted: || 81 81 {{{#!td 82 82 {{{ … … 135 135 136 136 But in practice you often won't need to add the `../` prefix to link to a sibling page. 137 For resolving the location of a wiki link, it's the target page closest in the hierarchy to the page where the link is written which will be selected. So for example, within a sub-hierarchy, a sibling page will be targeted in preference to a top level page.137 For resolving the location of a wiki link, it's the target page closest in the hierarchy to the page where the link is written which will be selected. So for example, within a sub-hierarchy, a sibling page will be targeted in preference to a top-level page. 138 138 This makes it easy to copy or move pages to a sub-hierarchy by [[WikiNewPage#renaming|renaming]] without having to adapt the links. 139 139 … … 142 142 === Link anchors 143 143 144 To create a link to a specific anchor in a page, use '#':144 To create a link to a specific anchor in a page, use `#`: 145 145 {{{ 146 146 [#Linkanchors Link anchors] or [[#Linkanchors|Link anchors]] … … 148 148 [#Linkanchors Link anchors] or [[#Linkanchors|Link anchors]] 149 149 150 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. 151 152 To create a link to the first or last occurrence of a term on a page, use a ''pseudo anchor'' starting with '#/' or '#?': 150 To create an anchor in a page, use `[=#...]`: 151 {{{ 152 [=#myanchor my anchor] or empty form [=#myanchor] 153 }}} 154 [=#myanchor my anchor] or empty form [=#myanchor] 155 156 Hint: when you hover 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. 157 158 To create a link to the first or last occurrence of a term on a page, use a ''pseudo anchor'' starting with `#/` or `#?`: 153 159 {{{ 154 160 [#/Milestone first occurrence of Milestone] or … … 157 163 [#/Milestone first occurrence of Milestone] or 158 164 [#?Milestone last occurrence of Milestone] 159 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':165 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`: 160 166 {{{ 161 167 [#/Milestone/i first occurrence of Milestone or milestone] or … … 176 182 (Hint: The line numbers displayed in the source browser are links to anchors on the respective lines.) 177 183 178 Since such links become outdated when the file changes, it can be useful to link using a '#/'pseudo anchor instead:184 Since such links become outdated when the file changes, it can be useful to link using a `#/` pseudo anchor instead: 179 185 {{{ 180 186 [trac:source:trunk/trac/wiki/api.py#/IWikiSyntaxProvider IWikiSyntaxProvider] or … … 192 198 This can be seen as a kind of InterWiki link specialized for targeting other Trac projects. 193 199 194 Any type of Trac link can be written in one Trac environment and actually refer to resources in another Trac environment. All that is required is to prefix the Trac link with the name of the other Trac environment followed by a colon. The other Trac environment must be registered on the InterTrac page. 195 196 A distinct ive advantage of InterTrac links over InterWiki links is that the shorthand form of Trac links (e.g. `{}`, `r`, `#`) can also be used. For example if T was set as an alias for Trac, links to Trac tickets can be written #T234, links to Trac changesets can be written[trac 1508].197 See InterTrac for the complete details. 200 Any type of Trac link can be written in one Trac environment and actually refer to resources in another Trac environment. All that is required is to prefix the Trac link with the name of the other Trac environment followed by a colon. The other Trac environment must be registered on the InterTrac page. 201 202 A distinct advantage of InterTrac links over InterWiki links is that the shorthand form of Trac links can also be used, such as `{}`, `r`, `#`. For example, if T was set as an alias for Trac, then links to Trac tickets can be written as #T234, and links to Trac changesets can be written as [trac 1508]. 203 See InterTrac for the complete details. 198 204 199 205 === Server-relative links … … 225 231 * !wiki:"The whitespace convention" 226 232 * !attachment:'the file.txt' or 227 * !attachment:"the file.txt" 228 * !attachment:"the file.txt:ticket:123" 233 * !attachment:"the file.txt" 234 * !attachment:"the file.txt:ticket:123" 229 235 230 236 Note that by using [trac:WikiCreole] style links, it's quite natural to write links containing spaces: … … 269 275 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 276 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.277 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 [https://en.wikipedia.org/wiki/Cross-site_scripting cross-site scripting] attacks. 272 278 273 279 See also [#export:links]. … … 277 283 When you're inside a given ticket, you can simply write e.g. !comment:3 to link to the third change comment. 278 284 It is possible to link to a comment of a specific ticket from anywhere using one of the following syntax: 279 - `comment:3:ticket:123` 285 - `comment:3:ticket:123` 280 286 - `ticket:123#comment:3` (note that you can't write `#123#!comment:3`!) 281 287 It is also possible to link to the ticket's description using one of the following syntax: … … 302 308 Besides the obvious `ticket:id` form, it is also possible to specify a list of tickets or even a range of tickets instead of the `id`. This generates a link to a custom query view containing this fixed set of tickets. 303 309 304 Example: 310 Example: 305 311 - `ticket:5000-6000` 306 312 - `ticket:1,150` … … 358 364 * `export:/some/file@named-branch` - get latest revision of the specified file in `named-branch` (DVCS such as Git or Mercurial). 359 365 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. 366 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. 361 367 362 368 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`). … … 368 374 - `log:/trunk/tools` - the latest revisions in `trunk/tools` 369 375 - `log:/trunk/tools@10000` - the revisions in `trunk/tools` starting from revision 10000 370 - `log:@20788,20791:20795` - list revision 20788 and the revisions from 20791 to 20795 376 - `log:@20788,20791:20795` - list revision 20788 and the revisions from 20791 to 20795 371 377 - `log:/trunk/tools@20788,20791:20795` - list revision 20788 and the revisions from 20791 to 20795 which affect the given path 372 378 - `log:/tools@named-branch` - the revisions in `tools` starting from the latest revision in `named-branch` (DVCS such as Git or Mercurial)