Changes between Version 1 and Version 2 of WikiRestructuredTextLinks


Ignore:
Timestamp:
Feb 25, 2025, 12:53:26 PM (5 weeks ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiRestructuredTextLinks

    v1 v2  
    11= TracLinks in reStructuredText =
    22
    3 This document is for testing the ``..trac::`` directive. The 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
    10 ...
    11 ...
     9 * Tickets: :trac:`#1` or :trac:`ticket:1`
     10 * Ticket comments: :trac:`comment:ticket:1:2`
     11 * Reports: :trac:`{1}` or :trac:`report:1`
     12 * Changesets: :trac:`r1`, :trac:`[1]` or :trac:`changeset:1`
     13 * Revision log: :trac:`r1:3`, :trac:`[1:3]` or :trac:`log:@1:3`, :trac:`log:trunk@1:3`
     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`
     15 * Wiki pages: :trac:`CamelCase` or :trac:`wiki:CamelCase`
     16 * Milestones: :trac:`milestone:1.0`
     17 * Attachment: :trac:`attachment:ticket:944:attachment.1073.diff`
     18 * Files: :trac:`source:trunk/COPYING`
     19 * A specific file revision: :trac:`source:/trunk/COPYING@200`
     20 * A particular line of a specific file revision: :trac:`source:/trunk/COPYING@200#L25`
    1221
     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`.
    1325}}}
    1426}}}
    1527
     28Provided you have [http://docutils.sourceforge.net/ docutils] installed, the above block will render as:
     29----
     30{{{#!rst
     31Examples:
    1632
    17 This is a list of example uses of the ''trac'' directive, providing use of TracLinks in WikiRestructuredText.
    18 Note that not all that functionality has been merged yet. The patch attached to #801 provides all of these.
     33 * Tickets: :trac:`#1` or :trac:`ticket:1`
     34 * Ticket comments: :trac:`comment:ticket:1:2`
     35 * Reports: :trac:`{1}` or :trac:`report:1`
     36 * Changesets: :trac:`r1`, :trac:`[1]` or :trac:`changeset:1`
     37 * Revision log: :trac:`r1:3`, :trac:`[1:3]` or :trac:`log:@1:3`, :trac:`log:trunk@1:3`
     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`
     39 * Wiki pages: :trac:`CamelCase` or :trac:`wiki:CamelCase`
     40 * Milestones: :trac:`milestone:1.0`
     41 * Attachment: :trac:`attachment:ticket:944:attachment.1073.diff`
     42 * Files: :trac:`source:trunk/COPYING`
     43 * A specific file revision: :trac:`source:/trunk/COPYING@200`
     44 * A particular line of a specific file revision: :trac:`source:/trunk/COPYING@200#L25`
    1945
     46An explicit label can be specified, separated from the link by a space:
    2047
     48 * See :trac:`#1 ticket 1` and the :trac:`source:trunk/COPYING license`.
     49}}}
     50----
     51
     52Note that the above could have been written using substitution references and the `trac::` directive:
    2153{{{
    22 #!rst
     54{{{#!rst
     55See |ticket123|.
    2356
    24 Examples
    25 --------
     57 .. |ticket123| trac:: ticket:123 this ticket
     58}}}
     59}}}
    2660
    27 trac role
    28 =========
    29 Syntax is \`link\`\:trac: or :trac:\`link\`, and could be put anywhere in the text. 'link' has the same format as explain for the ``.. trac::`` directive below.
     61This renders as:
     62----
    3063
    31 ``In the middle of my text `WikiFormatting`:trac: see!!!!``
    32    In the middle of my text `WikiFormatting`:trac: see!!!!
     64{{{#!rst
     65See |ticket123|.
    3366
    34 or
    35 
    36 ``In the middle of my text :trac:`WikiFormatting` see!!!!``
    37    In the middle of my text :trac:`WikiFormatting` see!!!!
    38 
    39 
    40 wiki
    41 ====
    42 ``.. trac:: WikiFormatting``
    43         .. trac:: WikiFormatting
    44 
    45 ``.. trac:: wiki:WikiFormatting``
    46        .. trac:: wiki:WikiFormatting
    47 
    48 ``.. trac:: wiki:WikiFormatting WikiFormatting``
    49         .. trac:: wiki:WikiFormatting WikiFormatting
    50 
    51 ``.. trac:: wiki:WikiFormatting LinkText``
    52         .. trac:: wiki:WikiFormatting LinkText
    53 
    54 tickets
    55 =======
    56 
    57 ``.. trac:: #1``
    58         .. trac:: #1
    59 ``.. trac:: #1 ticket one``
    60         .. trac:: #1 ticket one
    61 ``.. trac:: ticket:1``
    62         .. trac:: ticket:1
    63 ``.. trac:: ticket:1 ticket one``
    64         .. trac:: ticket:1 ticket one
    65 
    66 reports
    67 =======
    68 
    69 ``.. trac:: {1}``
    70         .. trac:: {1}
    71 ``.. trac:: {1} report one``
    72         .. trac:: {1} report one
    73 ``.. trac:: report:1``
    74         .. trac:: report:1
    75 ``.. trac:: report:1 report one``
    76         .. trac:: report:1 report one
    77 
    78 changesets
    79 ==========
    80 
    81 ``.. trac:: [42]``
    82         .. trac:: [42]
    83 ``.. trac:: [42] changeset 42``
    84         .. trac:: [42] changeset 42
    85 ``.. trac:: changeset:42``
    86         .. trac:: changeset:42
    87 ``.. trac:: changeset:42 changeset 42``
    88         .. trac:: changeset:42 changeset 42
    89 ``.. trac:: foo``
    90         .. trac:: foo
    91 
    92 files
    93 =====
    94 
    95 ``.. trac:: browser:/trunk/trac``
    96         .. trac:: browser:/trunk/trac
    97 
    98 The leading ``/`` can be omitted...
    99 
    100 ``.. trac:: repos:trunk/trac trunk/trac``
    101         .. trac:: repos:trunk/trac trunk/trac
    102 ``.. trac:: source:trunk/trac Trac source code``
    103         .. trac:: source:trunk/trac Trac source code
    104 
    105 ``.. trac:: browser:trunk/README``
    106         .. trac:: browser:trunk/README
    107 ``.. trac:: repos:trunk/README trunk/README``
    108         .. trac:: repos:trunk/README trunk/README
    109 ``.. trac:: source:trunk/README README in trunk``
    110         .. trac:: source:trunk/README README in trunk
    111 
    112 Note that if ``hoo`` is a file, the link targets its revision log. In order to see the file's content, you need to specify the revision explicitely, like here:
    113 
    114 ``.. trac:: browser:/trunk/README#latest latest of trunk/README``
    115         .. trac:: browser:/trunk/README#latest latest of trunk/README
    116 ``.. trac:: repos:trunk/README#42 trunk/README in rev 42``
    117         .. trac:: repos:trunk/README#42 trunk/README in rev 42
     67 .. |ticket123| trac:: ticket:123 this ticket
    11868}}}
    11969
    12070----
    121 See also: WikiRestructuredTextLinks, TracLinks
     71See also: WikiRestructuredText, TracLinks