Changes between Version 2 and Version 3 of WikiRestructuredTextLinks


Ignore:
Timestamp:
2023-04-20T18:47:43Z (19 months ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiRestructuredTextLinks

    v2 v3  
    11= TracLinks in reStructuredText =
     2[[TracGuideToc]]
    23
    3 This document illustrates how to use the ``..trac::`` directive in reStructureThe page is written like
     4This document illustrates how to use the `:trac:` role in [http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html reStructuredText]. The page is written like:
    45
    56{{{
    6 {{{
    7 #!rst
     7{{{#!rst
     8Examples:
    89
    9 Examples:
    1010 * Tickets: :trac:`#1` or :trac:`ticket:1`
    1111 * Ticket comments: :trac:`comment:ticket:1:2`
     
    1313 * Changesets: :trac:`r1`, :trac:`[1]` or :trac:`changeset:1`
    1414 * Revision log: :trac:`r1:3`, :trac:`[1:3]` or :trac:`log:@1:3`, :trac:`log:trunk@1:3`
    15  * Diffs (since version 0.10): :trac:`diff:@20:30`, :trac:`diff:tags/trac-0.9.2/wiki-default//tags/trac-0.9.3/wiki-default` or :trac:`diff:trunk/trac@3538//sandbox/vc-refactoring/trac@3539`
     15 * Diffs: :trac:`diff:@20:30`, :trac:`diff:tags/trac-0.9.2/wiki-default//tags/trac-0.9.3/wiki-default` or :trac:`diff:trunk/trac@3538//sandbox/vc-refactoring/trac@3539`
    1616 * Wiki pages: :trac:`CamelCase` or :trac:`wiki:CamelCase`
    1717 * Milestones: :trac:`milestone:1.0`
     
    2121 * A particular line of a specific file revision: :trac:`source:/trunk/COPYING@200#L25`
    2222
     23An explicit label can be specified, separated from the link by a space:
     24
     25 * See :trac:`#1 ticket 1` and the :trac:`source:trunk/COPYING license`.
    2326}}}
    2427}}}
    2528
    26 Provided you have docutils installed, the above block will render as:
     29Provided you have [http://docutils.sourceforge.net/ docutils] installed, the above block will render as:
    2730----
    28 {{{
    29 #!rst
     31{{{#!rst
     32Examples:
    3033
    31 Examples:
    3234 * Tickets: :trac:`#1` or :trac:`ticket:1`
    3335 * Ticket comments: :trac:`comment:ticket:1:2`
     
    3537 * Changesets: :trac:`r1`, :trac:`[1]` or :trac:`changeset:1`
    3638 * Revision log: :trac:`r1:3`, :trac:`[1:3]` or :trac:`log:@1:3`, :trac:`log:trunk@1:3`
    37  * Diffs (since version 0.10): :trac:`diff:@20:30`, :trac:`diff:tags/trac-0.9.2/wiki-default//tags/trac-0.9.3/wiki-default` or :trac:`diff:trunk/trac@3538//sandbox/vc-refactoring/trac@3539`
     39 * Diffs: :trac:`diff:@20:30`, :trac:`diff:tags/trac-0.9.2/wiki-default//tags/trac-0.9.3/wiki-default` or :trac:`diff:trunk/trac@3538//sandbox/vc-refactoring/trac@3539`
    3840 * Wiki pages: :trac:`CamelCase` or :trac:`wiki:CamelCase`
    3941 * Milestones: :trac:`milestone:1.0`
     
    4345 * A particular line of a specific file revision: :trac:`source:/trunk/COPYING@200#L25`
    4446
     47An explicit label can be specified, separated from the link by a space:
     48
     49 * See :trac:`#1 ticket 1` and the :trac:`source:trunk/COPYING license`.
    4550}}}
    4651----
    4752
    48 Note also that any of the above could have been written using the alternate syntax for roles:
     53Note that the above could have been written using substitution references and the `trac::` directive:
    4954{{{
    50 {{{
    51 #!rst
     55{{{#!rst
     56See |ticket123|.
    5257
    53 See _`ticket:123`
    54 
    55  .. trac:: ticket:123 Ticket 123
     58 .. |ticket123| trac:: ticket:123 this ticket
    5659}}}
    5760}}}
     61
     62This renders as:
    5863----
    5964
    60 {{{
    61 #!rst
     65{{{#!rst
     66See |ticket123|.
    6267
    63 See _`ticket:123`
    64 
    65 .. trac:: ticket:123 Ticket 123
     68 .. |ticket123| trac:: ticket:123 this ticket
    6669}}}
    67 ----
    68 The above form has the additional benefit of allowing you to specify an explicit label for the link.
    6970
    7071----