Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
add refs, remove extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquim-verges committed Jul 30, 2024
1 parent 31651af commit 05e8708
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 59 deletions.
49 changes: 19 additions & 30 deletions src/app/react-native/v5/sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { CodeIcon, ZapIcon } from "lucide-react";
import { Book, CodeIcon, ZapIcon } from "lucide-react";
import type { SideBar } from "../../../components/Layouts/DocLayout";
import { fetchTypeScriptDoc } from "../../references/components/TDoc/fetchDocs/fetchTypeScriptDoc";
import { getCustomTag } from "../../references/components/TDoc/utils/getSidebarLinkgroups";
import type { FunctionDoc } from "typedoc-better-json";
import { ReactIcon, TypeScriptIcon } from "../../../icons";

const slug = "/react-native/v5";
const docs = await fetchTypeScriptDoc("v5");
Expand Down Expand Up @@ -54,6 +55,16 @@ export const sidebar: SideBar = {
})) || []),
],
},
{
name: "TS reference",
href: "/typeScript/v5",
icon: <TypeScriptIcon />,
},
{
name: "React reference",
href: "/react/v5",
icon: <ReactIcon />,
},
],
},
{
Expand Down Expand Up @@ -181,37 +192,15 @@ export const sidebar: SideBar = {
name: "Extensions",
href: `${slug}/extensions`,
links: [
{
name: "Using Extensions",
href: "/react/v5/extensions",
icon: <Book />,
},
{
name: "Available Extensions",
href: `${slug}/extensions/built-in`,
isCollapsible: false,
links: Object.entries(
docs.functions
?.filter((f) => {
const [tag, extensionName] = getCustomTag(f) || [];
return tag === "@extension" && extensionName !== "DEPLOY";
})
?.reduce(
(acc, f) => {
const [, extensionName] = getCustomTag(f) || [];
if (extensionName) {
acc[extensionName] = acc[extensionName] || [];
acc[extensionName]?.push(f);
}
return acc;
},
{} as Record<string, FunctionDoc[]>,
) || [],
).map(([extensionName, extensionFunctions]) => ({
name: extensionName,
links: extensionFunctions
.sort((a, b) => a.name.localeCompare(b.name))
.map((f) => ({
name: f.name,
href: `${slug}/${extensionName.toLowerCase()}/${f.name}`,
icon: <CodeIcon />,
})),
})),
href: "/typescript/v5/extensions/built-in",
icon: <TypeScriptIcon />,
},
],
},
Expand Down
37 changes: 8 additions & 29 deletions src/app/react/v5/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { SideBar } from "../../../components/Layouts/DocLayout";
import { fetchTypeScriptDoc } from "../../references/components/TDoc/fetchDocs/fetchTypeScriptDoc";
import { getCustomTag } from "../../references/components/TDoc/utils/getSidebarLinkgroups";
import type { FunctionDoc } from "typedoc-better-json";
import { TypeScriptIcon } from "../../../icons";

const slug = "/react/v5";
const docs = await fetchTypeScriptDoc("v5");
Expand Down Expand Up @@ -62,6 +63,11 @@ export const sidebar: SideBar = {
})) || []),
],
},
{
name: "TS reference",
href: "/typeScript/v5",
icon: <TypeScriptIcon />,
},
],
},
{
Expand Down Expand Up @@ -239,35 +245,8 @@ export const sidebar: SideBar = {
},
{
name: "Available Extensions",
href: `${slug}/extensions/built-in`,
isCollapsible: false,
links: Object.entries(
docs.functions
?.filter((f) => {
const [tag, extensionName] = getCustomTag(f) || [];
return tag === "@extension" && extensionName !== "DEPLOY";
})
?.reduce(
(acc, f) => {
const [, extensionName] = getCustomTag(f) || [];
if (extensionName) {
acc[extensionName] = acc[extensionName] || [];
acc[extensionName]?.push(f);
}
return acc;
},
{} as Record<string, FunctionDoc[]>,
) || [],
).map(([extensionName, extensionFunctions]) => ({
name: extensionName,
links: extensionFunctions
.sort((a, b) => a.name.localeCompare(b.name))
.map((f) => ({
name: f.name,
href: `${slug}/${extensionName.toLowerCase()}/${f.name}`,
icon: <CodeIcon />,
})),
})),
href: "/typescript/v5/extensions/built-in",
icon: <TypeScriptIcon />,
},
],
},
Expand Down

0 comments on commit 05e8708

Please sign in to comment.