Skip to content
This repository was archived by the owner on Mar 2, 2025. It is now read-only.

Commit c101b1e

Browse files
Move from main repo
0 parents  commit c101b1e

37 files changed

+17216
-0
lines changed

.gitignore

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
.yarn/install-state.gz
8+
9+
# testing
10+
/coverage
11+
12+
# next.js
13+
/.next/
14+
/out/
15+
16+
# production
17+
/build
18+
19+
# misc
20+
.DS_Store
21+
*.pem
22+
23+
# debug
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
28+
# local env files
29+
.env*.local
30+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
next-env.d.ts

README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2+
3+
## Getting Started
4+
5+
First, run the development server:
6+
7+
```bash
8+
npm run dev
9+
# or
10+
yarn dev
11+
# or
12+
pnpm dev
13+
# or
14+
bun dev
15+
```
16+
17+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18+
19+
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
20+
21+
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
22+
23+
## Learn More
24+
25+
To learn more about Next.js, take a look at the following resources:
26+
27+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29+
30+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
31+
32+
## Deploy on Vercel
33+
34+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35+
36+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

app/docs/[...pkg]/page.tsx

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import ModuleCard from "@/components/module-card";
2+
import Sidebar from "@/components/sidebar";
3+
import {
4+
Breadcrumb,
5+
BreadcrumbList,
6+
BreadcrumbItem,
7+
BreadcrumbLink,
8+
BreadcrumbSeparator,
9+
} from "@/components/ui/breadcrumb";
10+
import { findPackage } from "@/lib/docs";
11+
import React, { Fragment, useMemo } from "react";
12+
13+
export default function Package({ params }: { params: { pkg: string[] } }) {
14+
const Crumbs = useMemo(() => {
15+
const generateHref = (index: number) => {
16+
return `/docs/${params.pkg.slice(0, index + 1).join("/")}`;
17+
};
18+
19+
return (
20+
<Breadcrumb className="text-primary font-semibold p-4">
21+
<BreadcrumbList>
22+
<BreadcrumbItem>
23+
<BreadcrumbLink href="/">Home</BreadcrumbLink>
24+
</BreadcrumbItem>
25+
{params.pkg.map((pkg, index) => (
26+
<Fragment key={pkg}>
27+
<BreadcrumbSeparator />
28+
<BreadcrumbItem>
29+
<BreadcrumbLink
30+
href={generateHref(index)}
31+
className="capitalize"
32+
>
33+
{pkg}
34+
</BreadcrumbLink>
35+
</BreadcrumbItem>
36+
</Fragment>
37+
))}
38+
</BreadcrumbList>
39+
</Breadcrumb>
40+
);
41+
}, [params.pkg]);
42+
43+
const pkg = findPackage(params.pkg);
44+
45+
if (!pkg) {
46+
return <div>Package not found</div>;
47+
}
48+
49+
const modules = pkg.modules || [];
50+
51+
return (
52+
<main>
53+
<div className="flex items-center h-full">
54+
<Sidebar pkg={pkg} />
55+
<div className="w-4/5 p-4 grid grid-cols-1 gap-4 translate-x-1/4">
56+
{modules.length > 0 &&
57+
modules.map((mdl) => <ModuleCard mdl={mdl} key={mdl.name} />)}
58+
</div>
59+
</div>
60+
<div className="fixed bottom-0 right-0">{Crumbs}</div>
61+
</main>
62+
);
63+
}

app/favicon.ico

40.1 KB
Binary file not shown.

app/globals.css

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
5+
@layer base {
6+
:root {
7+
--background: 0 0% 100%;
8+
--foreground: 0 0% 3.9%;
9+
10+
--card: 0 0% 100%;
11+
--card-foreground: 0 0% 3.9%;
12+
13+
--popover: 0 0% 100%;
14+
--popover-foreground: 0 0% 3.9%;
15+
16+
--primary: 0 0% 9%;
17+
--primary-foreground: 0 0% 98%;
18+
19+
--secondary: 0 0% 96.1%;
20+
--secondary-foreground: 0 0% 9%;
21+
22+
--muted: 0 0% 96.1%;
23+
--muted-foreground: 0 0% 45.1%;
24+
25+
--accent: 0 0% 96.1%;
26+
--accent-foreground: 0 0% 9%;
27+
28+
--destructive: 0 84.2% 60.2%;
29+
--destructive-foreground: 0 0% 98%;
30+
31+
--border: 0 0% 89.8%;
32+
--input: 0 0% 89.8%;
33+
--ring: 0 0% 3.9%;
34+
35+
--radius: 0.5rem;
36+
}
37+
38+
.dark {
39+
--background: 0 0% 3.9%;
40+
--foreground: 0 0% 98%;
41+
42+
--card: 0 0% 3.9%;
43+
--card-foreground: 0 0% 98%;
44+
45+
--popover: 0 0% 3.9%;
46+
--popover-foreground: 0 0% 98%;
47+
48+
--primary: 0 0% 98%;
49+
--primary-foreground: 0 0% 9%;
50+
51+
--secondary: 0 0% 14.9%;
52+
--secondary-foreground: 0 0% 98%;
53+
54+
--muted: 0 0% 14.9%;
55+
--muted-foreground: 0 0% 63.9%;
56+
57+
--accent: 0 0% 14.9%;
58+
--accent-foreground: 0 0% 98%;
59+
60+
--destructive: 0 62.8% 30.6%;
61+
--destructive-foreground: 0 0% 98%;
62+
63+
--border: 0 0% 14.9%;
64+
--input: 0 0% 14.9%;
65+
--ring: 0 0% 83.1%;
66+
}
67+
}
68+
69+
@layer base {
70+
* {
71+
@apply border-border;
72+
}
73+
body {
74+
@apply bg-background text-foreground;
75+
}
76+
}

