File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -40,17 +40,23 @@ def exit(self, el: layout.Doc):
40
40
41
41
uri = f"{ self .base_dir } /{ p_el .path } .html#{ el .anchor } "
42
42
43
+ name_path = el .obj .path
44
+ canonical_path = el .obj .canonical_path
45
+
43
46
# item corresponding to the specified path ----
44
47
# e.g. this might be a top-level import
45
48
self .items .append (
46
- layout .Item (name = el . obj . path , obj = el .obj , uri = uri , dispname = None )
49
+ layout .Item (name = name_path , obj = el .obj , uri = uri , dispname = None )
47
50
)
48
51
49
- # item corresponding to the canonical path ----
50
- # this is where the object is defined (which may be deep in a submodule)
51
- self .items .append (
52
- layout .Item (name = el .obj .canonical_path , obj = el .obj , uri = uri , dispname = None )
53
- )
52
+ if name_path != canonical_path :
53
+ # item corresponding to the canonical path ----
54
+ # this is where the object is defined (which may be deep in a submodule)
55
+ self .items .append (
56
+ layout .Item (
57
+ name = canonical_path , obj = el .obj , uri = uri , dispname = name_path
58
+ )
59
+ )
54
60
55
61
return el
56
62
You can’t perform that action at this time.
0 commit comments