From 4ff017a87ab129e8576288e8c9729609f8310d04 Mon Sep 17 00:00:00 2001 From: SHIBAHARA Hiroki Date: Mon, 23 Sep 2024 04:34:08 +0900 Subject: [PATCH 1/2] fix: show param type and return in reference --- src/content/ui/en.yaml | 1 + src/layouts/ReferenceItemLayout.astro | 27 +++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/content/ui/en.yaml b/src/content/ui/en.yaml index 6c9d73af58..591e42ec27 100644 --- a/src/content/ui/en.yaml +++ b/src/content/ui/en.yaml @@ -36,6 +36,7 @@ Syntax: Syntax Methods: Methods Fields: Fields Parameters: Parameters +Return: Return Related References: Related References Related Examples: Related Examples Show Code: Show Code diff --git a/src/layouts/ReferenceItemLayout.astro b/src/layouts/ReferenceItemLayout.astro index a9969965b3..f0231d69a5 100644 --- a/src/layouts/ReferenceItemLayout.astro +++ b/src/layouts/ReferenceItemLayout.astro @@ -141,10 +141,12 @@ const seenParams: Record = {}; entry.data.params.map((param: ReferenceParam) => (
{param.name} - +
+ {param.type && {param.type}: } + +
))} {entry.data.overloads && @@ -169,6 +171,23 @@ const seenParams: Record = {}; ) } + { + (entry.data.return) && ( + <> +
+

{t("Return")}

+
+
+ {entry.data.return.type && {entry.data.return.type}: } + +
+
+
+ + ) + } { entry.data.properties && (
From f69a6ec5a4cb1bf583b773dc54a0a1773c385ca1 Mon Sep 17 00:00:00 2001 From: SHIBAHARA Hiroki Date: Mon, 23 Sep 2024 22:30:45 +0900 Subject: [PATCH 2/2] Update Label "Return" to "Returns" --- src/content/ui/en.yaml | 2 +- src/layouts/ReferenceItemLayout.astro | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/ui/en.yaml b/src/content/ui/en.yaml index 591e42ec27..ad062ff136 100644 --- a/src/content/ui/en.yaml +++ b/src/content/ui/en.yaml @@ -36,7 +36,7 @@ Syntax: Syntax Methods: Methods Fields: Fields Parameters: Parameters -Return: Return +Returns: Returns Related References: Related References Related Examples: Related Examples Show Code: Show Code diff --git a/src/layouts/ReferenceItemLayout.astro b/src/layouts/ReferenceItemLayout.astro index f0231d69a5..aa1d2dfca1 100644 --- a/src/layouts/ReferenceItemLayout.astro +++ b/src/layouts/ReferenceItemLayout.astro @@ -175,7 +175,7 @@ const seenParams: Record = {}; (entry.data.return) && ( <>
-

{t("Return")}

+

{t("Returns")}