Changes between Version 4 and Version 5 of WikiRestructuredTextLinks
- Timestamp:
- 2023-04-20T18:31:29Z (19 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WikiRestructuredTextLinks
v4 v5 1 1 = TracLinks in reStructuredText = 2 [[TracGuideToc]] 2 3 3 This document illustrates how to use the ` `..trac::`` directive in reStructureThe page is written like4 This document illustrates how to use the `:trac:` role in [http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html reStructuredText]. The page is written like: 4 5 5 6 {{{ 6 {{{ 7 #!rst 7 {{{#!rst 8 Examples: 8 9 9 Examples:10 10 * Tickets: :trac:`#1` or :trac:`ticket:1` 11 11 * Ticket comments: :trac:`comment:ticket:1:2` … … 13 13 * Changesets: :trac:`r1`, :trac:`[1]` or :trac:`changeset:1` 14 14 * 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` 16 16 * Wiki pages: :trac:`CamelCase` or :trac:`wiki:CamelCase` 17 17 * Milestones: :trac:`milestone:1.0` … … 21 21 * A particular line of a specific file revision: :trac:`source:/trunk/COPYING@200#L25` 22 22 23 An 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`. 23 26 }}} 24 27 }}} 25 28 26 Provided you have docutilsinstalled, the above block will render as:29 Provided you have [http://docutils.sourceforge.net/ docutils] installed, the above block will render as: 27 30 ---- 28 {{{ 29 #!rst 31 {{{#!rst 32 Examples: 30 33 31 Examples:32 34 * Tickets: :trac:`#1` or :trac:`ticket:1` 33 35 * Ticket comments: :trac:`comment:ticket:1:2` … … 35 37 * Changesets: :trac:`r1`, :trac:`[1]` or :trac:`changeset:1` 36 38 * 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` 38 40 * Wiki pages: :trac:`CamelCase` or :trac:`wiki:CamelCase` 39 41 * Milestones: :trac:`milestone:1.0` … … 43 45 * A particular line of a specific file revision: :trac:`source:/trunk/COPYING@200#L25` 44 46 47 An 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`. 45 50 }}} 46 51 ---- 47 52 48 Note also that any of the above could have been written using the alternate syntax for roles:53 Note that the above could have been written using substitution references and the `trac::` directive: 49 54 {{{ 50 {{{ 51 #!rst 55 {{{#!rst 56 See |ticket123|. 52 57 53 See _`ticket:123` 54 55 .. trac:: ticket:123 Ticket 123 58 .. |ticket123| trac:: ticket:123 this ticket 56 59 }}} 57 60 }}} 61 62 This renders as: 58 63 ---- 59 64 60 {{{ 61 #!rst 65 {{{#!rst 66 See |ticket123|. 62 67 63 See _`ticket:123` 64 65 .. trac:: ticket:123 Ticket 123 68 .. |ticket123| trac:: ticket:123 this ticket 66 69 }}} 67 ----68 The above form has the additional benefit of allowing you to specify an explicit label for the link.69 70 70 71 ----