Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOC] New Chroma Docs #3315

Merged
merged 4 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/docs.trychroma.com/app/[...slug]/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from "react";
import Sidebar from "@/components/sidebar/sidebar";

interface LayoutProps {
children: React.ReactNode;
params: { slug: string[] };
}

const PageLayout: React.FC<LayoutProps> = ({ children, params }) => {
const { slug } = params;

return (
<div className="flex flex-grow overflow-hidden">
<Sidebar path={slug} />
<div className="flex-grow overflow-y-auto">{children}</div>
</div>
);
};

export default PageLayout;
19 changes: 19 additions & 0 deletions docs/docs.trychroma.com/app/[...slug]/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from "react";
import CodeBlock from "@/components/markdoc/code-block";

const notFoundCode = `
import chromadb
client = chromadb.Client()
collection = client.get_collection(name="chroma_docs")
results = collection.get(ids=["page"])["documents"]
print(results) # Not found []
`

const NotFound = () => {
return <div className="flex items-center justify-center w-full h-full">
<CodeBlock className="p-4 bg-gray-800 text-white" content={notFoundCode} language="python" showHeader={true}/>
</div>
}

export default NotFound;
37 changes: 37 additions & 0 deletions docs/docs.trychroma.com/app/[...slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import React from "react";
import MarkdocRenderer from "@/components/markdoc/markdoc-renderer";
import sidebarConfig from "@/markdoc/content/sidebar-config";
import { AppSection } from "@/lib/content";

export const generateStaticParams = async () => {
const slugs: string[][] = [];

const traverseSection = (section: AppSection, path: string[] = []) => {
if (section.pages) {
section.pages.forEach((page) => {
slugs.push([...path, page.id]);
});
}

if (section.subsections) {
section.subsections.forEach((subsection) => {
traverseSection(subsection, [...path, subsection.id]);
});
}
};

sidebarConfig.forEach((section) => {
traverseSection(section, [section.id]);
});

return slugs.map((slug) => ({
slug,
}));
};

const Page: React.FC<{ params: { slug: string[] } }> = ({ params }) => {
const { slug } = params;
return <MarkdocRenderer slug={slug} />;
};

export default Page;
15 changes: 15 additions & 0 deletions docs/docs.trychroma.com/app/cloud/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from "react";
import Sidebar from "@/components/sidebar/sidebar";

const CloudPage: React.FC = () => {
return (
<div className="flex h-full flex-grow overflow-hidden pb-5">
<Sidebar path={["cloud"]} />
<div className="flex items-center justify-center flex-grow overflow-y-auto prose">
<h1>Coming Soon</h1>
</div>
</div>
);
};

export default CloudPage;
Binary file not shown.
Binary file added docs/docs.trychroma.com/app/fonts/GeistVF.woff
Binary file not shown.
20 changes: 20 additions & 0 deletions docs/docs.trychroma.com/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

body {
font-family: Arial, Helvetica, sans-serif;
@apply text-[#27201C] dark:text-white
}

@layer utilities {
.text-balance {
text-wrap: balance;
}
}

@layer base {
:root {
--radius: 0.5rem;
}
}
43 changes: 43 additions & 0 deletions docs/docs.trychroma.com/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import type { Metadata } from "next";
import "./globals.css";
import React from "react";
import ThemeProvider from "@/components/ui/theme-provider";
import { Inter } from "next/font/google";
import Header from "@/components/header/header";
import PostHogProvider from "@/components/posthog/posthog-provider";

export const metadata: Metadata = {
title: "Chroma Docs",
description: "Documentation for ChromaDB",
};

const inter = Inter({ subsets: ["latin"] });

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en" className="h-full overscroll-none" suppressHydrationWarning>
<body className={`h-full overflow-hidden ${inter.className} antialiased`}>
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
<PostHogProvider>
<div className="relative h-full w-full">
<div className="absolute inset-0 bg-[url('/background.jpg')] bg-cover bg-center opacity-10 dark:invert dark:opacity-10" />
<div className="relative z-10 flex flex-col h-full">
<Header />
{children}
</div>
</div>
</PostHogProvider>
</ThemeProvider>
</body>
</html>
);
}
19 changes: 19 additions & 0 deletions docs/docs.trychroma.com/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from "react";
import CodeBlock from "@/components/markdoc/code-block";

const notFoundCode = `
import chromadb
client = chromadb.Client()
collection = client.get_collection(name="chroma_docs")
results = collection.get(ids=["page"])["documents"]
print(results) # Not found []
`

const NotFound = () => {
return <div className="flex items-center justify-center w-full h-full">
<CodeBlock className="p-4 bg-gray-800 text-white" content={notFoundCode} language="python" showHeader={true}/>
</div>
}

export default NotFound;
5 changes: 5 additions & 0 deletions docs/docs.trychroma.com/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { redirect } from "next/navigation";

export default function Home() {
return redirect("/docs/overview/introduction");
}
19 changes: 11 additions & 8 deletions docs/docs.trychroma.com/components.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": false,
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.js",
"css": "public/globals.css",
"baseColor": "slate",
"cssVariables": true,
"config": "tailwind.config.ts",
"css": "app/globals.css",
"baseColor": "zinc",
"cssVariables": false,
"prefix": ""
},
"aliases": {
"components": "components",
"utils": "lib/utils"
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
}
}
}
Loading
Loading