Skip to content

Commit 112c520

Browse files
committed
feat: add extra inventory items using canonical path
1 parent bcf98fd commit 112c520

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

quartodoc/builder/collect.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,19 @@ def exit(self, el: layout.Doc):
3939
p_el = page_node.value
4040

4141
uri = f"{self.base_dir}/{p_el.path}.html#{el.anchor}"
42+
43+
# item corresponding to the specified path ----
44+
# e.g. this might be a top-level import
4245
self.items.append(
4346
layout.Item(name=el.obj.path, obj=el.obj, uri=uri, dispname=None)
4447
)
4548

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+
)
54+
4655
return el
4756

4857
@dispatch

0 commit comments

Comments
 (0)