From 5bbdaa1918cfc4c230d10e3a78d646808ff96619 Mon Sep 17 00:00:00 2001 From: 3w36zj6 <52315048+3w36zj6@users.noreply.github.com> Date: Fri, 5 Sep 2025 19:05:00 +0900 Subject: [PATCH 1/4] chore(deps): update @biomejs/biome to 2.0.6 --- website/bun.lockb | Bin 75649 -> 75649 bytes website/package.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/website/bun.lockb b/website/bun.lockb index ccd850768f2b3950b81bdb34b731f7dc6a0f84b0..15759e43fe36eb8a0d4ae04a0d74d5d0f31c5916 100755 GIT binary patch delta 1236 zcmZoX&(e6FWrCi9Nq0|n*iAc!%>hAH*XL#IkG=o+&F)~Xq>oiUR+n$$JiXD6$%>I_ z@X3N) zlM{GZHn-UP^m23+{`d8G;Y3+OMRG}Be|6qcYUVXV*~`qu8It0R3=BZT zA;7@EuoH-3fMv$QBY)plJ`$;K)jUuzW%0y+hEmI7{?9$tUhf{7>(cNpNlce>*Ojx9 zm$zK%aaMR8w|G}bZmqIsw^Q$F={xt`EY?oW?U1NvHcv9SarWFnE8SnyPDtO;&(Di$ z(o6MJFMGe?Q0TSmgsS~X zfX>V#G(G1gy21QFSuMl-2`>)LZ&P4M=f7P z7uj_OW<0iUw9a`arj{`wW9OUFVyWkGbMr3jdfvOLQqo9`muJP%^A~@=k$l9SBPUk9 z{OUCy&Nd}8caf!cHyPw>Byp-vJ_~eR?q^fh<6FwtJ1pLn>}M+UgLP86@4lywcRQH> zJhiB)zBBc?%!e1Vj>m5LnV1XUpaz#q54$*EK#iHFCTh z9<=a=wtc*n?ibl6 zp`4rlAKES9aAuqw$SXGa01wOL1ru2|&*?g6!)l~wpl7x@|9GtwggN=+Ls3hxAkgNG z4h#(9z}&$9dHOVYyYmZJ7-2FefHD$58GGH899g&I-a}<3+dmQwhN<}hR3iygvv-Y$ zy-c{pe1vX6M+OFIpvHu-z_Jzuf z5{yvCGX7JTp0CEpGyT3QBir;3DvWaI685T$3aDa2)2FF2N}!5?4ZxIt@-u3TBAj5a>y@NeO};pB1^|Hmy|DlQ delta 1260 zcmZoX&(e6FWrCi<+b5sIPX-*WWz2rL^Z3q>#&fqW?>01HJ!xk1D?>9-;=x8gCM#A( z1_lPs$rsJFCm-P9;PrH5V2EU3Xh0IR5SYHj_;eYiSugjhwhD*0t0#`0#n!K-Fyng?>om}_B zI3?|2tcTDRh^roWDVomAKWa^mY7;_s3{F zI8|SNfGLq_1u#&6h(iDvVmpBt23Q(AlKz=Aw$5Gln&ay8T8Y!==bJ6uW5coBxJvYm zPT%k4<{TcSFFZC&&d$w~jW!AqWPB;a^I_tN=?mBrw0}7-vGtpr+aXb(6Odz@b#|Y- z*P076D!A&7^|n_YZnNRp8?9W#{^QiV^102H7152izfLwzxOV^JWhSXqSp&5^fLO?3$)#_%csBWp-#Yxs zRQA&Ma#^=^(h*Vs2ID@fLxf4O5>dty)HNr&4EtGbFTLU>qsb0A{f+xumavEj zZ4a*a2Ms$Gpo{h*yKWvEWBdQvg3q%is;{?=@V0M}5Bab%{~aUi+m&yt&2L^v*u3lE zw=y$HhBguX1qu4Ro}r~RQc+$r_dhh#?l}7Se%j=-K-YcjD=-rEuw6Rum5rJFqoqQ5 z2KL{73+Dd0?&dwiGF!lBr`Cs@{EJM2zxPi#+Wh#OQtua=UqwonIC`4iCtP*V+kq6b z`;lEYRiJbK*QC3V1v9r-X}=P^k%jP*<=WJLF^(^&FHs>F&m4YxQ ze|#uv2^Iv}ywQPyK^&MH_&-mdCU19s0ShBc<^)hi0w`mzyOJa8mfU-&%w+pVqQNjV zKY(f^fok@y@vxT(x0sL6E$GO=APtn+H7ixZeM;70gp3YQMiwX&+V9Y`&g+pfRA%$? zM_(Nv4&1&_nNfm~8EDDmjV~3a=czIBPQS0p$Tt0h3ZopVu)Qjy0 Date: Fri, 5 Sep 2025 19:07:09 +0900 Subject: [PATCH 2/4] chore: migrate Biome configuration --- website/biome.json | 30 ------------------------------ website/biome.jsonc | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 30 deletions(-) delete mode 100644 website/biome.json create mode 100644 website/biome.jsonc diff --git a/website/biome.json b/website/biome.json deleted file mode 100644 index 208387f061..0000000000 --- a/website/biome.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", - "vcs": { - "enabled": true, - "clientKind": "git", - "useIgnoreFile": true - }, - "files": { - "ignoreUnknown": false, - "ignore": [] - }, - "formatter": { - "enabled": true, - "indentStyle": "tab" - }, - "organizeImports": { - "enabled": true - }, - "linter": { - "enabled": true, - "rules": { - "recommended": true - } - }, - "javascript": { - "formatter": { - "quoteStyle": "double" - } - } -} diff --git a/website/biome.jsonc b/website/biome.jsonc new file mode 100644 index 0000000000..b2245dd590 --- /dev/null +++ b/website/biome.jsonc @@ -0,0 +1,40 @@ +{ + "$schema": "https://biomejs.dev/schemas/2.0.6/schema.json", + "vcs": { + "enabled": true, + "clientKind": "git", + "useIgnoreFile": true + }, + "files": { + "ignoreUnknown": false, + "includes": ["**"] + }, + "formatter": { + "enabled": true, + "indentStyle": "tab" + }, + "assist": { "actions": { "source": { "organizeImports": "on" } } }, + "linter": { + "enabled": true, + "rules": { + "recommended": true, + "style": { + "noParameterAssign": "error", + "useAsConstAssertion": "error", + "useDefaultParameterLast": "error", + "useEnumInitializers": "error", + "useSelfClosingElements": "error", + "useSingleVarDeclarator": "error", + "noUnusedTemplateLiteral": "error", + "useNumberNamespace": "error", + "noInferrableTypes": "error", + "noUselessElse": "error" + } + } + }, + "javascript": { + "formatter": { + "quoteStyle": "double" + } + } +} From d553d1678bfcc093a0b1fd40f4137075a2c22e62 Mon Sep 17 00:00:00 2001 From: 3w36zj6 <52315048+3w36zj6@users.noreply.github.com> Date: Fri, 5 Sep 2025 19:18:27 +0900 Subject: [PATCH 3/4] refactor: apply Biome auto fixes --- website/src/components/icons/index.ts | 20 +++++++++---------- website/src/components/templates/index.ts | 4 ++-- .../src/components/ui/FunctionDefinition.tsx | 2 +- website/src/components/ui/common/index.ts | 10 +++++----- website/src/globals.css | 5 +++-- website/src/index.tsx | 4 ++-- website/src/translation/index.tsx | 2 +- website/vite.config.ts | 3 +-- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/website/src/components/icons/index.ts b/website/src/components/icons/index.ts index 0c685a4edd..45ed58a0a7 100644 --- a/website/src/components/icons/index.ts +++ b/website/src/components/icons/index.ts @@ -1,19 +1,19 @@ // Tabler Icons // https://tabler.io/icons -export { HomeIcon } from "./HomeIcon"; + +export { AlertTriangleIcon } from "./AlertTriangleIcon"; export { CaretRightCircleIcon } from "./CaretRightCircleIcon"; -export { InfoCircleIcon } from "./InfoCircleIcon"; -export { HelpCircleIcon } from "./HelpCircleIcon"; export { ChevronLeftIcon } from "./ChevronLeftIcon"; export { ChevronRightIcon } from "./ChevronRightIcon"; -export { AlertTriangleIcon } from "./AlertTriangleIcon"; -export { MenuIcon } from "./MenuIcon"; export { CloseIcon } from "./CloseIcon"; -export { SearchIcon } from "./SearchIcon"; -export { LanguageIcon } from "./LanguageIcon"; -export { WorldIcon } from "./WorldIcon"; - +export { DiscordIcon } from "./DiscordIcon"; // Simple Icons // https://simpleicons.org/ export { GitHubIcon } from "./GitHubIcon"; -export { DiscordIcon } from "./DiscordIcon"; +export { HelpCircleIcon } from "./HelpCircleIcon"; +export { HomeIcon } from "./HomeIcon"; +export { InfoCircleIcon } from "./InfoCircleIcon"; +export { LanguageIcon } from "./LanguageIcon"; +export { MenuIcon } from "./MenuIcon"; +export { SearchIcon } from "./SearchIcon"; +export { WorldIcon } from "./WorldIcon"; diff --git a/website/src/components/templates/index.ts b/website/src/components/templates/index.ts index 8218063605..14e3629269 100644 --- a/website/src/components/templates/index.ts +++ b/website/src/components/templates/index.ts @@ -1,7 +1,7 @@ export { BaseTemplate } from "./BaseTemplate"; -export { HtmlTemplate } from "./HtmlTemplate"; export { CategoryTemplate } from "./CategoryTemplate"; export { FuncTemplate } from "./FuncTemplate"; export { GroupTemplate } from "./GroupTemplate"; -export { TypeTemplate } from "./TypeTemplate"; +export { HtmlTemplate } from "./HtmlTemplate"; export { SymbolsTemplate } from "./SymbolsTemplate"; +export { TypeTemplate } from "./TypeTemplate"; diff --git a/website/src/components/ui/FunctionDefinition.tsx b/website/src/components/ui/FunctionDefinition.tsx index 7a2498924f..dafacd41aa 100644 --- a/website/src/components/ui/FunctionDefinition.tsx +++ b/website/src/components/ui/FunctionDefinition.tsx @@ -2,8 +2,8 @@ import type { FC } from "hono/jsx"; import { basePath } from "../../metadata"; import type { Func } from "../../types/model"; import { joinPath } from "../../utils/path"; -import { TypeIcon } from "./TypeIcon"; import { genPath } from "./genPath"; +import { TypeIcon } from "./TypeIcon"; import { buildParamId, type2href } from "./type2href"; type FunctionDefinitionProps = { diff --git a/website/src/components/ui/common/index.ts b/website/src/components/ui/common/index.ts index 8c5250386d..114638e8c8 100644 --- a/website/src/components/ui/common/index.ts +++ b/website/src/components/ui/common/index.ts @@ -1,9 +1,9 @@ -export { SiteNoticeBanner } from "./SiteNoticeBanner"; -export { Header } from "./Header"; -export { SiteTitle } from "./SiteTitle"; -export { SideNavigation, type SideNavigationProps } from "./SideNavigation"; export { Breadcrumbs, type BreadcrumbsProps } from "./Breadcrumbs"; -export { TableOfContents, type TableOfContentsProps } from "./TableOfContents"; export { Footer } from "./Footer"; +export { Header } from "./Header"; export { SearchWindow } from "./SearchWindow"; +export { SideNavigation, type SideNavigationProps } from "./SideNavigation"; +export { SiteNoticeBanner } from "./SiteNoticeBanner"; +export { SiteTitle } from "./SiteTitle"; +export { TableOfContents, type TableOfContentsProps } from "./TableOfContents"; export { TranslationStatusAlert } from "./TranslationStatusAlert"; diff --git a/website/src/globals.css b/website/src/globals.css index 742c9ee185..51382e61a1 100644 --- a/website/src/globals.css +++ b/website/src/globals.css @@ -46,8 +46,9 @@ code, pre, kbd, samp { - font-family: "Cascadia Mono", SFMono-Regular, Menlo, Monaco, Consolas, - "Liberation Mono", "Courier New", monospace; + font-family: + "Cascadia Mono", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", + "Courier New", monospace; } /* Information box */ diff --git a/website/src/index.tsx b/website/src/index.tsx index 3901f8cc93..b61d7aff80 100644 --- a/website/src/index.tsx +++ b/website/src/index.tsx @@ -1,6 +1,8 @@ import { serveStatic } from "@hono/node-server/serve-static"; import { Hono } from "hono"; import { appendTrailingSlash, trimTrailingSlash } from "hono/trailing-slash"; +// Documentation generated by typst-docs. +import docsJson from "../../docs.json"; import { CategoryTemplate, FuncTemplate, @@ -16,8 +18,6 @@ import { isPageOfKind } from "./utils/isPageOfKind"; import { removeBasePath } from "./utils/path"; import { registerRoutes } from "./utils/translationStatus"; -// Documentation generated by typst-docs. -import docsJson from "../../docs.json"; const docs = docsJson as unknown as Page[]; const [flattenedPages, pagePaths] = flattenDocs(docs); diff --git a/website/src/translation/index.tsx b/website/src/translation/index.tsx index a724f67c88..375fe759f6 100644 --- a/website/src/translation/index.tsx +++ b/website/src/translation/index.tsx @@ -83,4 +83,4 @@ export type TranslationComponent = FC; /** * Switch translation language here. */ -export { translation, Translation } from "./ja-JP"; +export { Translation, translation } from "./ja-JP"; diff --git a/website/vite.config.ts b/website/vite.config.ts index ec3ba25bbc..1dd932bd2a 100644 --- a/website/vite.config.ts +++ b/website/vite.config.ts @@ -2,8 +2,7 @@ import { rmSync, symlinkSync } from "node:fs"; import { resolve } from "node:path"; import { robotsTxtPlugin } from "@hono/ssg-plugins-essential/robots-txt"; import { sitemapPlugin } from "@hono/ssg-plugins-essential/sitemap"; -import { defaultOptions } from "@hono/vite-dev-server"; -import devServer from "@hono/vite-dev-server"; +import devServer, { defaultOptions } from "@hono/vite-dev-server"; import ssg from "@hono/vite-ssg"; import tailwindcss from "@tailwindcss/vite"; import { defineConfig } from "vite"; From 0a4d4951d4a9bff596c2e6a44b91ae3cd82db8af Mon Sep 17 00:00:00 2001 From: 3w36zj6 <52315048+3w36zj6@users.noreply.github.com> Date: Fri, 5 Sep 2025 19:33:57 +0900 Subject: [PATCH 4/4] refactor: apply Biome suggestions --- .../src/components/templates/FuncTemplate.tsx | 6 +- .../components/templates/GroupTemplate.tsx | 2 +- .../src/components/templates/TypeTemplate.tsx | 2 +- .../src/components/ui/FunctionParameters.tsx | 2 +- .../components/ui/common/SideNavigation.tsx | 6 +- website/src/index.tsx | 2 +- website/src/translation/en-US.tsx | 129 ++++++++++-------- website/src/translation/ja-JP.tsx | 125 +++++++++-------- website/src/utils/flattenDocs.test.ts | 2 +- 9 files changed, 149 insertions(+), 127 deletions(-) diff --git a/website/src/components/templates/FuncTemplate.tsx b/website/src/components/templates/FuncTemplate.tsx index e2aae8cb5c..d7d303b92c 100644 --- a/website/src/components/templates/FuncTemplate.tsx +++ b/website/src/components/templates/FuncTemplate.tsx @@ -102,16 +102,14 @@ function ScopedDefinitions({ {parent ? ( // Currently, the scope has at most two levels. // Therefore, it is sufficient to only annotate the direct `parent`. - <> - - + ) : ( )} - {scope.map((method, index) => { + {scope.map((method, _index) => { const methodId = `${parentId}definitions-${method.name}`; return ( diff --git a/website/src/components/templates/GroupTemplate.tsx b/website/src/components/templates/GroupTemplate.tsx index 017239d76d..5533a942c4 100644 --- a/website/src/components/templates/GroupTemplate.tsx +++ b/website/src/components/templates/GroupTemplate.tsx @@ -34,7 +34,7 @@ export const GroupTemplate: FC = ({ <>

Function

- {content.functions.map((method, index) => ( + {content.functions.map((method, _index) => (

{method.name} diff --git a/website/src/components/templates/TypeTemplate.tsx b/website/src/components/templates/TypeTemplate.tsx index 95c834f6e8..39eeb280e1 100644 --- a/website/src/components/templates/TypeTemplate.tsx +++ b/website/src/components/templates/TypeTemplate.tsx @@ -57,7 +57,7 @@ export const TypeTemplate: FC = ({

- {content.scope.map((method, index) => ( + {content.scope.map((method, _index) => (

= ({ }) => { return (
- {func.params.map((param, index) => ( + {func.params.map((param, _index) => (
    - {docs?.map((firstLevel, idx) => ( + {docs?.map((firstLevel, _idx) => ( <> {firstLevel.part && (
  • - {firstLevel.children.map((secondLevel, idx2) => ( + {firstLevel.children.map((secondLevel, _idx2) => (
    {secondLevel.part && (
  • @@ -112,7 +112,7 @@ export const SideNavigation = ({ x-transition:enter-end="opacity-100 transform translate-y-0" > {secondLevel.children.map( - (thirdLevel, idx3) => ( + (thirdLevel, _idx3) => (
    {thirdLevel.part && (
  • diff --git a/website/src/index.tsx b/website/src/index.tsx index b61d7aff80..791e147c21 100644 --- a/website/src/index.tsx +++ b/website/src/index.tsx @@ -89,7 +89,7 @@ if (import.meta.env.DEV) { rewriteRequestPath: (path) => { return path.slice(basePath.length); }, - onNotFound: (path, c) => { + onNotFound: (path, _c) => { console.log( `${path} is not found while trying to serve a static asset`, ); diff --git a/website/src/translation/en-US.tsx b/website/src/translation/en-US.tsx index 65fe5b7164..e0f46b4d29 100644 --- a/website/src/translation/en-US.tsx +++ b/website/src/translation/en-US.tsx @@ -1,3 +1,4 @@ +import { Fragment } from "hono/jsx/jsx-runtime"; import type { TooltipProps } from "../components/ui/Tooltip"; import { githubOrganizationUrl } from "../metadata"; import type { TranslationComponent, TranslationObject } from "./"; @@ -39,148 +40,158 @@ export const translation: TranslationObject = { export const Translation: TranslationComponent = (props) => { switch (props.translationKey) { case "definition": - return <>Definition; + return Definition; case "constructor": - return <>Constructor; + return Constructor; case "definitionOf": return ( - <> + {props.name} Definition - + ); case "search": - return <>Search; + return Search; case "defaultValue": - return <>Default value:; + return Default value:; case "stringValues": - return <>Available string values:; + return Available string values:; case "showExample": - return <>Show example; + return Show example; case "tableOfContents": - return <>On this page; + return On this page; case "nextPage": - return <>Next page; + return Next page; case "previousPage": - return <>Previous page; + return Previous page; case "referenceDescription": return ( - <> + Detailed reference for all Typst syntax, concepts, types, and functions. - + ); case "tutorialDescription": - return <>Learn how to use Typst step by step.; + return Learn how to use Typst step by step.; case "tutorial": - return <>Tutorial; + return Tutorial; case "openOfficialDocs": - return <>Open official docs; + return Open official docs; case "reference": - return <>Reference; + return Reference; case "typstOfficialDocs": - return <>Typst official docs; + return Typst official docs; case "typstOfficialWebsite": - return <>Typst official website; + return Typst official website; case "untranslated": - return <>Untranslated; + return Untranslated; case "untranslatedMessage": return ( - <> + This page has not been translated yet. The original content is shown. - + ); case "communityContent": - return <>Community original content; + return Community original content; case "contentAddedByCommunity": return ( - <> + This page contains content that is not part of the official documentation, added independently by the community. - + ); case "partiallyTranslated": - return <>Partially translated; + return Partially translated; case "partiallyTranslatedMessage": return ( - <> + This page is partially translated. Some original content is included. - + ); case "translated": - return <>Translated; + return Translated; case "translatedMessage": - return <>This page has been translated into English.; + return This page has been translated into English.; case "elementFunction": - return <>Element; + return Element; case "elementFunctionDescription": return ( - <> + Element functions can be customized with set and{" "} show rules. - + ); case "contextFunction": - return <>Context; + return Context; case "contextFunctionDescription": - return <>Context functions can only be used when the context is known.; + return ( + + Context functions can only be used when the context is known. + + ); case "definitionTooltip": - return <>Definition; + return Definition; case "definitionTooltipDescription": return ( - <> + These functions and types can have related definitions. To access a definition, specify the name of the function or type, followed by the definition name separated by a period. - + ); case "argument": - return <>Parameter; + return Parameter; case "argumentDescription": return ( - <> + Parameters are input values for functions. Specify them in parentheses after the function name. - + ); case "variadic": - return <>Variadic; + return Variadic; case "variadicDescription": - return <>Variadic parameters can be specified multiple times.; + return ( + + Variadic parameters can be specified multiple times. + + ); case "positional": - return <>Positional; + return Positional; case "positionalDescription": return ( - <> + Positional parameters can be set by specifying them in order, omitting the parameter name. - + ); case "required": - return <>Required; + return Required; case "requiredDescription": return ( - <>Required parameters must be specified when calling the function. + + Required parameters must be specified when calling the function. + ); case "document": - return <>Document; + return Document; case "langVersion": - return <>English; + return English; case "translationRate": - return <>Translated; + return Translated; case "settable": - return <>Settable; + return Settable; case "settableDescription": return ( - <> + Settable parameters can be set using the set rule, changing the default value used thereafter. - + ); case "siteNoticeBannerTitle": - return <>Info; + return Info; case "siteNoticeBannerDescription": return ( - <> + This site is generated using the static site generator developed by the Typst Community. Please adjust the text content of this banner according to your usage @@ -191,13 +202,13 @@ export const Translation: TranslationComponent = (props) => { Issue #874 on typst/typst . - + ); case "footer": return ( - <> + Translated by Typst Community - + ); default: return null; diff --git a/website/src/translation/ja-JP.tsx b/website/src/translation/ja-JP.tsx index ef201c7594..4340e6e33d 100644 --- a/website/src/translation/ja-JP.tsx +++ b/website/src/translation/ja-JP.tsx @@ -1,3 +1,4 @@ +import { Fragment } from "hono/jsx/jsx-runtime"; import type { TooltipProps } from "../components/ui/Tooltip"; import { discordServerUrl, @@ -44,137 +45,149 @@ export const translation: TranslationObject = { export const Translation: TranslationComponent = (props) => { switch (props.translationKey) { case "definition": - return <>定義; + return 定義; case "constructor": - return <>コンストラクタ; + return コンストラクタ; case "definitionOf": return ( - <> + {props.name}の定義 - + ); case "search": - return <>検索; + return 検索; case "defaultValue": - return <>デフォルト値:; + return デフォルト値:; case "stringValues": - return <>使用可能な文字列値:; + return 使用可能な文字列値:; case "showExample": - return <>例を表示; + return 例を表示; case "tableOfContents": - return <>目次; + return 目次; case "nextPage": - return <>次のページ; + return 次のページ; case "previousPage": - return <>前のページ; + return 前のページ; case "referenceDescription": return ( - <> + Typstのあらゆる構文、概念、型、関数についての詳細なリファレンスです。 - + ); case "tutorialDescription": - return <>一歩一歩、Typstの使い方を学びましょう。; + return 一歩一歩、Typstの使い方を学びましょう。; case "tutorial": - return <>チュートリアル; + return チュートリアル; case "openOfficialDocs": - return <>原文(英語)を開く; + return 原文(英語)を開く; case "reference": - return <>リファレンス; + return リファレンス; case "typstOfficialDocs": - return <>Typst公式ドキュメント; + return Typst公式ドキュメント; case "typstOfficialWebsite": - return <>Typst公式サイト; + return Typst公式サイト; case "untranslated": - return <>未翻訳; + return 未翻訳; case "untranslatedMessage": return ( - <>このページはまだ翻訳されていません。原文の内容が表示されています。 + + このページはまだ翻訳されていません。原文の内容が表示されています。 + ); case "communityContent": - return <>日本語版オリジナル; + return 日本語版オリジナル; case "contentAddedByCommunity": return ( - <> + このページの内容は公式ドキュメントには含まれておらず、日本語コミュニティが独自に追加したものです。 - + ); case "partiallyTranslated": - return <>部分的に翻訳済み; + return 部分的に翻訳済み; case "partiallyTranslatedMessage": return ( - <> + このページは部分的に翻訳されています。一部原文の内容が含まれています。 - + ); case "translated": - return <>翻訳済み; + return 翻訳済み; case "translatedMessage": - return <>このページは日本語に翻訳済みです。; + return このページは日本語に翻訳済みです。; case "elementFunction": - return <>要素関数; + return 要素関数; case "elementFunctionDescription": return ( - <> + 要素関数はsetルールやshow ルールでカスタマイズできます。 - + ); case "contextFunction": - return <>コンテキスト関数; + return コンテキスト関数; case "contextFunctionDescription": return ( - <>コンテキスト関数は、コンテキストが既知の場合にのみ使用できます。 + + コンテキスト関数は、コンテキストが既知の場合にのみ使用できます。 + ); case "definitionTooltip": - return <>定義; + return 定義; case "definitionTooltipDescription": return ( - <> + これらの関数や型には、関連する定義を持たせることができます。定義にアクセスするには、対象の関数や型の名前を指定した後に、ピリオド区切りで定義名を記述します。 - + ); case "argument": - return <>引数; + return 引数; case "argumentDescription": return ( - <>引数は関数への入力値です。関数名の後に括弧で囲んで指定します。 + + 引数は関数への入力値です。関数名の後に括弧で囲んで指定します。 + ); case "variadic": - return <>可変長引数; + return 可変長引数; case "variadicDescription": - return <>可変長引数は複数回指定することができます。; + return 可変長引数は複数回指定することができます。; case "positional": - return <>位置引数; + return 位置引数; case "positionalDescription": return ( - <>位置引数は順序通りに指定することで、引数名を省略して設定できます。 + + 位置引数は順序通りに指定することで、引数名を省略して設定できます。 + ); case "required": - return <>必須引数; + return 必須引数; case "requiredDescription": - return <>必須引数は、関数を呼び出す際に必ず指定しなければなりません。; + return ( + + 必須引数は、関数を呼び出す際に必ず指定しなければなりません。 + + ); case "document": - return <>ドキュメント; + return ドキュメント; case "langVersion": - return <>日本語版; + return 日本語版; case "translationRate": - return <>翻訳率; + return 翻訳率; case "settable": - return <>設定可能引数; + return 設定可能引数; case "settableDescription": return ( - <> + 設定可能引数は、set ルールを用いて設定でき、それ以降で使用するデフォルト値を変更できます。 - + ); case "siteNoticeBannerTitle": - return <>情報 / Info; + return 情報 / Info; case "siteNoticeBannerDescription": return ( - <> + 当サイトは、Typst GmbHの許諾を得て、日本語コミュニティ「 Typst Japanese Community」が Typst v{version}の公式ドキュメント @@ -196,14 +209,14 @@ export const Translation: TranslationComponent = (props) => { our GitHub repository for both translation improvements and website enhancements. Feel free to join{" "} our Discord server "Kumihan Club". - + ); case "footer": return ( - <> + Translated by{" "} Typst Japanese Community - + ); default: return null; diff --git a/website/src/utils/flattenDocs.test.ts b/website/src/utils/flattenDocs.test.ts index 1b31031c60..17fecc7594 100644 --- a/website/src/utils/flattenDocs.test.ts +++ b/website/src/utils/flattenDocs.test.ts @@ -153,7 +153,7 @@ describe("flattenDocs", () => { const child = createMockPage("/a/b/", "B", [grandChild]); const parent = createMockPage("/a/", "A", [child]); - const [flattenedPages, pagePaths] = flattenDocs([parent]); + const [_flattenedPages, pagePaths] = flattenDocs([parent]); expect(pagePaths[0]).toEqual([parent]); expect(pagePaths[1]).toEqual([parent, child]);