Skip to content

Commit 337b46b

Browse files
committed
fix: Use toc_label option in a few missing places
Issue-267: #267
1 parent ecc5fe1 commit 337b46b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Context:
3939
role="data" if attribute.parent.kind.value == "module" else "attr",
4040
id=html_id,
4141
class="doc doc-heading",
42-
toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-attribute"></code>&nbsp;'|safe if config.show_symbol_type_toc else '') + attribute.name,
42+
toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-attribute"></code>&nbsp;'|safe if config.show_symbol_type_toc else '') + (config.toc_label if config.toc_label and root else attribute_name),
4343
) %}
4444

4545
{% block heading scoped %}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Context:
3838
role="class",
3939
id=html_id,
4040
class="doc doc-heading",
41-
toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-class"></code>&nbsp;'|safe if config.show_symbol_type_toc else '') + class.name,
41+
toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-class"></code>&nbsp;'|safe if config.show_symbol_type_toc else '') + (config.toc_label if config.toc_label and root else class.name),
4242
) %}
4343

4444
{% block heading scoped %}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Context:
4545
role="function",
4646
id=html_id,
4747
class="doc doc-heading",
48-
toc_label=(('<code class="doc-symbol doc-symbol-toc doc-symbol-' + symbol_type + '"></code>&nbsp;')|safe if config.show_symbol_type_toc else '') + function.name,
48+
toc_label=(('<code class="doc-symbol doc-symbol-toc doc-symbol-' + symbol_type + '"></code>&nbsp;')|safe if config.show_symbol_type_toc else '') + (config.toc_label if config.toc_label and root else function.name),
4949
) %}
5050

5151
{% block heading scoped %}

0 commit comments

Comments
 (0)