Edgewall Software

Changes between Version 1 and Version 2 of 0.13/TracLinks


Ignore:
Timestamp:
Aug 8, 2011, 8:17:49 PM (13 years ago)
Author:
Peter Suter
Comment:

Document the pseudo link anchors from #10284

Legend:

Unmodified
Added
Removed
Modified
  • 0.13/TracLinks

    v1 v2  
    112112=== Relative links ===
    113113
    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 
    123114To create a link to a [trac:SubWiki SubWiki]-page just use a '/':
    124115{{{
     
    152143''(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.
    153144See [#Server-relativelinks] for the new syntax.
     145
     146=== Link anchors ===
     147
     148To create a link to a specific anchor in a page, use '#':
     149{{{
     150 [#Linkanchors Link anchors] or [[#Linkanchors|Link anchors]]
     151}}}
     152  [#Linkanchors Link anchors] or [[#Linkanchors|Link anchors]]
     153
     154Hint: 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.
     155
     156To create a link to the first or last occurrence of a term on a page, use a ''pseudo anchor'' starting with '#/' or '#?':
     157{{{
     158 [#/Milestone first occurrence of Milestone] or
     159 [#?Milestone last occurrence of Milestone]
     160}}}
     161 [#/Milestone first occurrence of Milestone] or
     162 [#?Milestone last occurrence of Milestone]
     163This 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':
     164{{{
     165 [#/Milestone/i first occurrence of Milestone or milestone] or
     166 [#?Milestone/i last occurrence of Milestone or milestone]
     167}}}
     168 [#/Milestone/i first occurrence of Milestone or milestone] or
     169 [#?Milestone/i last occurrence of Milestone or milestone]
     170
     171''(since Trac 0.13)''
     172
     173Such anchors can be very useful for linking to specific lines in a file in the source browser:
     174{{{
     175 [trac:source:tags/trac-0.12/trac/wiki/api.py#L127 Line 127] or
     176 [trac:source:tags/trac-0.12/trac/ticket/roadmap.py#L47 Line 47]
     177}}}
     178 [trac:source:tags/trac-0.12/trac/wiki/api.py#L127 Line 127] or
     179 [trac:source:tags/trac-0.12/trac/ticket/roadmap.py#L47 Line 47]
     180(Hint: The line numbers displayed in the source browser are links to anchors on the respective lines.)
     181
     182Since such links become outdated when the file changes, it can be useful to link using a '#/' pseudo anchor instead:
     183{{{
     184 [trac:source:trunk/trac/wiki/api.py#/IWikiSyntaxProvider IWikiSyntaxProvider] or
     185 [trac:source:trunk/trac/env.py#/ISystemInfoProvider ISystemInfoProvider]
     186}}}
     187 [trac:source:trunk/trac/wiki/api.py#/IWikiSyntaxProvider IWikiSyntaxProvider] or
     188 [trac:source:trunk/trac/env.py#/ISystemInfoProvider ISystemInfoProvider]
    154189
    155190=== InterWiki links ===