Add selected OS tab to url in documentation to ease link sharing

This commit is contained in:
Debanjum Singh Solanky
2024-09-06 13:20:45 -07:00
parent 87c52dfd02
commit 5dea9ef323
2 changed files with 21 additions and 21 deletions

View File

@@ -20,7 +20,7 @@ import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem'; import TabItem from '@theme/TabItem';
``` ```
<Tabs> <Tabs groupId="operating-systems" queryString="os">
<TabItem value="macos" label="MacOS"> <TabItem value="macos" label="MacOS">
```shell ```shell
# Get Khoj Code # Get Khoj Code
@@ -33,7 +33,7 @@ python3 -m venv .venv && source .venv/bin/activate
pip install -e '.[dev]' pip install -e '.[dev]'
``` ```
</TabItem> </TabItem>
<TabItem value="win" label="Windows"> <TabItem value="windows" label="Windows">
```shell ```shell
# Get Khoj Code # Get Khoj Code
git clone https://github.com/khoj-ai/khoj && cd khoj git clone https://github.com/khoj-ai/khoj && cd khoj
@@ -45,7 +45,7 @@ python3 -m venv .venv && .venv\Scripts\activate
pip install -e '.[dev]' pip install -e '.[dev]'
``` ```
</TabItem> </TabItem>
<TabItem value="unix" label="Linux"> <TabItem value="linux" label="Linux">
```shell ```shell
# Get Khoj Code # Get Khoj Code
git clone https://github.com/khoj-ai/khoj && cd khoj git clone https://github.com/khoj-ai/khoj && cd khoj
@@ -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. 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"> <TabItem value="macos" label="MacOS">
Install [Postgres.app](https://postgresapp.com/). This comes pre-installed with `pgvector` and relevant dependencies. Install [Postgres.app](https://postgresapp.com/). This comes pre-installed with `pgvector` and relevant dependencies.
</TabItem> </TabItem>
<TabItem value="win" label="Windows"> <TabItem value="windows" label="Windows">
1. Use the [recommended installer](https://www.postgresql.org/download/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. 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>
<TabItem value="unix" label="Linux"> <TabItem value="linux" label="Linux">
From [official instructions](https://wiki.postgresql.org/wiki/Apt) From [official instructions](https://wiki.postgresql.org/wiki/Apt)
</TabItem> </TabItem>
<TabItem value="source" label="From Source"> <TabItem value="source" label="From Source">
@@ -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. 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"> <TabItem value="macos" label="MacOS">
```shell ```shell
createdb khoj -U postgres --password createdb khoj -U postgres --password
``` ```
</TabItem> </TabItem>
<TabItem value="win" label="Windows"> <TabItem value="windows" label="Windows">
```shell ```shell
createdb -U postgres khoj --password createdb -U postgres khoj --password
``` ```
</TabItem> </TabItem>
<TabItem value="unix" label="Linux"> <TabItem value="linux" label="Linux">
```shell ```shell
sudo -u postgres createdb khoj --password sudo -u postgres createdb khoj --password
``` ```

View File

@@ -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. 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"> <TabItem value="macos" label="MacOS">
Install [Postgres.app](https://postgresapp.com/). This comes pre-installed with `pgvector` and relevant dependencies. Install [Postgres.app](https://postgresapp.com/). This comes pre-installed with `pgvector` and relevant dependencies.
</TabItem> </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). 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/). 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. 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>
<TabItem value="unix" label="Linux"> <TabItem value="linux" label="Linux">
From [official instructions](https://wiki.postgresql.org/wiki/Apt) From [official instructions](https://wiki.postgresql.org/wiki/Apt)
</TabItem> </TabItem>
<TabItem value="source" label="From Source"> <TabItem value="source" label="From Source">
@@ -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. 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"> <TabItem value="macos" label="MacOS">
```shell ```shell
createdb khoj -U postgres --password createdb khoj -U postgres --password
``` ```
</TabItem> </TabItem>
<TabItem value="win" label="Windows"> <TabItem value="windows" label="Windows">
```shell ```shell
createdb -U postgres khoj --password createdb -U postgres khoj --password
``` ```
</TabItem> </TabItem>
<TabItem value="unix" label="Linux"> <TabItem value="linux" label="Linux">
```shell ```shell
sudo -u postgres createdb khoj --password sudo -u postgres createdb khoj --password
``` ```
@@ -96,7 +96,7 @@ sudo -u postgres createdb khoj --password
Run the following command in your terminal to install the Khoj server. 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"> <TabItem value="macos" label="MacOS">
```shell ```shell
# ARM/M1+ Machines # ARM/M1+ Machines
@@ -106,7 +106,7 @@ MAKE_ARGS="-DLLAMA_METAL=on" python -m pip install khoj
python -m pip install khoj python -m pip install khoj
``` ```
</TabItem> </TabItem>
<TabItem value="win" label="Windows"> <TabItem value="windows" label="Windows">
In PowerShell on Windows In PowerShell on Windows
```shell ```shell
# 1. (Optional) To use NVIDIA (CUDA) GPU # 1. (Optional) To use NVIDIA (CUDA) GPU
@@ -120,7 +120,7 @@ python -m pip install khoj
py -m pip install khoj py -m pip install khoj
``` ```
</TabItem> </TabItem>
<TabItem value="unix" label="Linux"> <TabItem value="linux" label="Linux">
```shell ```shell
# CPU # CPU
python -m pip install khoj python -m pip install khoj
@@ -138,21 +138,21 @@ python -m pip install khoj
Before getting started, configure the following environment variables in your terminal for the first run 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"> <TabItem value="macos" label="MacOS">
```shell ```shell
export KHOJ_ADMIN_EMAIL=<your-email> export KHOJ_ADMIN_EMAIL=<your-email>
export KHOJ_ADMIN_PASSWORD=<your-password> export KHOJ_ADMIN_PASSWORD=<your-password>
``` ```
</TabItem> </TabItem>
<TabItem value="win" label="Windows"> <TabItem value="windows" label="Windows">
If you're using PowerShell: If you're using PowerShell:
```shell ```shell
$env:KHOJ_ADMIN_EMAIL="<your-email>" $env:KHOJ_ADMIN_EMAIL="<your-email>"
$env:KHOJ_ADMIN_PASSWORD="<your-password>" $env:KHOJ_ADMIN_PASSWORD="<your-password>"
``` ```
</TabItem> </TabItem>
<TabItem value="unix" label="Linux"> <TabItem value="linux" label="Linux">
```shell ```shell
export KHOJ_ADMIN_EMAIL=<your-email> export KHOJ_ADMIN_EMAIL=<your-email>
export KHOJ_ADMIN_PASSWORD=<your-password> export KHOJ_ADMIN_PASSWORD=<your-password>