@@ -15,6 +15,10 @@ def autodoc_process_docstring(app, what, name, obj, options, lines):
15
15
# name with that of the parent object name plus a token we can
16
16
# spot later.
17
17
def _cvt_param (name , line ):
18
+ if name .endswith (".__init__" ):
19
+ # kill off __init__ if present, the links are always
20
+ # off the class
21
+ name = name [0 :- 9 ]
18
22
def cvt (m ):
19
23
return ":param %s_sphinx_paramlinks_%s.%s:" % (
20
24
m .group (1 ) or '' , name , m .group (2 ))
@@ -126,20 +130,8 @@ def lookup_params(app, env, node, contnode):
126
130
# along with the classname/methodname/funcname minus the parameter
127
131
# part.
128
132
129
- # see if this is a class constructor first...
130
133
newnode = domain .resolve_xref (env , refdoc , app .builder ,
131
- "class" , resolve_target , node , contnode )
132
- if newnode :
133
- # if yes, see if the __init__ is documented explicitly
134
- methnode = domain .resolve_xref (env , refdoc , app .builder ,
135
- "meth" , resolve_target + ".__init__" , node , contnode )
136
- if methnode :
137
- newnode = methnode
138
-
139
- else :
140
- # if no, just look up based on "obj"
141
- newnode = domain .resolve_xref (env , refdoc , app .builder ,
142
- "obj" , resolve_target , node , contnode )
134
+ "obj" , resolve_target , node , contnode )
143
135
144
136
if newnode is not None :
145
137
# assuming we found it, tack the paramname back onto to the final
0 commit comments