@@ -15,7 +15,7 @@ will support more compact relative syntax:
1515 class MyClass:
1616 def this_method(self):
1717 """
18- See [other_function ][mypkg.mymod.MyClass.other_function ]
18+ See [other_method ][mypkg.mymod.MyClass.other_method ]
1919 from [MyClass][mypkg.mymod.Myclass]
2020 """
2121 ```
@@ -26,7 +26,7 @@ will support more compact relative syntax:
2626 class MyClass:
2727 def this_method(self):
2828 """
29- See [other_function ][.] from [MyClass][^ ]
29+ See [other_method ][.. ] from [MyClass][(c) ]
3030 """
3131 ```
3232
@@ -38,11 +38,6 @@ The relative path specifier has the following form:
3838* If the path begins with a single ` . ` then it will be expanded relative to the path
3939 of the doc-string in which it occurs.
4040
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-
4641* If the path begins with ` (c) ` , that will be replaced by the path of the
4742 class that contains the doc-string
4843
@@ -53,10 +48,17 @@ The relative path specifier has the following form:
5348 package that contains the doc-string. If there is only one module in the
5449 system it will be treated as a package.
5550
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*
6062
6163These are demonstrated here:
6264
@@ -66,7 +68,10 @@ These are demonstrated here:
6668 class MyClass:
6769 def this_method(self):
6870 """
69- [`that_method`][.]
71+ [MyClass][^]
72+ Also [MyClass][(c)]
73+ [`that_method`][^.]
74+ Also [`that_method`][..]
7075 [init method][(c).__init__]
7176 [this module][(m)]
7277 [this package][(p)]
@@ -81,7 +86,10 @@ These are demonstrated here:
8186 class MyClass:
8287 def this_method(self):
8388 """
89+ [MyClass][mypkg.mymod.MyClass]
90+ Also [MyClass][mypkg.mymod.MyClass]
8491 [`that_method`][mypkg.mymod.MyClass.that_method]
92+ Also [`that_method`][mypkg.mymod.MyClass.that_method]
8593 [init method][mypkg.mymod.MyClass.__init__]
8694 [this module][mypkg.mymod]
8795 [this package][mypkg]
0 commit comments