Skip to content

Commit

Permalink
rename tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
itaismith committed Dec 17, 2024
1 parent b4c1e78 commit d6ef303
Show file tree
Hide file tree
Showing 19 changed files with 39 additions and 47 deletions.
2 changes: 1 addition & 1 deletion docs/docs.trychroma.com/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ It also incldues [Shadcn](https://ui.shadcn.com/) with [Tailwind](https://tailwi
- Dark/Light Mode
- Responsive
- Global and Local state management with localstorage persistence
- MarkdocTabs
- Tabs
- Code styling with Prism
- Toasts

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { TabsContent, TabsList } from "@/components/ui/tabs";
import { tabLabelStyle } from "@/components/markdoc/code-block-header";
import { capitalize, cn } from "@/lib/utils";
import CodeBlock from "@/components/markdoc/code-block";
import { TabProps, TabsTrigger } from "@/components/markdoc/markdoc-tabs";
import { TabProps, TabsTrigger } from "@/components/markdoc/tabs";
import CodeTabs from "@/components/markdoc/code-tab";

const TabbedCodeBlock: React.FC<{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { ReactElement } from "react";
import { tabLabelStyle } from "@/components/markdoc/code-block-header";
import { capitalize, cn } from "@/lib/utils";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { TabProps } from "@/components/markdoc/markdoc-tabs";
import { TabProps } from "@/components/markdoc/tabs";
import CodeBlock from "@/components/markdoc/code-block";
import CopyButton from "@/components/markdoc/copy-button";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ import AppContext from "@/context/app-context";
import CodeBlock from "@/components/markdoc/code-block";
import { Playfair_Display } from "next/font/google";

export const playfairDisplay = Playfair_Display({
subsets: ["latin"],
display: "swap",
weight: "500",
variable: "--font-playfair-display",
});

export interface TabProps {
label: string;
children: React.ReactElement<{ content: string; showHeader: boolean }>;
Expand Down Expand Up @@ -49,7 +42,7 @@ const Tab: React.FC<TabProps> = ({ children }) => {
return <div>{children}</div>;
};

export const MarkdocTabs: React.FC<{ children: ReactElement<TabProps>[] }> = ({
export const Tabs: React.FC<{ children: ReactElement<TabProps>[] }> = ({
children,
}) => {
const { language } = useContext(AppContext);
Expand All @@ -67,8 +60,7 @@ export const MarkdocTabs: React.FC<{ children: ReactElement<TabProps>[] }> = ({
value={tab.props.label}
className={cn(
tabLabelStyle,
playfairDisplay.className,
"text-sm tracking-normal dark:data-[state=active]:bg-transparent data-[state=active]:border-b data-[state=active]:text-gray-900 dark:data-[state=active]:text-gray-200 data-[state=active]:border-gray-900 dark:data-[state=active]:border-gray-200",
"text-sm font-mono tracking-normal dark:data-[state=active]:bg-transparent data-[state=active]:border-b data-[state=active]:text-gray-900 dark:data-[state=active]:text-gray-200 data-[state=active]:border-gray-900 dark:data-[state=active]:border-gray-200",
)}
>
{capitalize(tab.props.label)}
Expand Down
4 changes: 2 additions & 2 deletions docs/docs.trychroma.com/markdoc/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react";
import InlineCode from "@/components/markdoc/inline-code";
import CodeBlock from "@/components/markdoc/code-block";
import TabbedUseCaseCodeBlock from "@/components/markdoc/tabbed-use-case-code-block";
import Tab, { MarkdocTabs } from "@/components/markdoc/markdoc-tabs";
import Tab, { Tabs } from "@/components/markdoc/tabs";
import {
Table,
TableHeader,
Expand Down Expand Up @@ -117,7 +117,7 @@ const markdocConfig: MarkDocConfig = {
TabbedCodeBlock,
TabbedUseCaseCodeBlock,
Tab,
Tabs: MarkdocTabs,
Tabs: Tabs,
Table,
TableHeader,
TableBody,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Chroma is an AI-native open-source vector database. It comes with everything you

### 1. Install

{% MarkdocTabs %}
{% Tabs %}

{% Tab label="python" %}

Expand Down Expand Up @@ -55,11 +55,11 @@ pip install chromadb

{% /Tab %}

{% /MarkdocTabs %}
{% /Tabs %}

### 2. Create a Chroma Client

{% MarkdocTabs %}
{% Tabs %}

{% Tab label="python" %}
```python
Expand Down Expand Up @@ -110,7 +110,7 @@ const client = new ChromaClient();

{% /Tab %}

{% /MarkdocTabs %}
{% /Tabs %}

### 3. Create a collection

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ If you prefer to opt out of telemetry, you can do this in two ways.

#### In Client Code

{% MarkdocTabs %}
{% Tabs %}

{% Tab label="python" %}

Expand All @@ -33,7 +33,7 @@ Disable telemetry on you Chroma server (see next section).

{% /Tab %}

{% /MarkdocTabs %}
{% /Tabs %}

#### In Chroma's Backend Using Environment Variables

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ To start the Chroma server, run the following command:
chroma run --path /db_path
```

{% MarkdocTabs %}
{% Tabs %}

{% Tab label="python" %}

Expand Down Expand Up @@ -56,4 +56,4 @@ const client = new ChromaClient();

{% /Tab %}

{% /MarkdocTabs %}
{% /Tabs %}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Persistent Client

{% MarkdocTabs %}
{% Tabs %}

{% Tab label="python" %}

Expand Down Expand Up @@ -55,7 +55,7 @@ See [Running Chroma in client-server mode](../client-server-mode) for more.

{% /Tab %}

{% /MarkdocTabs %}
{% /Tabs %}

The client object has a few useful convenience methods.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: 'Cohere'

Chroma also provides a convenient wrapper around Cohere's embedding API. This embedding function runs remotely on Cohere’s servers, and requires an API key. You can get an API key by signing up for an account at [Cohere](https://dashboard.cohere.ai/welcome/register).

{% MarkdocTabs %}
{% Tabs %}
{% Tab label="python" %}

This embedding function relies on the `cohere` python package, which you can install with `pip install cohere`.
Expand Down Expand Up @@ -37,7 +37,7 @@ const collectionGet = await client.getCollection({name:"name", embeddingFunction

{% /Tab %}

{% /MarkdocTabs %}
{% /Tabs %}

You can pass in an optional `model_name` argument, which lets you choose which Cohere embeddings model to use. By default, Chroma uses `large` model. You can see the available models under `Get embeddings` section [here](https://docs.cohere.ai/reference/embed).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Chroma provides a convenient wrapper around Google's Generative AI embedding API

You can get an API key by signing up for an account at [Google MakerSuite](https://makersuite.google.com/).

{% MarkdocTabs %}
{% Tabs %}

{% Tab label="python" %}

Expand Down Expand Up @@ -64,4 +64,4 @@ For more info - please visit the [official Google JS docs](https://ai.google.dev

{% /Tab %}

{% /MarkdocTabs %}
{% /Tabs %}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The following OpenAI Embedding Models are supported:
Visit OpenAI Embeddings [documentation](https://platform.openai.com/docs/guides/embeddings) for more information.
{% /Banner %}

{% MarkdocTabs %}
{% Tabs %}

{% Tab label="python" %}

Expand Down Expand Up @@ -75,4 +75,4 @@ collection = await client.getCollection({

{% /Tab %}

{% /MarkdocTabs %}
{% /Tabs %}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ chroma run --path <DB path>

#### Client Set-Up

{% MarkdocTabs %}
{% Tabs %}

{% Tab label="python" %}

Expand Down Expand Up @@ -108,7 +108,7 @@ chromaClient.heartbeat()

{% /Tab %}

{% /MarkdocTabs %}
{% /Tabs %}

We recommend setting the environment variable `CHROMA_CLIENT_AUTH_CREDENTIALS` instead of specifying the credentials in code.

Expand Down Expand Up @@ -156,7 +156,7 @@ export CHROMA_SERVER_AUTHZ_PROVIDER="chromadb.auth.simple_rbac_authz.SimpleRBACA

#### Client Set-Up

{% MarkdocTabs %}
{% Tabs %}

{% Tab label="python" %}

Expand Down Expand Up @@ -204,6 +204,6 @@ chromaClient.heartbeat()
```

{% /Tab %}
{% /MarkdocTabs %}
{% /Tabs %}

We recommend setting the environment variable `CHROMA_CLIENT_AUTH_CREDENTIALS` instead of specifying the token in code. Similarly, you can read the value of `CHROMA_AUTH_TOKEN_TRANSPORT_HEADER` in the client construction.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ You can quickly experiment locally with Chroma in client/server mode by using ou
chroma run --path /db_path
```

{% MarkdocTabs %}
{% Tabs %}

{% Tab label="python" %}

Expand Down Expand Up @@ -57,4 +57,4 @@ const client = new ChromaClient();

{% /Tab %}

{% /MarkdocTabs %}
{% /Tabs %}
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ Add the `CHROMA_CLIENT_AUTH_CREDENTIALS` environment variable to your local envi
export CHROMA_CLIENT_AUTH_CREDENTIALS="test-token"
```

{% MarkdocTabs %}
{% Tabs %}

{% Tab label="python" %}

Expand Down Expand Up @@ -283,7 +283,7 @@ chromaClient.heartbeat()

{% /Tab %}

{% /MarkdocTabs %}
{% /Tabs %}

## Observability with AWS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ Add the `CHROMA_CLIENT_AUTH_CREDENTIALS` environment variable to your local envi
export CHROMA_CLIENT_AUTH_CREDENTIALS="test-token"
```

{% MarkdocTabs %}
{% Tabs %}

{% Tab label="python" %}

Expand Down Expand Up @@ -242,7 +242,7 @@ chromaClient.heartbeat()

{% /Tab %}

{% /MarkdocTabs %}
{% /Tabs %}

## Observability with Azure

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ Add the `CHROMA_CLIENT_AUTH_CREDENTIALS` environment variable to your local envi
export CHROMA_CLIENT_AUTH_CREDENTIALS="test-token"
```

{% MarkdocTabs %}
{% Tabs %}

{% Tab label="python" %}

Expand Down Expand Up @@ -269,7 +269,7 @@ chromaClient.heartbeat()

{% /Tab %}

{% /MarkdocTabs %}
{% /Tabs %}

## Observability with GCP

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ In your client environment, set the `CHROMA_CLIENT_AUTH_CREDENTIALS` variable to
export CHROMA_CLIENT_AUTH_CREDENTIALS="admin:admin"
```

{% MarkdocTabs %}
{% Tabs %}

{% Tab label="python" %}

Expand Down Expand Up @@ -170,7 +170,7 @@ chromaClient.heartbeat()

{% /Tab %}

{% /MarkdocTabs %}
{% /Tabs %}

### Static API Token Authentication

Expand Down Expand Up @@ -222,7 +222,7 @@ docker run --env-file ./.chroma_env -v <path_to_authz.yaml>:/chroma/<authz.yaml>

#### Client Set-Up

{% MarkdocTabs %}
{% Tabs %}

{% Tab label="python" %}

Expand Down Expand Up @@ -281,7 +281,7 @@ chromaClient.heartbeat()

{% /Tab %}

{% /MarkdocTabs %}
{% /Tabs %}

## Observability with Docker

Expand Down
Binary file removed docs/docs.trychroma.com/public/favicon.ico
Binary file not shown.

0 comments on commit d6ef303

Please sign in to comment.