diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..c4540115a2 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vendor/phenodocs"] + path = vendor/phenodocs + url = https://github.com/KooshaPari/phenodocs.git diff --git a/docs/.npmrc b/docs/.npmrc new file mode 100644 index 0000000000..e3aca970c7 --- /dev/null +++ b/docs/.npmrc @@ -0,0 +1 @@ +@phenotype:registry=https://npm.pkg.github.com diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 2963a3c48b..bc75274ebe 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -1,55 +1,51 @@ -import { defineConfig } from "vitepress"; +import { createPhenotypeConfig } from "@phenotype/docs/config"; -export default defineConfig({ +export default createPhenotypeConfig({ title: "CLIProxyAPI++", description: "CLIProxyAPI++ documentation", + base: process.env.GITHUB_ACTIONS ? "/cliproxyapi-plusplus/" : "/", srcDir: ".", - lastUpdated: true, - cleanUrls: true, - ignoreDeadLinks: true, - themeConfig: { - nav: [ - { text: "Home", link: "/" }, - { text: "Wiki", link: "/wiki/" }, - { text: "Development Guide", link: "/development/" }, - { text: "Document Index", link: "/index/" }, - { text: "API", link: "/api/" }, - { text: "Roadmap", link: "/roadmap/" }, - ], - sidebar: [ - { - text: "Guide", - items: [ - { text: "Overview", link: "/" }, - { text: "Getting Started", link: "/getting-started" }, - { text: "Install", link: "/install" }, - { text: "Provider Usage", link: "/provider-usage" }, - { text: "Provider Catalog", link: "/provider-catalog" }, - { text: "DevOps and CI/CD", link: "/operations/devops-cicd" }, - { text: "Provider Operations", link: "/provider-operations" }, - { text: "Troubleshooting", link: "/troubleshooting" }, - { text: "Planning Boards", link: "/planning/" } - ] - }, - { - text: "Reference", - items: [ - { text: "Routing and Models", link: "/routing-reference" }, - { text: "Feature Guides", link: "/features/" }, - { text: "Docsets", link: "/docsets/" } - ] - }, - { - text: "API", - items: [ - { text: "API Index", link: "/api/" }, - { text: "OpenAI-Compatible API", link: "/api/openai-compatible" }, - { text: "Management API", link: "/api/management" }, - { text: "Operations API", link: "/api/operations" } - ] - } - ], - search: { provider: 'local' }, - socialLinks: [{ icon: 'github', link: 'https://github.com/KooshaPari/cliproxyapi-plusplus' }] - } -}) + githubOrg: "KooshaPari", + githubRepo: "cliproxyapi-plusplus", + nav: [ + { text: "Home", link: "/" }, + { text: "Wiki", link: "/wiki/" }, + { text: "Development Guide", link: "/development/" }, + { text: "Document Index", link: "/index/" }, + { text: "API", link: "/api/" }, + { text: "Roadmap", link: "/roadmap/" }, + ], + sidebar: [ + { + text: "Guide", + items: [ + { text: "Overview", link: "/" }, + { text: "Getting Started", link: "/getting-started" }, + { text: "Install", link: "/install" }, + { text: "Provider Usage", link: "/provider-usage" }, + { text: "Provider Catalog", link: "/provider-catalog" }, + { text: "DevOps and CI/CD", link: "/operations/devops-cicd" }, + { text: "Provider Operations", link: "/provider-operations" }, + { text: "Troubleshooting", link: "/troubleshooting" }, + { text: "Planning Boards", link: "/planning/" }, + ], + }, + { + text: "Reference", + items: [ + { text: "Routing and Models", link: "/routing-reference" }, + { text: "Feature Guides", link: "/features/" }, + { text: "Docsets", link: "/docsets/" }, + ], + }, + { + text: "API", + items: [ + { text: "API Index", link: "/api/" }, + { text: "OpenAI-Compatible API", link: "/api/openai-compatible" }, + { text: "Management API", link: "/api/management" }, + { text: "Operations API", link: "/api/operations" }, + ], + }, + ], +}); diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts index 031d421c3a..44dd76db04 100644 --- a/docs/.vitepress/theme/index.ts +++ b/docs/.vitepress/theme/index.ts @@ -1,14 +1 @@ -import DefaultTheme from "vitepress/theme"; -import type { Theme } from "vitepress"; -import CategorySwitcher from "./components/CategorySwitcher.vue"; -import "./custom.css"; - -const theme: Theme = { - ...DefaultTheme, - enhanceApp({ app }) { - app.component("CategorySwitcher", CategorySwitcher); - }, - Layout: DefaultTheme.Layout, -}; - -export default theme; +export { default } from "@phenotype/docs/theme"; diff --git a/docs/package.json b/docs/package.json index 96b22d06b3..b99a1f956d 100644 --- a/docs/package.json +++ b/docs/package.json @@ -3,14 +3,16 @@ "private": true, "type": "module", "scripts": { - "docs:dev": "vitepress dev .", - "docs:build": "vitepress build .", - "docs:preview": "vitepress preview ." + "postinstall": "cd ../vendor/phenodocs/packages/docs && bun install", + "dev": "vitepress dev .", + "build": "vitepress build .", + "preview": "vitepress preview ." }, - "devDependencies": { - "vitepress": "^1.6.4" + "dependencies": { + "@phenotype/docs": "file:../vendor/phenodocs/packages/docs" }, - "overrides": { - "esbuild": ">=0.25.0" + "devDependencies": { + "vitepress": "^1.6.4", + "vue": "^3.5.0" } } diff --git a/vendor/phenodocs b/vendor/phenodocs new file mode 160000 index 0000000000..35e0e90a19 --- /dev/null +++ b/vendor/phenodocs @@ -0,0 +1 @@ +Subproject commit 35e0e90a19dfd93ce4e1a81210ade92088b2bbbc