From 1cbe441ae8914bff7cd2e5445a7fe8ee88d2a2f4 Mon Sep 17 00:00:00 2001 From: irfanpena Date: Tue, 20 Aug 2024 08:16:52 +0700 Subject: [PATCH 01/10] Fix typo --- docs/quickstart.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/quickstart.mdx b/docs/quickstart.mdx index 7f16011..6cae044 100644 --- a/docs/quickstart.mdx +++ b/docs/quickstart.mdx @@ -14,10 +14,10 @@ import TabItem from "@theme/TabItem"; ## Installation ```sh -# Install using Brew for Mac and Linux +# Install using Brew for Mac brew install cortexso -# Install using winger for Windows +# Install using Winget for Windows winget install cortexso # Install using Sudo for Linux From 3b4142a337e4e1f22e9119f3b45744cffdcaad09 Mon Sep 17 00:00:00 2001 From: irfanpena Date: Tue, 20 Aug 2024 12:01:41 +0700 Subject: [PATCH 02/10] Update the API Categorization --- static/openapi/jan.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/openapi/jan.json b/static/openapi/jan.json index bfd6ec3..5b535e7 100644 --- a/static/openapi/jan.json +++ b/static/openapi/jan.json @@ -1216,7 +1216,7 @@ ], "x-tagGroups": [ { - "name": "Endpoints", + "name": "CORTEX.CPP", "tags": [ "Inference", "Embeddings", @@ -1228,7 +1228,7 @@ ] }, { - "name": "Assistants", + "name": "CORTEX PLATFROM", "tags": [ "Assistants", "Messages", From f091a94d03260ae34a90fd4dd3b84d98abd60a5a Mon Sep 17 00:00:00 2001 From: irfanpena Date: Tue, 20 Aug 2024 12:02:09 +0700 Subject: [PATCH 03/10] nites --- static/openapi/jan.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/openapi/jan.json b/static/openapi/jan.json index 5b535e7..21d6215 100644 --- a/static/openapi/jan.json +++ b/static/openapi/jan.json @@ -1228,7 +1228,7 @@ ] }, { - "name": "CORTEX PLATFROM", + "name": "CORTEX PLATFORM", "tags": [ "Assistants", "Messages", From dc5644858b0f2a1285f2b17b23dc32b2dc207b6c Mon Sep 17 00:00:00 2001 From: irfanpena Date: Tue, 20 Aug 2024 13:46:15 +0700 Subject: [PATCH 04/10] Update the Navbar button --- docusaurus.config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 019cb87..188044b 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -367,12 +367,12 @@ const config: Config = { items: [ { type: "doc", - position: "left", + position: "right", docId: "overview", label: "Docs", }, // { to: "/docs/cli", label: "CLI", position: "left" }, - { to: "/models", label: "Models", position: "right" }, + { to: "/models", label: "Models", position: "left" }, { type: "search", position: "right", From 379d845e097cd35fd9315e5507de347589112944 Mon Sep 17 00:00:00 2001 From: irfanpena Date: Tue, 20 Aug 2024 14:46:09 +0700 Subject: [PATCH 05/10] Update the API Reference button location --- docusaurus.config.ts | 8 ++++- src/plugins/scalar/index.ts | 62 +++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 src/plugins/scalar/index.ts diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 188044b..b09d717 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -222,9 +222,10 @@ const config: Config = { }; }, [ - "@scalar/docusaurus", + "./src/plugins/scalar/index.ts", { label: "API Reference", + showNavLink: false, route: "/api-reference", configuration: { spec: { @@ -371,6 +372,11 @@ const config: Config = { docId: "overview", label: "Docs", }, + { + to: "/api-reference", + label: "API Reference", + position: "right", + }, // { to: "/docs/cli", label: "CLI", position: "left" }, { to: "/models", label: "Models", position: "left" }, { diff --git a/src/plugins/scalar/index.ts b/src/plugins/scalar/index.ts new file mode 100644 index 0000000..40419db --- /dev/null +++ b/src/plugins/scalar/index.ts @@ -0,0 +1,62 @@ +import type { LoadContext, Plugin } from "@docusaurus/types"; +import type { ReferenceProps } from "@scalar/api-reference-react"; + +export type ScalarOptions = { + label: string; + route: string; + showNavLink?: boolean; +} & ReferenceProps; + +/** + * Used to set default options from the user-provided options + * This is also useful to ensure backwards compatibility with older configs that don't have the new options + */ +const createDefaultScalarOptions = (options: ScalarOptions): ScalarOptions => ({ + showNavLink: true, + ...options, +}); + +/** + * Scalar's Docusaurus plugin for Api References + */ +function ScalarDocusaurusCustomPlugin( + context: LoadContext, + options: ScalarOptions +): Plugin { + const defaultOptions = createDefaultScalarOptions(options); + + return { + name: "@scalar/docusaurus", + + async loadContent() { + return defaultOptions; + }, + + async contentLoaded({ content, actions }) { + const { addRoute } = actions; + + // If showNavLink is true, add a link to the navbar + if (defaultOptions.showNavLink) { + ( + context.siteConfig.themeConfig.navbar as { + items: Record[]; + } + ).items.push({ + to: defaultOptions.route ?? "/scalar", + label: defaultOptions.label ?? "Scalar", + position: "left", + }); + } + + addRoute({ + path: defaultOptions.route, + component: "@scalar/docusaurus/dist/ScalarDocusaurus", + // Provide the path to the loaded spec as a prop to your component + exact: true, + ...content, + }); + }, + }; +} + +export default ScalarDocusaurusCustomPlugin; \ No newline at end of file From 450c28c0dace14753604dc3203939fcb0902e174 Mon Sep 17 00:00:00 2001 From: irfanpena Date: Tue, 20 Aug 2024 16:05:40 +0700 Subject: [PATCH 06/10] Add empty folder for Cortex Platform --- docs/cortex-platform/overview.mdx | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 docs/cortex-platform/overview.mdx diff --git a/docs/cortex-platform/overview.mdx b/docs/cortex-platform/overview.mdx new file mode 100644 index 0000000..e69de29 From 264eadaf0afdd752b5a2dc19b5b0fe5d6974048d Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Tue, 20 Aug 2024 17:04:47 +0700 Subject: [PATCH 07/10] feat: megadropdown navbar --- docusaurus.config.ts | 4 + src/components/NavbarMegaMenu/index.tsx | 111 ++++++++++++++++++++++++ src/components/ProductsMenu/index.tsx | 49 +++++++++++ src/theme/NavbarItem/ComponentTypes.tsx | 2 + 4 files changed, 166 insertions(+) create mode 100644 src/components/NavbarMegaMenu/index.tsx create mode 100644 src/components/ProductsMenu/index.tsx diff --git a/docusaurus.config.ts b/docusaurus.config.ts index b09d717..0068e0b 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -378,6 +378,10 @@ const config: Config = { position: "right", }, // { to: "/docs/cli", label: "CLI", position: "left" }, + { + type: "custom-productMegaMenu", + position: "left", + }, { to: "/models", label: "Models", position: "left" }, { type: "search", diff --git a/src/components/NavbarMegaMenu/index.tsx b/src/components/NavbarMegaMenu/index.tsx new file mode 100644 index 0000000..43eb8af --- /dev/null +++ b/src/components/NavbarMegaMenu/index.tsx @@ -0,0 +1,111 @@ +import React from "react"; +import { motion } from "framer-motion"; +import Link from "@docusaurus/Link"; + +const transition = { + type: "spring", + mass: 0.5, + damping: 11.5, + stiffness: 100, + restDelta: 0.001, + restSpeed: 0.001, +}; + +export const MenuItem = ({ + setActive, + active, + item, + children, +}: { + setActive: (item: string) => void; + active: string | null; + item: string; + children?: React.ReactNode; +}) => { + return ( +
setActive(item)} className="relative "> + + {item} + + {active !== null && ( + + {active === item && ( +
+ + + {children} + + +
+ )} +
+ )} +
+ ); +}; + +export const Menu = ({ + setActive, + children, +}: { + setActive: (item: string | null) => void; + children: React.ReactNode; +}) => { + return ( +
setActive(null)} // resets the state + > + {children} +
+ ); +}; + +export const ProductItem = ({ + title, + description, + href, + src, +}: { + title: string; + description: string; + href: string; + src: string; +}) => { + return ( + +
+

+ {title} +

+

+ {description} +

+
+ + ); +}; + +export const HoveredLink = ({ children, ...rest }: any) => { + return ( + + {children} + + ); +}; diff --git a/src/components/ProductsMenu/index.tsx b/src/components/ProductsMenu/index.tsx new file mode 100644 index 0000000..03d87af --- /dev/null +++ b/src/components/ProductsMenu/index.tsx @@ -0,0 +1,49 @@ +import { HoveredLink, Menu, MenuItem, ProductItem } from "../NavbarMegaMenu"; +import { useState } from "react"; + +const ProductsMenu = () => { + const [active, setActive] = useState(null); + + return ( + + +
+ +
+

Cortex.cpp

+

+ Local AI Engine +

+
+
+ +
+

Cortex Platform

+

+ Self-hosted AI Platform +

+
+
+ +
+

Cortex Desktop

+

+ Easy-to-use Desktop app +

+
+
+ +
+

Cortex Server

+

+ Run Cortex in Production +

+
+
+
+
+
+ ); +}; + +export default ProductsMenu; diff --git a/src/theme/NavbarItem/ComponentTypes.tsx b/src/theme/NavbarItem/ComponentTypes.tsx index 05e28f7..4a3866a 100644 --- a/src/theme/NavbarItem/ComponentTypes.tsx +++ b/src/theme/NavbarItem/ComponentTypes.tsx @@ -1,7 +1,9 @@ import ComponentTypes from "@theme-original/NavbarItem/ComponentTypes"; import SocialNavbar from "@site/src/components/SocialNavbar"; +import ProductsMenu from "@site/src/components/ProductsMenu"; export default { ...ComponentTypes, "custom-socialNavbar": SocialNavbar, + "custom-productMegaMenu": ProductsMenu, }; From 477cfb3a898768ca2bbddac1bb3d855bf547ae6f Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Tue, 20 Aug 2024 17:05:50 +0700 Subject: [PATCH 08/10] feat: update title --- src/components/ProductsMenu/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ProductsMenu/index.tsx b/src/components/ProductsMenu/index.tsx index 03d87af..210306c 100644 --- a/src/components/ProductsMenu/index.tsx +++ b/src/components/ProductsMenu/index.tsx @@ -6,7 +6,7 @@ const ProductsMenu = () => { return ( - +
From 82de666deb17697e8a9a6fc3be551588d5075ef8 Mon Sep 17 00:00:00 2001 From: irfanpena Date: Tue, 20 Aug 2024 17:14:27 +0700 Subject: [PATCH 09/10] Added the sidebar for Cortex Platform Placeholder --- docs/cortex-platform/overview.mdx | 5 +++++ sidebars.ts | 8 ++++++++ src/components/ProductsMenu/index.tsx | 10 +++++----- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/docs/cortex-platform/overview.mdx b/docs/cortex-platform/overview.mdx index e69de29..bbd4bbd 100644 --- a/docs/cortex-platform/overview.mdx +++ b/docs/cortex-platform/overview.mdx @@ -0,0 +1,5 @@ +--- +title: Overview +description: Cortex Platform Overview. +slug: /cortex-platform +--- \ No newline at end of file diff --git a/sidebars.ts b/sidebars.ts index ab2a778..e5ba887 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -167,6 +167,14 @@ const sidebars: SidebarsConfig = { }, { type: "doc", id: "troubleshooting", label: "Troubleshooting" }, ], + platform: [ + { + type: "html", + value: "GET STARTED", + className: "sidebar-divider", + }, + "cortex-platform/overview", + ] }; export default sidebars; diff --git a/src/components/ProductsMenu/index.tsx b/src/components/ProductsMenu/index.tsx index 210306c..81b7b70 100644 --- a/src/components/ProductsMenu/index.tsx +++ b/src/components/ProductsMenu/index.tsx @@ -16,7 +16,7 @@ const ProductsMenu = () => {

- +

Cortex Platform

@@ -24,17 +24,17 @@ const ProductsMenu = () => {

- +
-

Cortex Desktop

+

Cortex Desktop (Coming Soon)

Easy-to-use Desktop app

- +
-

Cortex Server

+

Cortex Server (Coming Soon)

Run Cortex in Production

From 0b6a50d98267a005bba9703c986007acacd422da Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Tue, 20 Aug 2024 17:27:37 +0700 Subject: [PATCH 10/10] feat: update coming soon badge --- src/components/NavbarMegaMenu/index.tsx | 2 +- src/components/ProductsMenu/index.tsx | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/components/NavbarMegaMenu/index.tsx b/src/components/NavbarMegaMenu/index.tsx index 43eb8af..e116626 100644 --- a/src/components/NavbarMegaMenu/index.tsx +++ b/src/components/NavbarMegaMenu/index.tsx @@ -103,7 +103,7 @@ export const HoveredLink = ({ children, ...rest }: any) => { return ( {children} diff --git a/src/components/ProductsMenu/index.tsx b/src/components/ProductsMenu/index.tsx index 81b7b70..8f674ed 100644 --- a/src/components/ProductsMenu/index.tsx +++ b/src/components/ProductsMenu/index.tsx @@ -7,7 +7,7 @@ const ProductsMenu = () => { return ( -
+

Cortex.cpp

@@ -18,7 +18,7 @@ const ProductsMenu = () => {
-

Cortex Platform

+

Cortex Platform

Self-hosted AI Platform

@@ -26,7 +26,12 @@ const ProductsMenu = () => {
-

Cortex Desktop (Coming Soon)

+
+

Cortex Desktop

+
+ Coming Soon +
+

Easy-to-use Desktop app

@@ -34,7 +39,12 @@ const ProductsMenu = () => {
-

Cortex Server (Coming Soon)

+
+

Cortex Server

+
+ Coming Soon +
+

Run Cortex in Production