@@ -15,7 +15,7 @@ will support more compact relative syntax:
15
15
class MyClass:
16
16
def this_method(self):
17
17
"""
18
- See [other_function ][mypkg.mymod.MyClass.other_function ]
18
+ See [other_method ][mypkg.mymod.MyClass.other_method ]
19
19
from [MyClass][mypkg.mymod.Myclass]
20
20
"""
21
21
```
@@ -26,7 +26,7 @@ will support more compact relative syntax:
26
26
class MyClass:
27
27
def this_method(self):
28
28
"""
29
- See [other_function ][.] from [MyClass][^ ]
29
+ See [other_method ][.. ] from [MyClass][(c) ]
30
30
"""
31
31
```
32
32
@@ -38,11 +38,6 @@ The relative path specifier has the following form:
38
38
* If the path begins with a single ` . ` then it will be expanded relative to the path
39
39
of the doc-string in which it occurs.
40
40
41
- As a deprecated special case, if the current
42
- doc-string is for a function or method, then ` . ` will instead be
43
- expanded relative to the function's parent (i.e. the same as ` ^. ` ).
44
- This will turn into an error in a future version.
45
-
46
41
* If the path begins with ` (c) ` , that will be replaced by the path of the
47
42
class that contains the doc-string
48
43
@@ -53,10 +48,17 @@ The relative path specifier has the following form:
53
48
package that contains the doc-string. If there is only one module in the
54
49
system it will be treated as a package.
55
50
56
- * If the path begins with one or more ` ^ ` characters, then that will go
57
- up one level in the path of the current doc string for each ` ^ ` . Additionally,
58
- if the path begins with two or more ` . ` characters, then that will go
59
- up on level for each ` . ` after the first.
51
+ * If the path begins with one or more ` ^ ` characters, then will be replaced
52
+ by the path of the parent element. For example, when used in a doc-string
53
+ for a method, ` ^ ` would get replaced with the class and ` ^^ ` would get
54
+ replaced with the module.
55
+
56
+ * Similarly, if the path begins with two or more ` . ` characters, then all but
57
+ the last ` . ` will be replaced by the parent element, and if nothing follows
58
+ the last ` . ` , the title text will be appended according to the first rule.
59
+
60
+ * NOTE: When using either ` ^ ` or ` .. ` we have found that going up more than one
61
+ or two levels makes cross-references difficult to read and should be avoided*
60
62
61
63
These are demonstrated here:
62
64
@@ -66,7 +68,10 @@ These are demonstrated here:
66
68
class MyClass:
67
69
def this_method(self):
68
70
"""
69
- [`that_method`][.]
71
+ [MyClass][^]
72
+ Also [MyClass][(c)]
73
+ [`that_method`][^.]
74
+ Also [`that_method`][..]
70
75
[init method][(c).__init__]
71
76
[this module][(m)]
72
77
[this package][(p)]
@@ -81,7 +86,10 @@ These are demonstrated here:
81
86
class MyClass:
82
87
def this_method(self):
83
88
"""
89
+ [MyClass][mypkg.mymod.MyClass]
90
+ Also [MyClass][mypkg.mymod.MyClass]
84
91
[`that_method`][mypkg.mymod.MyClass.that_method]
92
+ Also [`that_method`][mypkg.mymod.MyClass.that_method]
85
93
[init method][mypkg.mymod.MyClass.__init__]
86
94
[this module][mypkg.mymod]
87
95
[this package][mypkg]
0 commit comments