Skip to content

Commit 77f23ea

Browse files
committed
fixup
1 parent ad38d84 commit 77f23ea

File tree

8 files changed

+22
-31
lines changed

8 files changed

+22
-31
lines changed
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1+
{# YORE: Bump 2: Remove file. #}
12
{% extends "_base/docstring/type_aliases.html.jinja" %}
23

34
{% block logs scoped %}
45
{{ super() }}
5-
{# TODO: Switch to a warning after some time. #}
6-
{{ log.info(
7-
"DeprecationWarning: Extending '_base/docstring/type_aliases.html' is deprecated, extend '_base/docstring/type_aliases.html.jinja' instead. " ~
8-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/docstring/type_aliases.html' is deprecated, extend '_base/docstring/type_aliases.html.jinja' instead. ",
98
once=True,
109
) }}
1110
{% endblock logs %}
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1+
{# YORE: Bump 2: Remove file. #}
12
{% extends "_base/docstring/type_parameters.html.jinja" %}
23

34
{% block logs scoped %}
45
{{ super() }}
5-
{# TODO: Switch to a warning after some time. #}
6-
{{ log.info(
7-
"DeprecationWarning: Extending '_base/docstring/type_parameters.html' is deprecated, extend '_base/docstring/type_parameters.html.jinja' instead. " ~
8-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/docstring/type_parameters.html' is deprecated, extend '_base/docstring/type_parameters.html.jinja' instead. ",
98
once=True,
109
) }}
1110
{% endblock logs %}

src/mkdocstrings_handlers/python/templates/material/_base/docstring/type_parameters.html.jinja

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@ Context:
1919
{#- Language module providing the `t` translation method. -#}
2020

2121
{% with %}
22-
{% set is_merged_init = obj.is_function and obj.name == "__init__" and config.merge_init_into_class %}
23-
2422
{% if config.docstring_section_style == "table" %}
2523
{% block table_style scoped %}
2624
{#- Block for the `table` section style. -#}
27-
<p><span class="doc-section-title">{{ section.title or lang.t("Type Parameters:") if not is_merged_init else lang.t("<code>__init__</code> Type Parameters:") }}</span></p>
25+
<p><span class="doc-section-title">{{ section.title or lang.t("Type Parameters:") }}</span></p>
2826
<table>
2927
<thead>
3028
<tr>
@@ -42,7 +40,7 @@ Context:
4240
{% filter heading(
4341
heading_level + 1,
4442
role="typeparam",
45-
id=obj.path ~ ":" ~ type_parameter.name,
43+
id=obj.path ~ "[" ~ type_parameter.name ~ "]",
4644
class="doc doc-heading doc-heading-type_parameter",
4745
toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-type_parameter"></code>&nbsp;'|safe if config.show_symbol_type_toc else '') + type_parameter.name,
4846
) %}
@@ -81,15 +79,15 @@ Context:
8179
{% elif config.docstring_section_style == "list" %}
8280
{% block list_style scoped %}
8381
{#- Block for the `list` section style. -#}
84-
<p><span class="doc-section-title">{{ section.title or lang.t("Type Parameters:") if not is_merged_init else lang.t("<code>__init__</code> Type Parameters:") }}</span></p>
82+
<p><span class="doc-section-title">{{ section.title or lang.t("Type Parameters:") }}</span></p>
8583
<ul>
8684
{% for type_parameter in section.value %}
8785
<li class="doc-section-item field-body">
8886
{% if config.type_parameter_headings %}
8987
{% filter heading(
9088
heading_level + 1,
9189
role="typeparam",
92-
id=obj.path ~ ":" ~ type_parameter.name ,
90+
id=obj.path ~ "[" ~ type_parameter.name ~ "]",
9391
class="doc doc-heading doc-heading-type_parameter",
9492
toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-type_parameter"></code>&nbsp;'|safe if config.show_symbol_type_toc else '') + type_parameter.name,
9593
) %}
@@ -130,7 +128,7 @@ Context:
130128
<table>
131129
<thead>
132130
<tr>
133-
<th><span class="doc-section-title">{{ (section.title or lang.t("TYPE PARAMETER")).rstrip(":").upper() if not is_merged_init else lang.t("<code>__init__</code> TYPE PARAMETER") }}</span></th>
131+
<th><span class="doc-section-title">{{ (section.title or lang.t("TYPE PARAMETER")).rstrip(":").upper() }}</span></th>
134132
<th><span>{{ lang.t("DESCRIPTION") }}</span></th>
135133
</tr>
136134
</thead>
@@ -142,7 +140,7 @@ Context:
142140
{% filter heading(
143141
heading_level + 1,
144142
role="typeparam",
145-
id=obj.path ~ ":" ~ type_parameter.name ,
143+
id=obj.path ~ "[" ~ type_parameter.name ~ "]"
146144
class="doc doc-heading doc-heading-type_parameter",
147145
toc_label=('<code class="doc-symbol doc-symbol-toc doc-symbol-type_parameter"></code>&nbsp;'|safe if config.show_symbol_type_toc else '') + type_parameter.name,
148146
) %}

src/mkdocstrings_handlers/python/templates/material/_base/languages/en.html.jinja

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@
4444
"Type Aliases:": "Type Aliases:",
4545
"TYPE ALIAS": "TYPE ALIAS",
4646
"Type Parameters:": "Type Parameters:",
47-
"<code>__init__</code> Type Parameters:": "<code>__init__</code> Type Parameters:"|safe,
4847
"TYPE PARAMETER": "TYPE PARAMETER",
49-
"<code>__init__</code> TYPE PARAMETER": "<code>__init__</code> TYPE PARAMETER"|safe,
5048
"WARNS": "WARNS",
5149
"Warns:": "Warns:",
5250
"YIELDS": "YIELDS",
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1+
{# YORE: Bump 2: Remove file. #}
12
{% extends "_base/summary/type_aliases.html.jinja" %}
23

34
{% block logs scoped %}
45
{{ super() }}
5-
{# TODO: Switch to a warning after some time. #}
6-
{{ log.info(
7-
"DeprecationWarning: Extending '_base/type_aliases/classes.html' is deprecated, extend '_base/type_aliases/classes.html.jinja' instead. " ~
8-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/type_aliases/classes.html' is deprecated, extend '_base/type_aliases/classes.html.jinja' instead.",
98
once=True,
109
) }}
1110
{% endblock logs %}
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1+
{# YORE: Bump 2: Remove file. #}
12
{% extends "_base/type_alias.html.jinja" %}
23

34
{% block logs scoped %}
45
{{ super() }}
5-
{# TODO: Switch to a warning after some time. #}
6-
{{ log.info(
7-
"DeprecationWarning: Extending '_base/type_alias.html' is deprecated, extend '_base/type_alias.html.jinja' instead. " ~
8-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/type_alias.html' is deprecated, extend '_base/type_alias.html.jinja' instead. ",
98
once=True,
109
) }}
1110
{% endblock logs %}
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1+
{# YORE: Bump 2: Remove file. #}
12
{% extends "_base/type_parameters.html.jinja" %}
23

34
{% block logs scoped %}
45
{{ super() }}
5-
{# TODO: Switch to a warning after some time. #}
6-
{{ log.info(
7-
"DeprecationWarning: Extending '_base/type_parameters.html' is deprecated, extend '_base/type_parameters.html.jinja' instead. " ~
8-
"After some time, this message will be logged as a warning, causing strict builds to fail.",
6+
{{ log.warning(
7+
"DeprecationWarning: Extending '_base/type_parameters.html' is deprecated, extend '_base/type_parameters.html.jinja' instead.",
98
once=True,
109
) }}
1110
{% endblock logs %}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Context:
6363
{{ type_param_prefix }}
6464
{%- if config.separate_signature and config.type_parameter_headings and config.signature_crossrefs -%}
6565
{%- filter stash_crossref(length=type_parameter.name|length) -%}
66-
<autoref identifier="{{ obj.path }}:{{ type_param_prefix }}{{ type_parameter.name }}" optional>{{ type_parameter.name }}</autoref>
66+
<autoref identifier="{{ obj.path }}[{{ type_param_prefix }}{{ type_parameter.name }}]" optional>{{ type_parameter.name }}</autoref>
6767
{%- endfilter -%}
6868
{%- else -%}
6969
{{ type_parameter.name }}

0 commit comments

Comments
 (0)