Skip to content

Commit ed71e5c

Browse files
committed
fixup
1 parent b4b0825 commit ed71e5c

File tree

4 files changed

+31
-7
lines changed

4 files changed

+31
-7
lines changed

src/mkdocstrings_handlers/python/_internal/rendering.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
from dataclasses import replace
56
import random
67
import re
78
import string
@@ -162,16 +163,16 @@ def do_format_signature(
162163
The same code, formatted.
163164
"""
164165
env = context.environment
165-
# TODO: Stop using `do_get_template` when `*.html` templates are removed.
166+
# YORE: Bump 2: Replace `do_get_template(env, "type_parameters")` with `"type_parameters.html.jinja"` within line.
166167
type_params_template = env.get_template(do_get_template(env, "type_parameters"))
168+
# YORE: Bump 2: Replace `do_get_template(env, "signature")` with `"signature.html.jinja"` within line.
167169
signature_template = env.get_template(do_get_template(env, "signature"))
168170

169171
if annotations is None:
170172
new_context = context.parent
171173
else:
172174
new_context = dict(context.parent)
173-
new_context["config"] = dict(new_context["config"])
174-
new_context["config"]["show_signature_annotations"] = annotations
175+
new_context["config"] = replace(new_context["config"], show_signature_annotations=annotations)
175176

176177
signature = type_params_template.render(context.parent, obj=function, signature=True)
177178
signature += signature_template.render(new_context, function=function, signature=True)
@@ -287,8 +288,9 @@ def do_format_type_alias(
287288
The same code, formatted.
288289
"""
289290
env = context.environment
290-
# TODO: Stop using `do_get_template` when `*.html` templates are removed.
291+
# YORE: Bump 2: Replace `do_get_template(env, "type_parameters")` with `"type_parameters.html.jinja"` within line.
291292
type_params_template = env.get_template(do_get_template(env, "type_parameters"))
293+
# YORE: Bump 2: Replace `do_get_template(env, "expression")` with `"expression.html.jinja"` within line.
292294
expr_template = env.get_template(do_get_template(env, "expression"))
293295

294296
signature = str(type_alias_path).strip()

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@
1010
{% macro t(key) %}{{ {
1111
"ATTRIBUTE": "属性",
1212
"Attributes:": "属性:",
13+
"BOUND:": "BOUND:",
14+
"Bound or Constraints": "Bound or Constraints",
1315
"Classes:": "クラス:",
14-
"CLASS": "クラス",
16+
"Class Type Parameters:": "Class Type Parameters:",
17+
"CLASS TYPE PARAMETER": "CLASS TYPE PARAMETER",
18+
"CLASS": "CLASS",
19+
"CONSTRAINTS:": "CONSTRAINTS:",
1520
"DEFAULT:": "デフォルト:",
1621
"Default": "デフォルト",
1722
"default:": "デフォルト:",
@@ -20,6 +25,8 @@
2025
"Examples:": "例:",
2126
"Functions:": "関数:",
2227
"FUNCTION": "関数",
28+
"Init Type Parameters:": "Init Type Parameters:",
29+
"INIT TYPE PARAMETER": "INIT TYPE PARAMETER",
2330
"Methods:": "メソッド:",
2431
"METHOD": "メソッド",
2532
"Modules:": "モジュール:",
@@ -38,6 +45,10 @@
3845
"Source code in": "ソースコード位置:",
3946
"TYPE:": "タイプ:",
4047
"Type": "タイプ",
48+
"Type Aliases:": "Type Aliases:",
49+
"TYPE ALIAS": "TYPE ALIAS",
50+
"Type Parameters:": "Type Parameters:",
51+
"TYPE PARAMETER": "TYPE PARAMETER",
4152
"WARNS": "警告",
4253
"Warns:": "警告:",
4354
"YIELDS": "返す",

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@
1010
{% macro t(key) %}{{ {
1111
"ATTRIBUTE": "属性",
1212
"Attributes:": "属性:",
13+
"BOUND:": "BOUND:",
14+
"Bound or Constraints": "Bound or Constraints",
1315
"Classes:": "类:",
14-
"CLASS": "类",
16+
"Class Type Parameters:": "Class Type Parameters:",
17+
"CLASS TYPE PARAMETER": "CLASS TYPE PARAMETER",
18+
"CLASS": "CLASS",
19+
"CONSTRAINTS:": "CONSTRAINTS:",
1520
"DEFAULT:": "默认:",
1621
"Default": "默认",
1722
"default:": "默认:",
@@ -20,6 +25,8 @@
2025
"Examples:": "示例:",
2126
"Functions:": "函数:",
2227
"FUNCTION": "函数",
28+
"Init Type Parameters:": "Init Type Parameters:",
29+
"INIT TYPE PARAMETER": "INIT TYPE PARAMETER",
2330
"Methods:": "方法:",
2431
"METHOD": "方法",
2532
"Modules:": "模块:",
@@ -38,6 +45,10 @@
3845
"Source code in": "源代码位于:",
3946
"TYPE:": "类型:",
4047
"Type": "类型",
48+
"Type Aliases:": "Type Aliases:",
49+
"TYPE ALIAS": "TYPE ALIAS",
50+
"Type Parameters:": "Type Parameters:",
51+
"TYPE PARAMETER": "TYPE PARAMETER",
4152
"Warns:": "警告:",
4253
"WARNS": "警告",
4354
"YIELDS": "产生",

src/mkdocstrings_handlers/python/templates/material/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ a code.doc-symbol-type_alias {
193193
}
194194

195195
code.doc-symbol-type_alias::after {
196-
content: "alias";
196+
content: "type";
197197
}
198198

199199
code.doc-symbol-module,

0 commit comments

Comments
 (0)