Changes between Version 1 and Version 2 of WikiRestructuredTextLinks


Ignore:
Timestamp:
11/17/17 12:56:09 (7 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiRestructuredTextLinks

    v1 v2  
    11= TracLinks in reStructuredText =
    22
    3 This document illustrates how to use the ``..trac::`` directive in reStructureThe page is written like
     3This document illustrates how to use the `:trac:` role in [http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html reStructuredText]. The page is written like:
    44
    55{{{
    6 {{{
    7 #!rst
     6{{{#!rst
     7Examples:
    88
    9 Examples:
    109 * Tickets: :trac:`#1` or :trac:`ticket:1`
    1110 * Ticket comments: :trac:`comment:ticket:1:2`
     
    1312 * Changesets: :trac:`r1`, :trac:`[1]` or :trac:`changeset:1`
    1413 * 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`
     14 * 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`
    1615 * Wiki pages: :trac:`CamelCase` or :trac:`wiki:CamelCase`
    1716 * Milestones: :trac:`milestone:1.0`
     
    2120 * A particular line of a specific file revision: :trac:`source:/trunk/COPYING@200#L25`
    2221
     22An explicit label can be specified, separated from the link by a space:
     23
     24 * See :trac:`#1 ticket 1` and the :trac:`source:trunk/COPYING license`.
    2325}}}
    2426}}}
    2527
    26 Provided you have docutils installed, the above block will render as:
     28Provided you have [http://docutils.sourceforge.net/ docutils] installed, the above block will render as:
    2729----
    28 {{{
    29 #!rst
     30{{{#!rst
     31Examples:
    3032
    31 Examples:
    3233 * Tickets: :trac:`#1` or :trac:`ticket:1`
    3334 * Ticket comments: :trac:`comment:ticket:1:2`
     
    3536 * Changesets: :trac:`r1`, :trac:`[1]` or :trac:`changeset:1`
    3637 * 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`
     38 * 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`
    3839 * Wiki pages: :trac:`CamelCase` or :trac:`wiki:CamelCase`
    3940 * Milestones: :trac:`milestone:1.0`
     
    4344 * A particular line of a specific file revision: :trac:`source:/trunk/COPYING@200#L25`
    4445
     46An explicit label can be specified, separated from the link by a space:
     47
     48 * See :trac:`#1 ticket 1` and the :trac:`source:trunk/COPYING license`.
    4549}}}
    4650----
    4751
    48 Note also that any of the above could have been written using the alternate syntax for roles:
     52Note that the above could have been written using substitution references and the `trac::` directive:
    4953{{{
    50 {{{
    51 #!rst
     54{{{#!rst
     55See |ticket123|.
    5256
    53 See _`ticket:123`
    54 
    55  .. trac:: ticket:123 Ticket 123
     57 .. |ticket123| trac:: ticket:123 this ticket
    5658}}}
    5759}}}
     60
     61This renders as:
    5862----
    5963
    60 {{{
    61 #!rst
     64{{{#!rst
     65See |ticket123|.
    6266
    63 See _`ticket:123`
    64 
    65 .. trac:: ticket:123 Ticket 123
     67 .. |ticket123| trac:: ticket:123 this ticket
    6668}}}
    67 ----
    68 The above form has the additional benefit of allowing you to specify an explicit label for the link.
    6969
    7070----