From f3e487b6d3aba09beeceaf185b0a3bd60b6aa41f Mon Sep 17 00:00:00 2001 From: Qz Date: Wed, 29 May 2024 17:11:41 +0700 Subject: [PATCH 1/2] Fix the syntax highlighting color in the ref doc --- site/api/components/Class/Constructors.tsx | 4 +++- site/api/components/Class/Method.tsx | 16 +++++++++++++--- site/api/components/CodeBlock.tsx | 10 +++++----- site/api/components/PropertyName.tsx | 4 ++-- site/api/components/styles.tsx | 18 +++++++++++++----- 5 files changed, 36 insertions(+), 16 deletions(-) diff --git a/site/api/components/Class/Constructors.tsx b/site/api/components/Class/Constructors.tsx index 4aec91a20..d74a2935c 100644 --- a/site/api/components/Class/Constructors.tsx +++ b/site/api/components/Class/Constructors.tsx @@ -24,7 +24,9 @@ export function Constructors({ {v.accessibility ? {v.accessibility}{" "} : undefined} - {v.name}( + + {v.name} + ( {v.params}); {"jsDoc" in v &&

{v.jsDoc?.doc}

} diff --git a/site/api/components/Class/Method.tsx b/site/api/components/Class/Method.tsx index 29281a7e3..963614ecc 100644 --- a/site/api/components/Class/Method.tsx +++ b/site/api/components/Class/Method.tsx @@ -73,13 +73,23 @@ export function Def( return ( <> {method.kind == "setter" - ? set{" "} + ? ( + + set{" "} + + ) : method.kind == "getter" - ? get{" "} + ? ( + + get{" "} + + ) : ( "" )} - {method.name} + + {method.name} + {typeParams} ( diff --git a/site/api/components/CodeBlock.tsx b/site/api/components/CodeBlock.tsx index c245920d8..df8de048b 100644 --- a/site/api/components/CodeBlock.tsx +++ b/site/api/components/CodeBlock.tsx @@ -4,12 +4,12 @@ export function CodeBlock({ children }: { children?: ComponentChildren }) { return ( <> {"\n\n"} -
- {"\n\n"} -
-            {children}
+      
+ + ts +
+          {children}
         
- {"\n\n"}
{"\n\n"} diff --git a/site/api/components/PropertyName.tsx b/site/api/components/PropertyName.tsx index 086cf18ed..da759d7c6 100644 --- a/site/api/components/PropertyName.tsx +++ b/site/api/components/PropertyName.tsx @@ -9,11 +9,11 @@ export function PropertyName({ }) { return ( <> - + {name} {(optional || hasType) && ( - + {optional && <>?} {hasType && <>:} diff --git a/site/api/components/styles.tsx b/site/api/components/styles.tsx index 3b66206e8..49c955875 100644 --- a/site/api/components/styles.tsx +++ b/site/api/components/styles.tsx @@ -1,25 +1,33 @@ import { ComponentChildren } from "preact"; export function StyleKw({ children }: { children?: ComponentChildren }) { - return {children}; + return ( + {children} + ); } export function StyleStrLit({ children }: { children?: ComponentChildren }) { - return {children}; + return ( + {children} + ); } export function StyleTypeRef({ children }: { children?: ComponentChildren }) { return ( - + {children} ); } export function StyleCallee({ children }: { children?: ComponentChildren }) { - return {children}; + return ( + {children} + ); } export function StyleNum({ children }: { children?: ComponentChildren }) { - return {children}; + return ( + {children} + ); } From ac64a553d74930b9418496fbb76b2f98d4b2ad94 Mon Sep 17 00:00:00 2001 From: Qz Date: Wed, 29 May 2024 18:29:29 +0700 Subject: [PATCH 2/2] Fix build --- site/api/components/CodeBlock.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/site/api/components/CodeBlock.tsx b/site/api/components/CodeBlock.tsx index df8de048b..14a8b6cc9 100644 --- a/site/api/components/CodeBlock.tsx +++ b/site/api/components/CodeBlock.tsx @@ -7,6 +7,7 @@ export function CodeBlock({ children }: { children?: ComponentChildren }) {
ts + {"\n\n"}
           {children}