Skip to content

Commit 8f4c853

Browse files
committed
refactor: Respect show_root_full_path for ToC entries (hidden headings)
1 parent 59104c4 commit 8f4c853

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/mkdocstrings_handlers/python/templates/material/_base/attribute.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
{% filter heading(heading_level,
5454
role="data" if attribute.parent.kind.value == "module" else "attr",
5555
id=html_id,
56-
toc_label=attribute.path,
56+
toc_label=attribute.path if config.show_root_full_path else attribute.name,
5757
hidden=True) %}
5858
{% endfilter %}
5959
{% endif %}

src/mkdocstrings_handlers/python/templates/material/_base/class.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
{% filter heading(heading_level,
6060
role="class",
6161
id=html_id,
62-
toc_label=class.path,
62+
toc_label=class.path if config.show_root_full_path else class.name,
6363
hidden=True) %}
6464
{% endfilter %}
6565
{% endif %}

src/mkdocstrings_handlers/python/templates/material/_base/function.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
{% filter heading(heading_level,
5252
role="function",
5353
id=html_id,
54-
toc_label=function.path,
54+
toc_label=function.path if config.show_root_full_path else function.name,
5555
hidden=True) %}
5656
{% endfilter %}
5757
{% endif %}

src/mkdocstrings_handlers/python/templates/material/_base/module.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
{% filter heading(heading_level,
3838
role="module",
3939
id=html_id,
40-
toc_label=module.path,
40+
toc_label=module.path if config.show_root_full_path else module.name,
4141
hidden=True) %}
4242
{% endfilter %}
4343
{% endif %}

0 commit comments

Comments
 (0)