8000 fix: Use configured heading even when signature is not separated · mkdocstrings/python@22118ab · GitHub
[go: up one dir, main page]

Skip to content

Commit 22118ab

Browse files
committed
fix: Use configured heading even when signature is not separated
Issue-767: mkdocstrings/mkdocstrings#767
1 parent d4e618a commit 22118ab

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ Context:
4848
This block renders the heading for the attribute.
4949
-#}
5050
{% if config.show_symbol_type_heading %}<code class="doc-symbol doc-symbol-heading doc-symbol-attribute"></code>{% endif %}
51-
{% if config.separate_signature %}
52-
<span class="doc doc-object-name doc-attribute-name">{{ config.heading if config.heading and root else attribute_name }}</span>
51+
{% if config.heading and root %}
52+
{{ config.heading }}
53+
{% elif config.separate_signature %}
54+
<span class="doc doc-object-name doc-attribute-name">{{ attribute_name }}</span>
5355
{% else %}
5456
{%+ filter highlight(language="python", inline=True) %}
5557
{{ attribute_name }}{% if attribute.annotation and config.show_signature_annotations %}: {{ attribute.annotation }}{% endif %}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ Context:
4747
This block renders the heading for the class.
4848
-#}
4949
{% if config.show_symbol_type_heading %}<code class="doc-symbol doc-symbol-heading doc-symbol-class"></code>{% endif %}
50-
{% if config.separate_signature %}
51-
<span class="doc doc-object-name doc-class-name">{{ config.heading if config.heading and root else class_name }}</span>
50+
{% if config.heading and root %}
51+
{{ config.heading }}
52+
{% elif config.separate_signature %}
53+
<span class="doc doc-object-name doc-class-name">{{ class_name }}</span>
5254
{% elif config.merge_init_into_class and "__init__" in all_members %}
5355
{% with function = all_members["__init__"] %}
5456
{%+ filter highlight(language="python", inline=True) -%}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ Context:
5454
This block renders the heading for the function.
5555
-#}
5656
{% if config.show_symbol_type_heading %}<code class="doc-symbol doc-symbol-heading doc-symbol-{{ symbol_type }}"></code>{% endif %}
57-
{% if config.separate_signature %}
58-
<span class="doc doc-object-name doc-function-name">{{ config.heading if config.heading and root else function_name }}</span>
57+
{% if config.heading and root %}
58+
{{ config.heading }}
59+
{% elif config.separate_signature %}
60+
<span class="doc doc-object-name doc-function-name">{{ function_name }}</span>
5961
{% else %}
6062
{%+ filter highlight(language="python", inline=True) -%}
6163
{#- YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. -#}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ Context:
4747
This block renders the heading for the module.
4848
-#}
4949
{% if config.show_symbol_type_heading %}<code class="doc-symbol doc-symbol-heading doc-symbol-module"></code>{% endif %}
50-
{% if config.separate_signature %}
51-
<span class="doc doc-object-name doc-module-name">{{ config.heading if config.heading and root else module_name }}</span>
50+
{% if config.heading and root %}
51+
{{ config.heading }}
52+
{% elif config.separate_signature %}
53+
<span class="doc doc-object-name doc-module-name">{{ module_name }}</span>
5254
{% else %}
5355
<code>{{ module_name }}</code>
5456
{% endif %}

0 commit comments

Comments
 (0)
0