diff --git a/README.md b/README.md index 258abebb3..ee443c441 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ OpenKnowledge is a beautiful, local-first markdown editor and LLM wiki with inte style="border-radius: 10px" /> -Available as [macOS app](https://github.com/inkeep/open-knowledge/releases/latest/download/Open-Knowledge-arm64.dmg) or [Web app/CLI](https://openknowledge.ai/docs/get-started/quickstart#ok-install-web-app-linux-intel-mac) for Linux, Windows, Intel Mac. +Available as [macOS app](https://github.com/inkeep/open-knowledge/releases/latest/download/Open-Knowledge-arm64.dmg) or [Web app/CLI](https://openknowledge.ai/docs/get-started/quickstart#ok-install-web-app-linux-windows-intel-mac) for Linux, Windows, Intel Mac. # Features diff --git a/docs/content/get-started/quickstart.mdx b/docs/content/get-started/quickstart.mdx index c37bf18e7..662635895 100644 --- a/docs/content/get-started/quickstart.mdx +++ b/docs/content/get-started/quickstart.mdx @@ -2,7 +2,7 @@ title: Quickstart description: Set up your agent-maintained knowledge base in less than five minutes. --- - + diff --git a/docs/scripts/validate-link.ts b/docs/scripts/validate-link.ts index 8db1d5c71..f5140b811 100644 --- a/docs/scripts/validate-link.ts +++ b/docs/scripts/validate-link.ts @@ -1,6 +1,27 @@ import { getTableOfContents } from 'fumadocs-core/content/toc'; import { getSlugs } from 'fumadocs-core/source'; import { printErrors, readFiles, scanURLs, validateFiles } from 'next-validate-link'; +import { composeTabId } from '../src/components/tabs'; + +const TABS_OPEN_TAG = /]*)>/g; +const GROUP_ID_ATTR = /groupId=["']([^"']+)["']/; +const ITEMS_ATTR = /items=\{\[(.*?)\]\}/s; +const STRING_LITERAL = /(['"])(.*?)\1/g; + +function tabHashes(content: string): string[] { + const hashes: string[] = []; + for (const tag of content.matchAll(TABS_OPEN_TAG)) { + const attrs = tag[1] ?? ''; + const groupId = attrs.match(GROUP_ID_ATTR)?.[1]; + const items = attrs.match(ITEMS_ATTR)?.[1]; + if (!items) continue; + for (const literal of items.matchAll(STRING_LITERAL)) { + const id = composeTabId(literal[2], groupId); + if (id) hashes.push(id); + } + } + return hashes; +} async function checkLinks() { const docsFiles = await readFiles(['content/**/*.{md,mdx}']); @@ -10,7 +31,10 @@ async function checkLinks() { 'docs/[...slug]': docsFiles.map((file) => { return { value: getSlugs(file.path.replace(/^content\//, '')), - hashes: getTableOfContents(file.content).map((item) => item.url.slice(1)), + hashes: [ + ...getTableOfContents(file.content).map((item) => item.url.slice(1)), + ...tabHashes(file.content), + ], }; }), }, diff --git a/docs/src/app/(home)/sections/call-to-action.tsx b/docs/src/app/(home)/sections/call-to-action.tsx index ab166e788..e462f5b8d 100644 --- a/docs/src/app/(home)/sections/call-to-action.tsx +++ b/docs/src/app/(home)/sections/call-to-action.tsx @@ -113,7 +113,7 @@ export function CallToAction() { Download for macOS or CLI diff --git a/docs/src/app/(home)/sections/hero.tsx b/docs/src/app/(home)/sections/hero.tsx index c2f9baa8e..b0623d086 100644 --- a/docs/src/app/(home)/sections/hero.tsx +++ b/docs/src/app/(home)/sections/hero.tsx @@ -55,7 +55,7 @@ export function Hero() { Download for macOS or CLI diff --git a/docs/src/components/mcp-install.tsx b/docs/src/components/mcp-install.tsx index 54c8ad971..7d9868b9f 100644 --- a/docs/src/components/mcp-install.tsx +++ b/docs/src/components/mcp-install.tsx @@ -12,7 +12,7 @@ export function McpInstall({ editor, children }: { editor: string; children?: Re
  • Web app / terminal (Linux, Intel Mac — see the{' '} - + web app guide ). Run ok init in your project: it registers the OpenKnowledge MCP server diff --git a/docs/src/components/tabs.test.ts b/docs/src/components/tabs.test.ts index e6fac8c55..60f3e2a7f 100644 --- a/docs/src/components/tabs.test.ts +++ b/docs/src/components/tabs.test.ts @@ -55,8 +55,8 @@ describe('slugifyTabId', () => { describe('composeTabId (groupId-prefix URL composition)', () => { test('groupId + label → prefixed slug (the docs quickstart shape)', () => { expect(composeTabId('macOS app', 'ok-install')).toBe('ok-install-macos-app'); - expect(composeTabId('Web app (Linux · Intel Mac)', 'ok-install')).toBe( - 'ok-install-web-app-linux-intel-mac', + expect(composeTabId('Web app (Linux, Windows, Intel Mac)', 'ok-install')).toBe( + 'ok-install-web-app-linux-windows-intel-mac', ); });