app/layout.tsx

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import type { Metadata } from "next";
2+
import { Inter } from "next/font/google";
3+
import "./globals.css";
4+
import { ThemeProvider } from "@/components/theme-provider";
5+
import Navbar from "@/components/navbar";
6+
7+
const inter = Inter({ subsets: ["latin"] });
8+
9+
export const metadata: Metadata = {
10+
title: "Basalt Docs",
11+
description:
12+
"Public documentation for the Basalt machine learning framework.",
13+
};
14+
15+
export default function RootLayout({
16+
children,
17+
}: Readonly<{
18+
children: React.ReactNode;
19+
}>) {
20+
return (
21+
<html lang="en" suppressHydrationWarning>
22+
<body className={inter.className}>
23+
<ThemeProvider
24+
attribute="class"
25+
defaultTheme="system"
26+
enableSystem
27+
disableTransitionOnChange
28+
>
29+
<Navbar />
30+
{children}
31+
</ThemeProvider>
32+
</body>
33+
</html>
34+
);
35+
}

app/page.tsx

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { Button } from "@/components/ui/button";
2+
import {
3+
Card,
4+
CardContent,
5+
CardDescription,
6+
CardHeader,
7+
CardTitle,
8+
} from "@/components/ui/card";
9+
import Docs from "@/docs.json";
10+
import Link from "next/link";
11+
12+
export default function Home() {
13+
return (
14+
<main className="flex items-center justify-center pt-32">
15+
<div className="w-full max-w-6xl grid grid-cols-1 md:grid-cols-3 gap-16">
16+
{Docs.decl.packages.map((pkg) => (
17+
<Card className="w-full flex flex-col" key={pkg.name}>
18+
<CardHeader>
19+
<CardTitle>{pkg.name}</CardTitle>
20+
<CardDescription className="capitalize">
21+
{[...pkg.modules, ...pkg.packages]
22+
.map((item) => item.name)
23+
.join(", ")}
24+
</CardDescription>
25+
</CardHeader>
26+
<CardContent className="flex-grow">{pkg.description}</CardContent>
27+
<div className="mt-4 p-4">
28+
<Button className="w-full sm:w-auto" variant="ghost">
29+
<Link href={`/docs/${pkg.name}`}>View Documentation</Link>
30+
</Button>
31+
</div>
32+
</Card>
33+
))}
34+
</div>
35+
</main>
36+
);
37+
}

bun.lockb

168 KB
Binary file not shown.

components.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "default",
4+
"rsc": true,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "tailwind.config.ts",
8+
"css": "app/globals.css",
9+
"baseColor": "neutral",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "@/components",
15+
"utils": "@/lib/utils"
16+
}
17+
}

components/function-card.tsx

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
"use client";
2+
3+
import { Function } from "@/lib/docs";
4+
import { Card, CardContent, CardHeader, CardTitle } from "./ui/card";
5+
import { Dialog, DialogContent, DialogTrigger } from "./ui/dialog";
6+
7+
export default async function FunctionCard({ func }: { func: Function }) {
8+
const { name, overloads } = func;
9+
const { constraints, isStatic, summary } = overloads![0];
10+
const signatures = overloads!.map((overload) => overload.signature);
11+
12+
return (
13+
<Dialog>
14+
<div>
15+
<DialogTrigger>{name}</DialogTrigger>
16+
</div>
17+
<DialogContent className="sm:max-w-md">
18+
<Card>
19+
<CardHeader>
20+
<CardTitle>{name}</CardTitle>
21+
{summary && <p>{summary}</p>}
22+
{isStatic && <p>Static</p>}
23+
{constraints && <p>{constraints}</p>}
24+
</CardHeader>
25+
<CardContent>
26+
<ul>
27+
{signatures.map((signature) => (
28+
<li
29+
key={signature}
30+
className={"p-2 my-2 bg-gray-100 dark:bg-gray-800 rounded-md"}
31+
>
32+
<code>{signature}</code>
33+
</li>
34+
))}
35+
</ul>
36+
</CardContent>
37+
</Card>
38+
</DialogContent>
39+
</Dialog>
40+
);
41+
}

0 commit comments

Comments
 (0)