aboutsummaryrefslogtreecommitdiff
path: root/raw-wiki-dump/WikiRestructuredTextLinks.trac
blob: 14b2d06bb63c08fa79647b8dd7ec0b533feec959 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
= TracLinks in reStructuredText =

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:

{{{
{{{#!rst
Examples:

 * Tickets: :trac:`#1` or :trac:`ticket:1`
 * Ticket comments: :trac:`comment:ticket:1:2`
 * Reports: :trac:`{1}` or :trac:`report:1`
 * Changesets: :trac:`r1`, :trac:`[1]` or :trac:`changeset:1`
 * Revision log: :trac:`r1:3`, :trac:`[1:3]` or :trac:`log:@1:3`, :trac:`log:trunk@1:3`
 * 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`
 * Wiki pages: :trac:`CamelCase` or :trac:`wiki:CamelCase`
 * Milestones: :trac:`milestone:1.0`
 * Attachment: :trac:`attachment:ticket:944:attachment.1073.diff`
 * Files: :trac:`source:trunk/COPYING`
 * A specific file revision: :trac:`source:/trunk/COPYING@200`
 * A particular line of a specific file revision: :trac:`source:/trunk/COPYING@200#L25`

An explicit label can be specified, separated from the link by a space:

 * See :trac:`#1 ticket 1` and the :trac:`source:trunk/COPYING license`.
}}}
}}}

Provided you have [http://docutils.sourceforge.net/ docutils] installed, the above block will render as:
----
{{{#!rst
Examples:

 * Tickets: :trac:`#1` or :trac:`ticket:1`
 * Ticket comments: :trac:`comment:ticket:1:2`
 * Reports: :trac:`{1}` or :trac:`report:1`
 * Changesets: :trac:`r1`, :trac:`[1]` or :trac:`changeset:1`
 * Revision log: :trac:`r1:3`, :trac:`[1:3]` or :trac:`log:@1:3`, :trac:`log:trunk@1:3`
 * 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`
 * Wiki pages: :trac:`CamelCase` or :trac:`wiki:CamelCase`
 * Milestones: :trac:`milestone:1.0`
 * Attachment: :trac:`attachment:ticket:944:attachment.1073.diff`
 * Files: :trac:`source:trunk/COPYING`
 * A specific file revision: :trac:`source:/trunk/COPYING@200`
 * A particular line of a specific file revision: :trac:`source:/trunk/COPYING@200#L25`

An explicit label can be specified, separated from the link by a space:

 * See :trac:`#1 ticket 1` and the :trac:`source:trunk/COPYING license`.
}}}
----

Note that the above could have been written using substitution references and the `trac::` directive:
{{{
{{{#!rst
See |ticket123|.

 .. |ticket123| trac:: ticket:123 this ticket
}}}
}}}

This renders as:
----

{{{#!rst
See |ticket123|.

 .. |ticket123| trac:: ticket:123 this ticket
}}}

----
See also: WikiRestructuredText, TracLinks