Skip to content

Commit

Permalink
Add selected OS tab to url in documentation to ease link sharing
Browse files Browse the repository at this point in the history
  • Loading branch information
debanjum committed Sep 9, 2024
1 parent 87c52df commit 5dea9ef
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
18 changes: 9 additions & 9 deletions documentation/docs/contributing/development.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
```

<Tabs>
<Tabs groupId="operating-systems" queryString="os">
<TabItem value="macos" label="MacOS">
```shell
# Get Khoj Code
Expand All @@ -33,7 +33,7 @@ python3 -m venv .venv && source .venv/bin/activate
pip install -e '.[dev]'
```
</TabItem>
<TabItem value="win" label="Windows">
<TabItem value="windows" label="Windows">
```shell
# Get Khoj Code
git clone https://github.com/khoj-ai/khoj && cd khoj
Expand All @@ -45,7 +45,7 @@ python3 -m venv .venv && .venv\Scripts\activate
pip install -e '.[dev]'
```
</TabItem>
<TabItem value="unix" label="Linux">
<TabItem value="linux" label="Linux">
```shell
# Get Khoj Code
git clone https://github.com/khoj-ai/khoj && cd khoj
Expand All @@ -63,15 +63,15 @@ pip install -e '.[dev]'

Khoj uses the `pgvector` package to store embeddings of your index in a Postgres database. To use this, you need to have Postgres installed.

<Tabs groupId="operating-systems">
<Tabs groupId="operating-systems" queryString="os">
<TabItem value="macos" label="MacOS">
Install [Postgres.app](https://postgresapp.com/). This comes pre-installed with `pgvector` and relevant dependencies.
</TabItem>
<TabItem value="win" label="Windows">
<TabItem value="windows" label="Windows">
1. Use the [recommended installer](https://www.postgresql.org/download/windows/).
2. Follow instructions to [Install PgVector](https://github.com/pgvector/pgvector#windows) in case you need to manually install it. Windows support is experimental for pgvector currently, so we recommend using Docker. Refer to Windows Installation Notes below if there are errors.
</TabItem>
<TabItem value="unix" label="Linux">
<TabItem value="linux" label="Linux">
From [official instructions](https://wiki.postgresql.org/wiki/Apt)
</TabItem>
<TabItem value="source" label="From Source">
Expand All @@ -84,18 +84,18 @@ Install [Postgres.app](https://postgresapp.com/). This comes pre-installed with

Make sure to update your environment variables to match your Postgres configuration if you're using a different name. The default values should work for most people. When prompted for a password, you can use the default password `postgres`, or configure it to your preference. Make sure to set the environment variable `POSTGRES_PASSWORD` to the same value as the password you set here.
<Tabs groupId="operating-systems">
<Tabs groupId="operating-systems" queryString="os">
<TabItem value="macos" label="MacOS">
```shell
createdb khoj -U postgres --password
```
</TabItem>
<TabItem value="win" label="Windows">
<TabItem value="windows" label="Windows">
```shell
createdb -U postgres khoj --password
```
</TabItem>
<TabItem value="unix" label="Linux">
<TabItem value="linux" label="Linux">
```shell
sudo -u postgres createdb khoj --password
```
Expand Down
24 changes: 12 additions & 12 deletions documentation/docs/get-started/setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ Khoj should now be running at http://localhost:42110! You can see the web UI in

Khoj uses Postgres DB for all server configuration and to scale to multi-user setups. It uses the pgvector package in Postgres to manage your document embeddings. Both Postgres and pgvector need to be installed for Khoj to work.

<Tabs groupId="operating-systems">
<Tabs groupId="operating-systems" queryString="os">
<TabItem value="macos" label="MacOS">
Install [Postgres.app](https://postgresapp.com/). This comes pre-installed with `pgvector` and relevant dependencies.
</TabItem>
<TabItem value="win" label="Windows">
<TabItem value="windows" label="Windows">
For detailed instructions and troubleshooting, see [this section](/contributing/development#2-postgres-installation--setup).
1. Use the [recommended installer](https://www.postgresql.org/download/windows/).
2. Follow instructions to [Install PgVector](https://github.com/pgvector/pgvector#windows) in case you need to manually install it. Windows support is experimental for pgvector currently, so we recommend using Docker.
</TabItem>
<TabItem value="unix" label="Linux">
<TabItem value="linux" label="Linux">
From [official instructions](https://wiki.postgresql.org/wiki/Apt)
</TabItem>
<TabItem value="source" label="From Source">
Expand All @@ -70,18 +70,18 @@ Install [Postgres.app](https://postgresapp.com/). This comes pre-installed with

Make sure to update your environment variables to match your Postgres configuration if you're using a different name. The default values should work for most people. When prompted for a password, you can use the default password `postgres`, or configure it to your preference. Make sure to set the environment variable `POSTGRES_PASSWORD` to the same value as the password you set here.
<Tabs groupId="operating-systems">
<Tabs groupId="operating-systems" queryString="os">
<TabItem value="macos" label="MacOS">
```shell
createdb khoj -U postgres --password
```
</TabItem>
<TabItem value="win" label="Windows">
<TabItem value="windows" label="Windows">
```shell
createdb -U postgres khoj --password
```
</TabItem>
<TabItem value="unix" label="Linux">
<TabItem value="linux" label="Linux">
```shell
sudo -u postgres createdb khoj --password
```
Expand All @@ -96,7 +96,7 @@ sudo -u postgres createdb khoj --password
Run the following command in your terminal to install the Khoj server.
<Tabs groupId="operating-systems">
<Tabs groupId="operating-systems" queryString="os">
<TabItem value="macos" label="MacOS">
```shell
# ARM/M1+ Machines
Expand All @@ -106,7 +106,7 @@ MAKE_ARGS="-DLLAMA_METAL=on" python -m pip install khoj
python -m pip install khoj
```
</TabItem>
<TabItem value="win" label="Windows">
<TabItem value="windows" label="Windows">
In PowerShell on Windows
```shell
# 1. (Optional) To use NVIDIA (CUDA) GPU
Expand All @@ -120,7 +120,7 @@ python -m pip install khoj
py -m pip install khoj
```
</TabItem>
<TabItem value="unix" label="Linux">
<TabItem value="linux" label="Linux">
```shell
# CPU
python -m pip install khoj
Expand All @@ -138,21 +138,21 @@ python -m pip install khoj
Before getting started, configure the following environment variables in your terminal for the first run
<Tabs groupId="operating-systems">
<Tabs groupId="operating-systems" queryString="os">
<TabItem value="macos" label="MacOS">
```shell
export KHOJ_ADMIN_EMAIL=<your-email>
export KHOJ_ADMIN_PASSWORD=<your-password>
```
</TabItem>
<TabItem value="win" label="Windows">
<TabItem value="windows" label="Windows">
If you're using PowerShell:
```shell
$env:KHOJ_ADMIN_EMAIL="<your-email>"
$env:KHOJ_ADMIN_PASSWORD="<your-password>"
```
</TabItem>
<TabItem value="unix" label="Linux">
<TabItem value="linux" label="Linux">
```shell
export KHOJ_ADMIN_EMAIL=<your-email>
export KHOJ_ADMIN_PASSWORD=<your-password>
Expand Down

0 comments on commit 5dea9ef

Please sign in to comment.