@vercel/geistdocs 1.2.1 → 1.2.3-canary.1d733b2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons/icon-arrow-up-right-small.d.ts +8 -0
- package/dist/assets/icons/icon-arrow-up-right-small.d.ts.map +1 -0
- package/dist/assets/icons/icon-arrow-up-right-small.js +4 -0
- package/dist/assets/icons/icon-arrow-up-right.d.ts +5 -0
- package/dist/assets/icons/icon-arrow-up-right.d.ts.map +1 -0
- package/dist/assets/icons/icon-arrow-up-right.js +4 -0
- package/dist/assets/icons/icon-check.d.ts +5 -0
- package/dist/assets/icons/icon-check.d.ts.map +1 -0
- package/dist/assets/icons/icon-check.js +4 -0
- package/dist/assets/icons/icon-chevron-down-small.d.ts +8 -0
- package/dist/assets/icons/icon-chevron-down-small.d.ts.map +1 -0
- package/dist/assets/icons/icon-chevron-down-small.js +7 -0
- package/dist/assets/icons/icon-chevron-right.d.ts +5 -0
- package/dist/assets/icons/icon-chevron-right.d.ts.map +1 -0
- package/dist/assets/icons/icon-chevron-right.js +4 -0
- package/dist/assets/icons/icon-copy.d.ts +5 -0
- package/dist/assets/icons/icon-copy.d.ts.map +1 -0
- package/dist/assets/icons/icon-copy.js +4 -0
- package/dist/assets/icons/icon-file-text.d.ts +5 -0
- package/dist/assets/icons/icon-file-text.d.ts.map +1 -0
- package/dist/assets/icons/icon-file-text.js +4 -0
- package/dist/assets/icons/icon-menu-alt.d.ts +5 -0
- package/dist/assets/icons/icon-menu-alt.d.ts.map +1 -0
- package/dist/assets/icons/icon-menu-alt.js +4 -0
- package/dist/assets/icons/icon-slash-forward.d.ts +8 -0
- package/dist/assets/icons/icon-slash-forward.d.ts.map +1 -0
- package/dist/assets/icons/icon-slash-forward.js +4 -0
- package/dist/assets/icons/index.d.ts +10 -0
- package/dist/assets/icons/index.d.ts.map +1 -0
- package/dist/assets/icons/index.js +10 -0
- package/dist/assets/logos/index.d.ts +15 -0
- package/dist/assets/logos/index.d.ts.map +1 -0
- package/dist/assets/logos/index.js +15 -0
- package/dist/assets/logos/logo-ai-elements.d.ts +8 -0
- package/dist/assets/logos/logo-ai-elements.d.ts.map +1 -0
- package/dist/assets/logos/logo-ai-elements.js +8 -0
- package/dist/assets/logos/logo-ai-sdk.d.ts +8 -0
- package/dist/assets/logos/logo-ai-sdk.d.ts.map +1 -0
- package/dist/assets/logos/logo-ai-sdk.js +8 -0
- package/dist/assets/logos/logo-chat-sdk.d.ts +8 -0
- package/dist/assets/logos/logo-chat-sdk.d.ts.map +1 -0
- package/dist/assets/logos/logo-chat-sdk.js +8 -0
- package/dist/assets/logos/logo-flags-sdk.d.ts +8 -0
- package/dist/assets/logos/logo-flags-sdk.d.ts.map +1 -0
- package/dist/assets/logos/logo-flags-sdk.js +8 -0
- package/dist/assets/logos/logo-icon-vercel.d.ts +9 -0
- package/dist/assets/logos/logo-icon-vercel.d.ts.map +1 -0
- package/dist/assets/logos/logo-icon-vercel.js +8 -0
- package/dist/assets/logos/logo-nextjs.d.ts +8 -0
- package/dist/assets/logos/logo-nextjs.d.ts.map +1 -0
- package/dist/assets/logos/logo-nextjs.js +7 -0
- package/dist/assets/logos/logo-streamdown.d.ts +8 -0
- package/dist/assets/logos/logo-streamdown.d.ts.map +1 -0
- package/dist/assets/logos/logo-streamdown.js +8 -0
- package/dist/assets/logos/logo-svelte-kit.d.ts +8 -0
- package/dist/assets/logos/logo-svelte-kit.d.ts.map +1 -0
- package/dist/assets/logos/logo-svelte-kit.js +7 -0
- package/dist/assets/logos/logo-vercel-oss.d.ts +8 -0
- package/dist/assets/logos/logo-vercel-oss.d.ts.map +1 -0
- package/dist/assets/logos/logo-vercel-oss.js +7 -0
- package/dist/assets/logos/logo-workflow-sdk.d.ts +8 -0
- package/dist/assets/logos/logo-workflow-sdk.d.ts.map +1 -0
- package/dist/assets/logos/logo-workflow-sdk.js +8 -0
- package/dist/cli/index.js +3 -0
- package/dist/components/callout.d.ts +12 -0
- package/dist/components/callout.d.ts.map +1 -0
- package/dist/components/callout.js +7 -0
- package/dist/components/code-block-tabs.d.ts +7 -0
- package/dist/components/code-block-tabs.d.ts.map +1 -0
- package/dist/components/code-block-tabs.js +7 -0
- package/dist/components/code-block.d.ts +14 -0
- package/dist/components/code-block.d.ts.map +1 -0
- package/dist/components/code-block.js +45 -0
- package/dist/components/copy-prompt.d.ts +11 -0
- package/dist/components/copy-prompt.d.ts.map +1 -0
- package/dist/components/copy-prompt.js +58 -0
- package/dist/components/mermaid.d.ts +4 -0
- package/dist/components/mermaid.d.ts.map +1 -0
- package/dist/components/mermaid.js +44 -0
- package/dist/components/theme-aware-image.d.ts +12 -0
- package/dist/components/theme-aware-image.d.ts.map +1 -0
- package/dist/components/theme-aware-image.js +8 -0
- package/dist/components/video.d.ts +6 -0
- package/dist/components/video.d.ts.map +1 -0
- package/dist/components/video.js +3 -0
- package/dist/config.d.ts +117 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +1 -0
- package/dist/controls.d.ts +15 -0
- package/dist/controls.d.ts.map +1 -0
- package/dist/controls.js +52 -0
- package/dist/footer.d.ts +8 -0
- package/dist/footer.d.ts.map +1 -0
- package/dist/footer.js +6 -0
- package/dist/home-layout.d.ts +11 -0
- package/dist/home-layout.d.ts.map +1 -0
- package/dist/home-layout.js +31 -0
- package/dist/internal/chat/context.d.ts +19 -0
- package/dist/internal/chat/context.d.ts.map +1 -0
- package/dist/internal/chat/context.js +36 -0
- package/dist/internal/chat/conversation.d.ts +10 -0
- package/dist/internal/chat/conversation.d.ts.map +1 -0
- package/dist/internal/chat/conversation.js +16 -0
- package/dist/internal/chat/copy-chat.d.ts +5 -0
- package/dist/internal/chat/copy-chat.d.ts.map +1 -0
- package/dist/internal/chat/copy-chat.js +35 -0
- package/dist/internal/chat/db.d.ts +13 -0
- package/dist/internal/chat/db.d.ts.map +1 -0
- package/dist/internal/chat/db.js +19 -0
- package/dist/internal/chat/message-metadata.d.ts +8 -0
- package/dist/internal/chat/message-metadata.d.ts.map +1 -0
- package/dist/internal/chat/message-metadata.js +29 -0
- package/dist/internal/chat/message.d.ts +11 -0
- package/dist/internal/chat/message.d.ts.map +1 -0
- package/dist/internal/chat/message.js +11 -0
- package/dist/internal/chat/prompt-input.d.ts +13 -0
- package/dist/internal/chat/prompt-input.d.ts.map +1 -0
- package/dist/internal/chat/prompt-input.js +39 -0
- package/dist/internal/chat/shell.d.ts +2 -0
- package/dist/internal/chat/shell.d.ts.map +1 -0
- package/dist/internal/chat/shell.js +194 -0
- package/dist/internal/chat/shimmer.d.ts +11 -0
- package/dist/internal/chat/shimmer.d.ts.map +1 -0
- package/dist/internal/chat/shimmer.js +18 -0
- package/dist/internal/chat/sources.d.ts +13 -0
- package/dist/internal/chat/sources.d.ts.map +1 -0
- package/dist/internal/chat/sources.js +9 -0
- package/dist/internal/chat/suggestion.d.ts +11 -0
- package/dist/internal/chat/suggestion.d.ts.map +1 -0
- package/dist/internal/chat/suggestion.js +12 -0
- package/dist/internal/cn.d.ts +3 -0
- package/dist/internal/cn.d.ts.map +1 -0
- package/dist/internal/cn.js +3 -0
- package/dist/internal/config-context.d.ts +10 -0
- package/dist/internal/config-context.d.ts.map +1 -0
- package/dist/internal/config-context.js +15 -0
- package/dist/internal/feedback-action.d.ts +14 -0
- package/dist/internal/feedback-action.d.ts.map +1 -0
- package/dist/internal/feedback-action.js +34 -0
- package/dist/internal/footer/github-button.d.ts +7 -0
- package/dist/internal/footer/github-button.d.ts.map +1 -0
- package/dist/internal/footer/github-button.js +10 -0
- package/dist/internal/footer/rss-button.d.ts +2 -0
- package/dist/internal/footer/rss-button.d.ts.map +1 -0
- package/dist/internal/footer/rss-button.js +4 -0
- package/dist/internal/i18n.d.ts +6 -0
- package/dist/internal/i18n.d.ts.map +1 -0
- package/dist/internal/i18n.js +18 -0
- package/dist/internal/languages.d.ts +7 -0
- package/dist/internal/languages.d.ts.map +1 -0
- package/dist/internal/languages.js +18 -0
- package/dist/internal/localized-link.d.ts +8 -0
- package/dist/internal/localized-link.d.ts.map +1 -0
- package/dist/internal/localized-link.js +13 -0
- package/dist/internal/navbar/desktop-menu.d.ts +10 -0
- package/dist/internal/navbar/desktop-menu.d.ts.map +1 -0
- package/dist/internal/navbar/desktop-menu.js +11 -0
- package/dist/internal/navbar/mobile-menu.d.ts +7 -0
- package/dist/internal/navbar/mobile-menu.d.ts.map +1 -0
- package/dist/internal/navbar/mobile-menu.js +44 -0
- package/dist/internal/navbar/navbar-logo.d.ts +16 -0
- package/dist/internal/navbar/navbar-logo.d.ts.map +1 -0
- package/dist/internal/navbar/navbar-logo.js +30 -0
- package/dist/internal/not-implemented.d.ts +2 -0
- package/dist/internal/not-implemented.d.ts.map +1 -0
- package/dist/internal/not-implemented.js +4 -0
- package/dist/internal/page-actions-client.d.ts +13 -0
- package/dist/internal/page-actions-client.d.ts.map +1 -0
- package/dist/internal/page-actions-client.js +171 -0
- package/dist/internal/page-actions.d.ts +18 -0
- package/dist/internal/page-actions.d.ts.map +1 -0
- package/dist/internal/page-actions.js +4 -0
- package/dist/internal/page-visibility.d.ts +18 -0
- package/dist/internal/page-visibility.d.ts.map +1 -0
- package/dist/internal/page-visibility.js +24 -0
- package/dist/internal/provider-client.d.ts +9 -0
- package/dist/internal/provider-client.d.ts.map +1 -0
- package/dist/internal/provider-client.js +24 -0
- package/dist/internal/search.d.ts +5 -0
- package/dist/internal/search.d.ts.map +1 -0
- package/dist/internal/search.js +14 -0
- package/dist/internal/sidebar.d.ts +9 -0
- package/dist/internal/sidebar.d.ts.map +1 -0
- package/dist/internal/sidebar.js +38 -0
- package/dist/internal/table-of-contents.d.ts +9 -0
- package/dist/internal/table-of-contents.d.ts.map +1 -0
- package/dist/internal/table-of-contents.js +5 -0
- package/dist/internal/ui/button-group.d.ts +13 -0
- package/dist/internal/ui/button-group.d.ts.map +1 -0
- package/dist/internal/ui/button-group.js +26 -0
- package/dist/internal/ui/button.d.ts +12 -0
- package/dist/internal/ui/button.d.ts.map +1 -0
- package/dist/internal/ui/button.js +33 -0
- package/dist/internal/ui/card.d.ts +6 -0
- package/dist/internal/ui/card.d.ts.map +1 -0
- package/dist/internal/ui/card.js +14 -0
- package/dist/internal/ui/collapsible.d.ts +6 -0
- package/dist/internal/ui/collapsible.d.ts.map +1 -0
- package/dist/internal/ui/collapsible.js +12 -0
- package/dist/internal/ui/drawer.d.ts +6 -0
- package/dist/internal/ui/drawer.d.ts.map +1 -0
- package/dist/internal/ui/drawer.js +13 -0
- package/dist/internal/ui/dropdown-menu.d.ts +22 -0
- package/dist/internal/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/internal/ui/dropdown-menu.js +41 -0
- package/dist/internal/ui/input-group.d.ts +15 -0
- package/dist/internal/ui/input-group.d.ts.map +1 -0
- package/dist/internal/ui/input-group.js +44 -0
- package/dist/internal/ui/input.d.ts +3 -0
- package/dist/internal/ui/input.d.ts.map +1 -0
- package/dist/internal/ui/input.js +5 -0
- package/dist/internal/ui/kbd.d.ts +4 -0
- package/dist/internal/ui/kbd.d.ts.map +1 -0
- package/dist/internal/ui/kbd.js +8 -0
- package/dist/internal/ui/navigation-menu.d.ts +17 -0
- package/dist/internal/ui/navigation-menu.d.ts.map +1 -0
- package/dist/internal/ui/navigation-menu.js +38 -0
- package/dist/internal/ui/popover.d.ts +6 -0
- package/dist/internal/ui/popover.d.ts.map +1 -0
- package/dist/internal/ui/popover.js +13 -0
- package/dist/internal/ui/scroll-area.d.ts +5 -0
- package/dist/internal/ui/scroll-area.d.ts.map +1 -0
- package/dist/internal/ui/scroll-area.js +12 -0
- package/dist/internal/ui/separator.d.ts +4 -0
- package/dist/internal/ui/separator.d.ts.map +1 -0
- package/dist/internal/ui/separator.js +7 -0
- package/dist/internal/ui/sheet.d.ts +10 -0
- package/dist/internal/ui/sheet.d.ts.map +1 -0
- package/dist/internal/ui/sheet.js +24 -0
- package/dist/internal/ui/sonner.d.ts +3 -0
- package/dist/internal/ui/sonner.d.ts.map +1 -0
- package/dist/internal/ui/sonner.js +20 -0
- package/dist/internal/ui/spinner.d.ts +3 -0
- package/dist/internal/ui/spinner.d.ts.map +1 -0
- package/dist/internal/ui/spinner.js +6 -0
- package/dist/internal/ui/textarea.d.ts +3 -0
- package/dist/internal/ui/textarea.d.ts.map +1 -0
- package/dist/internal/ui/textarea.js +5 -0
- package/dist/internal/ui/tooltip.d.ts +7 -0
- package/dist/internal/ui/tooltip.d.ts.map +1 -0
- package/dist/internal/ui/tooltip.js +16 -0
- package/dist/internal/use-mobile.d.ts +2 -0
- package/dist/internal/use-mobile.d.ts.map +1 -0
- package/dist/internal/use-mobile.js +16 -0
- package/dist/layout.d.ts +14 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +31 -0
- package/dist/mdx.d.ts +67 -0
- package/dist/mdx.d.ts.map +1 -0
- package/dist/mdx.js +35 -0
- package/dist/mobile-docs-bar.d.ts +7 -0
- package/dist/mobile-docs-bar.d.ts.map +1 -0
- package/dist/mobile-docs-bar.js +13 -0
- package/dist/navbar.d.ts +7 -0
- package/dist/navbar.d.ts.map +1 -0
- package/dist/navbar.js +10 -0
- package/dist/pages/docs.d.ts +83 -0
- package/dist/pages/docs.d.ts.map +1 -0
- package/dist/pages/docs.js +98 -0
- package/dist/proxy.d.ts +37 -0
- package/dist/proxy.d.ts.map +1 -0
- package/dist/proxy.js +189 -0
- package/dist/routes/agents.d.ts +21 -0
- package/dist/routes/agents.d.ts.map +1 -0
- package/dist/routes/agents.js +201 -0
- package/dist/routes/chat.d.ts +14 -0
- package/dist/routes/chat.d.ts.map +1 -0
- package/dist/routes/chat.js +251 -0
- package/dist/routes/llms.d.ts +52 -0
- package/dist/routes/llms.d.ts.map +1 -0
- package/dist/routes/llms.js +110 -0
- package/dist/routes/search.d.ts +13 -0
- package/dist/routes/search.d.ts.map +1 -0
- package/dist/routes/search.js +81 -0
- package/dist/routes/sitemap.d.ts +47 -0
- package/dist/routes/sitemap.d.ts.map +1 -0
- package/dist/routes/sitemap.js +176 -0
- package/dist/shiki-theme.d.ts +20 -0
- package/dist/shiki-theme.d.ts.map +1 -0
- package/dist/shiki-theme.js +110 -0
- package/dist/sidebar.d.ts +11 -0
- package/dist/sidebar.d.ts.map +1 -0
- package/dist/sidebar.js +16 -0
- package/dist/source-config.d.ts +68 -0
- package/dist/source-config.d.ts.map +1 -0
- package/dist/source-config.js +161 -0
- package/dist/source.d.ts +181 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +142 -0
- package/dist/versions.d.ts +45 -0
- package/dist/versions.d.ts.map +1 -0
- package/dist/versions.js +79 -0
- package/package.json +186 -9
- package/source-config.js +174 -0
- package/styles.css +556 -0
- package/template/AGENTS.md +82 -0
- package/template/_gitignore +29 -0
- package/template/app/[lang]/(home)/components/centered-section.tsx +24 -0
- package/template/app/[lang]/(home)/components/cta.tsx +19 -0
- package/template/app/[lang]/(home)/components/hero.tsx +27 -0
- package/template/app/[lang]/(home)/components/one-two-section.tsx +23 -0
- package/template/app/[lang]/(home)/components/templates.tsx +48 -0
- package/template/app/[lang]/(home)/components/text-grid-section.tsx +20 -0
- package/template/app/[lang]/(home)/layout.tsx +15 -0
- package/template/app/[lang]/(home)/page.tsx +126 -0
- package/template/app/[lang]/agents.md/route.ts +6 -0
- package/template/app/[lang]/docs/[[...slug]]/page.tsx +22 -0
- package/template/app/[lang]/docs/layout.tsx +14 -0
- package/template/app/[lang]/layout.tsx +29 -0
- package/template/app/[lang]/llms.mdx/[[...slug]]/route.ts +7 -0
- package/template/app/[lang]/llms.txt/route.ts +6 -0
- package/template/app/[lang]/og/[...slug]/background.png +0 -0
- package/template/app/[lang]/og/[...slug]/geist-sans-regular.ttf +0 -0
- package/template/app/[lang]/og/[...slug]/geist-sans-semibold.ttf +0 -0
- package/template/app/[lang]/og/[...slug]/route.tsx +95 -0
- package/template/app/[lang]/rss.xml/route.ts +52 -0
- package/template/app/[lang]/sitemap.md/route.ts +9 -0
- package/template/app/api/chat/route.ts +8 -0
- package/template/app/api/search/route.ts +5 -0
- package/template/app/favicon.ico +0 -0
- package/template/app/global.css +2 -0
- package/template/app/robots.ts +14 -0
- package/template/app/sitemap.ts +36 -0
- package/template/app/styles/geistdocs.css +595 -0
- package/template/components/geistdocs/docs-layout.tsx +20 -0
- package/template/components/geistdocs/mdx-components.tsx +5 -0
- package/template/components/geistdocs/provider.tsx +31 -0
- package/template/components/ui/badge.tsx +46 -0
- package/template/components/ui/button.tsx +60 -0
- package/template/components/ui/command-prompt.tsx +488 -0
- package/template/components.json +22 -0
- package/template/content/docs/agent-readiness.mdx +103 -0
- package/template/content/docs/ask-ai.cn.mdx +85 -0
- package/template/content/docs/ask-ai.mdx +89 -0
- package/template/content/docs/configuration.cn.mdx +155 -0
- package/template/content/docs/configuration.mdx +275 -0
- package/template/content/docs/deployment.cn.mdx +34 -0
- package/template/content/docs/deployment.mdx +40 -0
- package/template/content/docs/edit-on-github.cn.mdx +47 -0
- package/template/content/docs/edit-on-github.mdx +51 -0
- package/template/content/docs/env.cn.mdx +25 -0
- package/template/content/docs/env.mdx +29 -0
- package/template/content/docs/feedback.cn.mdx +85 -0
- package/template/content/docs/feedback.mdx +89 -0
- package/template/content/docs/getting-started.cn.mdx +86 -0
- package/template/content/docs/getting-started.mdx +108 -0
- package/template/content/docs/index.cn.mdx +57 -0
- package/template/content/docs/index.mdx +95 -0
- package/template/content/docs/internationalization.cn.mdx +111 -0
- package/template/content/docs/internationalization.mdx +122 -0
- package/template/content/docs/llms-txt.cn.mdx +72 -0
- package/template/content/docs/llms-txt.mdx +86 -0
- package/template/content/docs/md.cn.mdx +65 -0
- package/template/content/docs/md.mdx +82 -0
- package/template/content/docs/meta.json +25 -0
- package/template/content/docs/migration.mdx +321 -0
- package/template/content/docs/open-in-chat.cn.mdx +78 -0
- package/template/content/docs/open-in-chat.mdx +80 -0
- package/template/content/docs/provider.cn.mdx +70 -0
- package/template/content/docs/provider.mdx +74 -0
- package/template/content/docs/proxy.cn.mdx +96 -0
- package/template/content/docs/proxy.mdx +178 -0
- package/template/content/docs/rss.cn.mdx +104 -0
- package/template/content/docs/rss.mdx +108 -0
- package/template/content/docs/syntax.cn.mdx +416 -0
- package/template/content/docs/syntax.mdx +411 -0
- package/template/content/docs/theme-aware-image.mdx +57 -0
- package/template/content/docs/versioned-docs.cn.mdx +117 -0
- package/template/content/docs/versioned-docs.mdx +228 -0
- package/template/geistdocs.tsx +77 -0
- package/template/lib/geistdocs/config.tsx +30 -0
- package/template/lib/geistdocs/fonts.ts +18 -0
- package/template/lib/geistdocs/i18n.ts +13 -0
- package/template/lib/geistdocs/md-tracking.ts +56 -0
- package/template/lib/geistdocs/source.ts +12 -0
- package/template/lib/utils.ts +6 -0
- package/template/next.config.ts +22 -0
- package/template/package.json +63 -0
- package/template/postcss.config.mjs +5 -0
- package/template/proxy.ts +17 -0
- package/template/source.config.ts +23 -0
- package/template/tsconfig.json +37 -0
- package/dist/index.js +0 -2
- /package/dist/{index.d.ts → cli/index.d.ts} +0 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { isPageVisibleForSurface, } from "../internal/page-visibility";
|
|
2
|
+
import { isGeistdocsSourceBundle } from "../source";
|
|
3
|
+
const DOCS_PREFIX_PATTERN = /^\/docs\/?/;
|
|
4
|
+
const WHITESPACE_PATTERN = /\s+/;
|
|
5
|
+
const getLanguages = (config) => {
|
|
6
|
+
const defaultLanguage = config.defaultLanguage ?? "en";
|
|
7
|
+
const languages = Object.keys(config.translations ?? {});
|
|
8
|
+
return Array.from(new Set([defaultLanguage, ...languages]));
|
|
9
|
+
};
|
|
10
|
+
function buildTree(pages) {
|
|
11
|
+
const root = [];
|
|
12
|
+
const map = new Map();
|
|
13
|
+
const sorted = [...pages].sort((a, b) => a.url.localeCompare(b.url));
|
|
14
|
+
for (const page of sorted) {
|
|
15
|
+
const node = {
|
|
16
|
+
title: page.data.title ?? page.url,
|
|
17
|
+
description: page.data.description ?? "",
|
|
18
|
+
url: page.url,
|
|
19
|
+
type: page.data.type,
|
|
20
|
+
summary: page.data.summary,
|
|
21
|
+
prerequisites: page.data.prerequisites,
|
|
22
|
+
product: page.data.product,
|
|
23
|
+
lastmod: page.data.lastModified
|
|
24
|
+
? page.data.lastModified.toISOString().split("T")[0]
|
|
25
|
+
: undefined,
|
|
26
|
+
children: [],
|
|
27
|
+
};
|
|
28
|
+
map.set(page.url, node);
|
|
29
|
+
const segments = page.url.split("/").filter(Boolean);
|
|
30
|
+
if (segments.length <= 1) {
|
|
31
|
+
root.push(node);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
const parentUrl = `/${segments.slice(0, -1).join("/")}`;
|
|
35
|
+
const parent = map.get(parentUrl);
|
|
36
|
+
if (parent) {
|
|
37
|
+
parent.children.push(node);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
root.push(node);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return root;
|
|
45
|
+
}
|
|
46
|
+
function inferDocType(url, explicitType) {
|
|
47
|
+
if (explicitType) {
|
|
48
|
+
return explicitType.charAt(0).toUpperCase() + explicitType.slice(1);
|
|
49
|
+
}
|
|
50
|
+
if (url.includes("/getting-started")) {
|
|
51
|
+
return "Guide";
|
|
52
|
+
}
|
|
53
|
+
if (url.includes("/reference")) {
|
|
54
|
+
return "Reference";
|
|
55
|
+
}
|
|
56
|
+
if (url.includes("/guides/")) {
|
|
57
|
+
return "Guide";
|
|
58
|
+
}
|
|
59
|
+
return "Conceptual";
|
|
60
|
+
}
|
|
61
|
+
function extractTopics(url, product) {
|
|
62
|
+
const topics = [];
|
|
63
|
+
if (product) {
|
|
64
|
+
topics.push(product);
|
|
65
|
+
}
|
|
66
|
+
const segments = url
|
|
67
|
+
.replace(DOCS_PREFIX_PATTERN, "")
|
|
68
|
+
.split("/")
|
|
69
|
+
.filter(Boolean);
|
|
70
|
+
for (const segment of segments) {
|
|
71
|
+
if (!topics.includes(segment)) {
|
|
72
|
+
topics.push(segment);
|
|
73
|
+
}
|
|
74
|
+
if (topics.length >= 3) {
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return topics.slice(0, 3);
|
|
79
|
+
}
|
|
80
|
+
function truncateToWords(text, maxWords) {
|
|
81
|
+
const words = text.split(WHITESPACE_PATTERN);
|
|
82
|
+
if (words.length <= maxWords) {
|
|
83
|
+
return text;
|
|
84
|
+
}
|
|
85
|
+
return `${words.slice(0, maxWords).join(" ")}...`;
|
|
86
|
+
}
|
|
87
|
+
function renderNode(node, indent, parentTitle) {
|
|
88
|
+
const prefix = " ".repeat(indent);
|
|
89
|
+
const lines = [];
|
|
90
|
+
const segments = [];
|
|
91
|
+
segments.push(`Type: ${inferDocType(node.url, node.type)}`);
|
|
92
|
+
if (node.lastmod) {
|
|
93
|
+
segments.push(`Lastmod: ${node.lastmod}`);
|
|
94
|
+
}
|
|
95
|
+
const summary = node.summary || node.description;
|
|
96
|
+
if (summary) {
|
|
97
|
+
segments.push(`Summary: ${truncateToWords(summary, 100)}`);
|
|
98
|
+
}
|
|
99
|
+
const prereqs = node.prerequisites && node.prerequisites.length > 0
|
|
100
|
+
? node.prerequisites.join(", ")
|
|
101
|
+
: parentTitle;
|
|
102
|
+
if (prereqs) {
|
|
103
|
+
segments.push(`Prerequisites: ${prereqs}`);
|
|
104
|
+
}
|
|
105
|
+
const topics = extractTopics(node.url, node.product);
|
|
106
|
+
if (topics.length > 0) {
|
|
107
|
+
segments.push(`Topics: ${topics.join(", ")}`);
|
|
108
|
+
}
|
|
109
|
+
lines.push(`${prefix}- [${node.title}](${node.url}) | ${segments.join(" | ")}`);
|
|
110
|
+
for (const child of node.children) {
|
|
111
|
+
lines.push("");
|
|
112
|
+
lines.push(renderNode(child, indent + 1, node.title));
|
|
113
|
+
}
|
|
114
|
+
return lines.join("\n");
|
|
115
|
+
}
|
|
116
|
+
const resolveSitemapSections = (source, sources) => {
|
|
117
|
+
const sections = sources ?? (source ? [{ source }] : []);
|
|
118
|
+
if (sections.length === 0) {
|
|
119
|
+
throw new Error("createSitemapMarkdownRoute requires source or sources.");
|
|
120
|
+
}
|
|
121
|
+
return sections;
|
|
122
|
+
};
|
|
123
|
+
const getSectionPages = (source, lang) => isGeistdocsSourceBundle(source)
|
|
124
|
+
? source.source.getPages(lang)
|
|
125
|
+
: source.getPages(lang);
|
|
126
|
+
const getSectionTitle = (section) => section.title ??
|
|
127
|
+
(isGeistdocsSourceBundle(section.source) ? section.source.label : undefined);
|
|
128
|
+
export const createSitemapMarkdownRoute = ({ config, source, sources, title = "Documentation Sitemap", transform, }) => {
|
|
129
|
+
const languages = getLanguages(config);
|
|
130
|
+
const sections = resolveSitemapSections(source, sources);
|
|
131
|
+
const GET = async (_req, { params }) => {
|
|
132
|
+
const { lang } = await params;
|
|
133
|
+
const header = `# ${title}
|
|
134
|
+
|
|
135
|
+
## Purpose
|
|
136
|
+
|
|
137
|
+
This file is a high-level semantic index of the documentation.
|
|
138
|
+
It is intended for:
|
|
139
|
+
|
|
140
|
+
- LLM-assisted navigation (ChatGPT, Claude, etc.)
|
|
141
|
+
- Quick orientation for contributors
|
|
142
|
+
- Identifying relevant documentation areas during development
|
|
143
|
+
|
|
144
|
+
It is not intended to replace individual docs.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
`;
|
|
149
|
+
const body = sections
|
|
150
|
+
.map((section) => {
|
|
151
|
+
const pages = getSectionPages(section.source, lang).filter((page) => isPageVisibleForSurface(page, "sitemap"));
|
|
152
|
+
const tree = buildTree(pages);
|
|
153
|
+
const renderedTree = tree
|
|
154
|
+
.map((node) => renderNode(node, 0))
|
|
155
|
+
.join("\n\n");
|
|
156
|
+
const sectionTitle = getSectionTitle(section);
|
|
157
|
+
return [sectionTitle && `## ${sectionTitle}\n`, renderedTree]
|
|
158
|
+
.filter(Boolean)
|
|
159
|
+
.join("\n");
|
|
160
|
+
})
|
|
161
|
+
.join("\n\n");
|
|
162
|
+
const markdown = header + body;
|
|
163
|
+
return new Response(transform ? await transform(markdown, { lang }) : markdown, {
|
|
164
|
+
headers: {
|
|
165
|
+
"Content-Type": "text/markdown",
|
|
166
|
+
},
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
const generateStaticParams = () => languages.map((lang) => ({ lang }));
|
|
170
|
+
return {
|
|
171
|
+
GET,
|
|
172
|
+
generateStaticParams,
|
|
173
|
+
revalidate: false,
|
|
174
|
+
dynamic: "error",
|
|
175
|
+
};
|
|
176
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const geistShikiTheme: {
|
|
2
|
+
name: string;
|
|
3
|
+
type: "dark";
|
|
4
|
+
colors: {
|
|
5
|
+
"editor.foreground": string;
|
|
6
|
+
"editor.background": string;
|
|
7
|
+
};
|
|
8
|
+
tokenColors: ({
|
|
9
|
+
scope: string[];
|
|
10
|
+
settings: {
|
|
11
|
+
foreground: string;
|
|
12
|
+
};
|
|
13
|
+
} | {
|
|
14
|
+
scope: string;
|
|
15
|
+
settings: {
|
|
16
|
+
foreground: string;
|
|
17
|
+
};
|
|
18
|
+
})[];
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=shiki-theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shiki-theme.d.ts","sourceRoot":"","sources":["../src/shiki-theme.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;CA0G3B,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// Inline shiki css-variables theme to avoid pulling shiki as a direct dependency.
|
|
2
|
+
// Output mirrors `createCssVariablesTheme({ variablePrefix: "--shiki-" })` from shiki@3.x.
|
|
3
|
+
// CSS variables are wired in geistdocs.css under :root.
|
|
4
|
+
export const geistShikiTheme = {
|
|
5
|
+
name: "geist",
|
|
6
|
+
type: "dark",
|
|
7
|
+
colors: {
|
|
8
|
+
"editor.foreground": "var(--shiki-color-text, inherit)",
|
|
9
|
+
"editor.background": "var(--shiki-color-background, transparent)",
|
|
10
|
+
},
|
|
11
|
+
tokenColors: [
|
|
12
|
+
{
|
|
13
|
+
scope: ["comment", "punctuation.definition.comment", "string.comment"],
|
|
14
|
+
settings: { foreground: "var(--shiki-token-comment)" },
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
scope: [
|
|
18
|
+
"constant",
|
|
19
|
+
"entity.name.constant",
|
|
20
|
+
"variable.other.constant",
|
|
21
|
+
"variable.other.enummember",
|
|
22
|
+
"variable.language",
|
|
23
|
+
"entity",
|
|
24
|
+
],
|
|
25
|
+
settings: { foreground: "var(--shiki-token-constant)" },
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
scope: ["entity.name", "meta.export.default", "meta.definition.variable"],
|
|
29
|
+
settings: { foreground: "var(--shiki-token-function)" },
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
scope: [
|
|
33
|
+
"variable.parameter.function",
|
|
34
|
+
"meta.jsx.children",
|
|
35
|
+
"meta.block",
|
|
36
|
+
"meta.tag.attributes",
|
|
37
|
+
"entity.name.section",
|
|
38
|
+
"text",
|
|
39
|
+
"punctuation.definition.tag",
|
|
40
|
+
"punctuation.separator.inheritance.php",
|
|
41
|
+
"punctuation.definition.tag.html",
|
|
42
|
+
"punctuation.definition.tag.begin.html",
|
|
43
|
+
"punctuation.definition.tag.end.html",
|
|
44
|
+
"punctuation.section.embedded",
|
|
45
|
+
"variable.parameter",
|
|
46
|
+
],
|
|
47
|
+
settings: { foreground: "var(--shiki-token-parameter)" },
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
scope: ["entity.name.tag", "support.class.component"],
|
|
51
|
+
settings: { foreground: "var(--shiki-token-function)" },
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
scope: "keyword",
|
|
55
|
+
settings: { foreground: "var(--shiki-token-keyword)" },
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
scope: ["storage", "storage.type", "storage.modifier"],
|
|
59
|
+
settings: { foreground: "var(--shiki-token-keyword)" },
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
scope: [
|
|
63
|
+
"string",
|
|
64
|
+
"string punctuation.section.embedded source",
|
|
65
|
+
"attribute.value",
|
|
66
|
+
],
|
|
67
|
+
settings: { foreground: "var(--shiki-token-string)" },
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
scope: [
|
|
71
|
+
"punctuation",
|
|
72
|
+
"punctuation.definition.string",
|
|
73
|
+
"punctuation.definition.variable",
|
|
74
|
+
"punctuation.definition.string.begin",
|
|
75
|
+
"punctuation.definition.string.end",
|
|
76
|
+
"punctuation.section.embedded.begin",
|
|
77
|
+
"punctuation.section.embedded.end",
|
|
78
|
+
],
|
|
79
|
+
settings: { foreground: "var(--shiki-token-punctuation)" },
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
scope: "string.regexp",
|
|
83
|
+
settings: { foreground: "var(--shiki-token-string-expression)" },
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
scope: [
|
|
87
|
+
"support.function",
|
|
88
|
+
"entity.name.function",
|
|
89
|
+
"meta.function-call.generic",
|
|
90
|
+
],
|
|
91
|
+
settings: { foreground: "var(--shiki-token-function)" },
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
scope: "markup.underline.link",
|
|
95
|
+
settings: { foreground: "var(--shiki-token-link)" },
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
// Markdown list/task content. Shiki's markdown grammar tokenizes
|
|
99
|
+
// bracketed text (including the "x" in "[x]" task markers) as
|
|
100
|
+
// `string.other.link.title.markdown`; pin those to the surrounding
|
|
101
|
+
// list-item color so markdown blocks look uniform.
|
|
102
|
+
scope: [
|
|
103
|
+
"markup.list",
|
|
104
|
+
"string.other.link.title.markdown",
|
|
105
|
+
"string.other.link.description.markdown",
|
|
106
|
+
],
|
|
107
|
+
settings: { foreground: "var(--shiki-token-parameter)" },
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Dispatch, type ReactNode, type SetStateAction } from "react";
|
|
2
|
+
interface GeistdocsSidebarContextValue {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
setIsOpen: Dispatch<SetStateAction<boolean>>;
|
|
5
|
+
}
|
|
6
|
+
export declare const GeistdocsSidebarProvider: ({ children, }: {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const useGeistdocsSidebar: () => GeistdocsSidebarContextValue;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=sidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../src/sidebar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,cAAc,EAIpB,MAAM,OAAO,CAAC;AAEf,UAAU,4BAA4B;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CAC9C;AAKD,eAAO,MAAM,wBAAwB,GAAI,eAEtC;IACD,QAAQ,EAAE,SAAS,CAAC;CACrB,4CASA,CAAC;AAEF,eAAO,MAAM,mBAAmB,oCAU/B,CAAC"}
|
package/dist/sidebar.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext, useMemo, useState, } from "react";
|
|
4
|
+
const GeistdocsSidebarContext = createContext(null);
|
|
5
|
+
export const GeistdocsSidebarProvider = ({ children, }) => {
|
|
6
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
7
|
+
const value = useMemo(() => ({ isOpen, setIsOpen }), [isOpen]);
|
|
8
|
+
return (_jsx(GeistdocsSidebarContext.Provider, { value: value, children: children }));
|
|
9
|
+
};
|
|
10
|
+
export const useGeistdocsSidebar = () => {
|
|
11
|
+
const context = useContext(GeistdocsSidebarContext);
|
|
12
|
+
if (!context) {
|
|
13
|
+
throw new Error("useGeistdocsSidebar must be used within GeistdocsDocsLayout.");
|
|
14
|
+
}
|
|
15
|
+
return context;
|
|
16
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type DefaultMDXOptions, defineConfig as defineFumadocsConfig } from "fumadocs-mdx/config";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
type FumadocsConfigInput = NonNullable<Parameters<typeof defineFumadocsConfig>[0]>;
|
|
4
|
+
export interface GeistdocsSourceConfigOptions {
|
|
5
|
+
mdxOptions?: DefaultMDXOptions;
|
|
6
|
+
plugins?: FumadocsConfigInput["plugins"];
|
|
7
|
+
}
|
|
8
|
+
export declare const geistShikiTheme: {
|
|
9
|
+
name: string;
|
|
10
|
+
type: "dark";
|
|
11
|
+
colors: {
|
|
12
|
+
"editor.foreground": string;
|
|
13
|
+
"editor.background": string;
|
|
14
|
+
};
|
|
15
|
+
tokenColors: ({
|
|
16
|
+
scope: string[];
|
|
17
|
+
settings: {
|
|
18
|
+
foreground: string;
|
|
19
|
+
};
|
|
20
|
+
} | {
|
|
21
|
+
scope: string;
|
|
22
|
+
settings: {
|
|
23
|
+
foreground: string;
|
|
24
|
+
};
|
|
25
|
+
})[];
|
|
26
|
+
};
|
|
27
|
+
export declare const geistdocsFrontmatterSchema: z.ZodObject<{
|
|
28
|
+
title: z.ZodString;
|
|
29
|
+
description: z.ZodOptional<z.ZodString>;
|
|
30
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
31
|
+
full: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
_openapi: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
33
|
+
product: z.ZodOptional<z.ZodString>;
|
|
34
|
+
url: z.ZodOptional<z.ZodString>;
|
|
35
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
36
|
+
conceptual: "conceptual";
|
|
37
|
+
guide: "guide";
|
|
38
|
+
reference: "reference";
|
|
39
|
+
troubleshooting: "troubleshooting";
|
|
40
|
+
integration: "integration";
|
|
41
|
+
overview: "overview";
|
|
42
|
+
}>>;
|
|
43
|
+
prerequisites: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
44
|
+
related: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
45
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
46
|
+
internal: z.ZodOptional<z.ZodBoolean>;
|
|
47
|
+
noindex: z.ZodOptional<z.ZodBoolean>;
|
|
48
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
49
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
50
|
+
canonical: z.ZodOptional<z.ZodString>;
|
|
51
|
+
excludeFrom: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
52
|
+
chat: "chat";
|
|
53
|
+
llms: "llms";
|
|
54
|
+
search: "search";
|
|
55
|
+
sitemap: "sitemap";
|
|
56
|
+
}>>>;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
export declare const geistdocsMetaSchema: z.ZodObject<{
|
|
59
|
+
title: z.ZodOptional<z.ZodString>;
|
|
60
|
+
pages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
61
|
+
description: z.ZodOptional<z.ZodString>;
|
|
62
|
+
root: z.ZodOptional<z.ZodBoolean>;
|
|
63
|
+
defaultOpen: z.ZodOptional<z.ZodBoolean>;
|
|
64
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
export declare const defineGeistdocsSourceConfig: (config?: GeistdocsSourceConfigOptions) => import("fumadocs-mdx/config").GlobalConfig;
|
|
67
|
+
export {};
|
|
68
|
+
//# sourceMappingURL=source-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-config.d.ts","sourceRoot":"","sources":["../src/source-config.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,iBAAiB,EACtB,YAAY,IAAI,oBAAoB,EAGrC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,KAAK,mBAAmB,GAAG,WAAW,CACpC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAC3C,CAAC;AAEF,MAAM,WAAW,4BAA4B;IAC3C,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,OAAO,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;CAC1C;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;CAsG3B,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqCrC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;iBAAa,CAAC;AAE9C,eAAO,MAAM,2BAA2B,GACtC,SAAQ,4BAAiC,+CAoB1C,CAAC"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { remarkMdxMermaid } from "fumadocs-core/mdx-plugins";
|
|
2
|
+
import { defineConfig as defineFumadocsConfig, frontmatterSchema, metaSchema, } from "fumadocs-mdx/config";
|
|
3
|
+
import lastModified from "fumadocs-mdx/plugins/last-modified";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
export const geistShikiTheme = {
|
|
6
|
+
name: "geist",
|
|
7
|
+
type: "dark",
|
|
8
|
+
colors: {
|
|
9
|
+
"editor.foreground": "var(--shiki-color-text, inherit)",
|
|
10
|
+
"editor.background": "var(--shiki-color-background, transparent)",
|
|
11
|
+
},
|
|
12
|
+
tokenColors: [
|
|
13
|
+
{
|
|
14
|
+
scope: ["comment", "punctuation.definition.comment", "string.comment"],
|
|
15
|
+
settings: { foreground: "var(--shiki-token-comment)" },
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
scope: [
|
|
19
|
+
"constant",
|
|
20
|
+
"entity.name.constant",
|
|
21
|
+
"variable.other.constant",
|
|
22
|
+
"variable.other.enummember",
|
|
23
|
+
"variable.language",
|
|
24
|
+
"entity",
|
|
25
|
+
],
|
|
26
|
+
settings: { foreground: "var(--shiki-token-constant)" },
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
scope: ["entity.name", "meta.export.default", "meta.definition.variable"],
|
|
30
|
+
settings: { foreground: "var(--shiki-token-function)" },
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
scope: [
|
|
34
|
+
"variable.parameter.function",
|
|
35
|
+
"meta.jsx.children",
|
|
36
|
+
"meta.block",
|
|
37
|
+
"meta.tag.attributes",
|
|
38
|
+
"entity.name.section",
|
|
39
|
+
"text",
|
|
40
|
+
"punctuation.definition.tag",
|
|
41
|
+
"punctuation.separator.inheritance.php",
|
|
42
|
+
"punctuation.definition.tag.html",
|
|
43
|
+
"punctuation.definition.tag.begin.html",
|
|
44
|
+
"punctuation.definition.tag.end.html",
|
|
45
|
+
"punctuation.section.embedded",
|
|
46
|
+
"variable.parameter",
|
|
47
|
+
],
|
|
48
|
+
settings: { foreground: "var(--shiki-token-parameter)" },
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
scope: ["entity.name.tag", "support.class.component"],
|
|
52
|
+
settings: { foreground: "var(--shiki-token-function)" },
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
scope: "keyword",
|
|
56
|
+
settings: { foreground: "var(--shiki-token-keyword)" },
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
scope: ["storage", "storage.type", "storage.modifier"],
|
|
60
|
+
settings: { foreground: "var(--shiki-token-keyword)" },
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
scope: [
|
|
64
|
+
"string",
|
|
65
|
+
"string punctuation.section.embedded source",
|
|
66
|
+
"attribute.value",
|
|
67
|
+
],
|
|
68
|
+
settings: { foreground: "var(--shiki-token-string)" },
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
scope: [
|
|
72
|
+
"punctuation",
|
|
73
|
+
"punctuation.definition.string",
|
|
74
|
+
"punctuation.definition.variable",
|
|
75
|
+
"punctuation.definition.string.begin",
|
|
76
|
+
"punctuation.definition.string.end",
|
|
77
|
+
"punctuation.section.embedded.begin",
|
|
78
|
+
"punctuation.section.embedded.end",
|
|
79
|
+
],
|
|
80
|
+
settings: { foreground: "var(--shiki-token-punctuation)" },
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
scope: "string.regexp",
|
|
84
|
+
settings: { foreground: "var(--shiki-token-string-expression)" },
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
scope: [
|
|
88
|
+
"support.function",
|
|
89
|
+
"entity.name.function",
|
|
90
|
+
"meta.function-call.generic",
|
|
91
|
+
],
|
|
92
|
+
settings: { foreground: "var(--shiki-token-function)" },
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
scope: "markup.underline.link",
|
|
96
|
+
settings: { foreground: "var(--shiki-token-link)" },
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
scope: [
|
|
100
|
+
"markup.list",
|
|
101
|
+
"string.other.link.title.markdown",
|
|
102
|
+
"string.other.link.description.markdown",
|
|
103
|
+
],
|
|
104
|
+
settings: { foreground: "var(--shiki-token-parameter)" },
|
|
105
|
+
},
|
|
106
|
+
],
|
|
107
|
+
};
|
|
108
|
+
export const geistdocsFrontmatterSchema = frontmatterSchema.extend({
|
|
109
|
+
product: z.string().optional(),
|
|
110
|
+
url: z
|
|
111
|
+
.string()
|
|
112
|
+
.regex(/^\/.*/, { message: "url must start with a slash" })
|
|
113
|
+
.optional(),
|
|
114
|
+
type: z
|
|
115
|
+
.enum([
|
|
116
|
+
"conceptual",
|
|
117
|
+
"guide",
|
|
118
|
+
"reference",
|
|
119
|
+
"troubleshooting",
|
|
120
|
+
"integration",
|
|
121
|
+
"overview",
|
|
122
|
+
])
|
|
123
|
+
.optional(),
|
|
124
|
+
prerequisites: z
|
|
125
|
+
.array(z.string().regex(/^\/.*/, {
|
|
126
|
+
message: "prerequisites must start with a slash",
|
|
127
|
+
}))
|
|
128
|
+
.optional(),
|
|
129
|
+
related: z
|
|
130
|
+
.array(z.string().regex(/^\/.*/, { message: "related must start with a slash" }))
|
|
131
|
+
.optional(),
|
|
132
|
+
summary: z.string().optional(),
|
|
133
|
+
internal: z.boolean().optional(),
|
|
134
|
+
noindex: z.boolean().optional(),
|
|
135
|
+
tags: z.array(z.string()).optional(),
|
|
136
|
+
keywords: z.array(z.string()).optional(),
|
|
137
|
+
canonical: z.string().optional(),
|
|
138
|
+
excludeFrom: z
|
|
139
|
+
.array(z.enum(["chat", "llms", "search", "sitemap"]))
|
|
140
|
+
.optional(),
|
|
141
|
+
});
|
|
142
|
+
export const geistdocsMetaSchema = metaSchema;
|
|
143
|
+
export const defineGeistdocsSourceConfig = (config = {}) => {
|
|
144
|
+
const existingRemarkPlugins = Array.isArray(config.mdxOptions?.remarkPlugins)
|
|
145
|
+
? config.mdxOptions.remarkPlugins
|
|
146
|
+
: [];
|
|
147
|
+
const existingPlugins = Array.isArray(config.plugins) ? config.plugins : [];
|
|
148
|
+
return defineFumadocsConfig({
|
|
149
|
+
...config,
|
|
150
|
+
mdxOptions: {
|
|
151
|
+
...config.mdxOptions,
|
|
152
|
+
remarkPlugins: [remarkMdxMermaid, ...existingRemarkPlugins],
|
|
153
|
+
rehypeCodeOptions: {
|
|
154
|
+
...config.mdxOptions?.rehypeCodeOptions,
|
|
155
|
+
themes: { light: geistShikiTheme, dark: geistShikiTheme },
|
|
156
|
+
defaultColor: "light",
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
plugins: [lastModified(), ...existingPlugins],
|
|
160
|
+
});
|
|
161
|
+
};
|