@vercel/geistdocs 1.3.0-canary.88e35b7 → 1.3.0
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/{template/components/geistcn-fallbacks/geistcn-assets/icons/index.tsx → dist/assets/icons/index.js} +0 -1
- package/dist/assets/logos/index.d.ts +15 -0
- package/dist/assets/logos/index.d.ts.map +1 -0
- package/{template/components/geistcn-fallbacks/geistcn-assets/logos/index.tsx → dist/assets/logos/index.js} +2 -1
- 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 +2 -5
- package/dist/components/button-group.d.ts +2 -0
- package/dist/components/button-group.d.ts.map +1 -0
- package/dist/components/button-group.js +2 -0
- package/dist/components/button.d.ts +2 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +2 -0
- package/dist/components/card.d.ts +2 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +2 -0
- package/dist/components/code-block-tabs.js +3 -3
- package/dist/components/code-block.d.ts.map +1 -1
- package/dist/components/code-block.js +7 -3
- package/dist/components/collapsible.d.ts +2 -0
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible.js +3 -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/dialog.d.ts +13 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +35 -0
- package/dist/components/drawer.d.ts +2 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +3 -0
- package/dist/components/dropdown-menu.d.ts +2 -0
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.js +3 -0
- package/dist/components/input-group.d.ts +2 -0
- package/dist/components/input-group.d.ts.map +1 -0
- package/dist/components/input-group.js +3 -0
- package/dist/components/input.d.ts +2 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +2 -0
- package/dist/components/kbd.d.ts +2 -0
- package/dist/components/kbd.d.ts.map +1 -0
- package/dist/components/kbd.js +2 -0
- package/dist/components/navigation-menu.d.ts +2 -0
- package/dist/components/navigation-menu.d.ts.map +1 -0
- package/dist/components/navigation-menu.js +3 -0
- package/dist/components/popover.d.ts +2 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +3 -0
- package/dist/components/scroll-area.d.ts +2 -0
- package/dist/components/scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area.js +3 -0
- package/dist/components/separator.d.ts +2 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +3 -0
- package/dist/components/sheet.d.ts +2 -0
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sheet.js +3 -0
- package/dist/components/sonner.d.ts +2 -0
- package/dist/components/sonner.d.ts.map +1 -0
- package/dist/components/sonner.js +3 -0
- package/dist/components/spinner.d.ts +2 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +2 -0
- package/dist/components/textarea.d.ts +2 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +2 -0
- package/dist/components/tooltip.d.ts +2 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +3 -0
- package/dist/config.d.ts +66 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/controls.js +4 -4
- 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/conversation.js +1 -1
- package/dist/internal/chat/message.js +1 -1
- package/dist/internal/chat/prompt-input.js +1 -1
- package/dist/internal/chat/shell.d.ts.map +1 -1
- package/dist/internal/chat/shell.js +6 -5
- package/dist/internal/chat/sources.js +1 -1
- 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/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/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/page-actions-client.d.ts +1 -2
- package/dist/internal/page-actions-client.d.ts.map +1 -1
- package/dist/internal/page-actions-client.js +28 -11
- 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/sidebar.d.ts +4 -1
- package/dist/internal/sidebar.d.ts.map +1 -1
- package/dist/internal/sidebar.js +8 -7
- 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.js +2 -2
- package/dist/internal/ui/button.d.ts +1 -1
- package/dist/internal/ui/button.d.ts.map +1 -1
- package/dist/internal/ui/button.js +7 -7
- package/dist/internal/ui/card.js +1 -1
- package/dist/internal/ui/drawer.js +1 -1
- package/dist/internal/ui/dropdown-menu.js +7 -7
- package/dist/internal/ui/input-group.js +2 -2
- package/dist/internal/ui/input.js +1 -1
- package/dist/internal/ui/kbd.js +1 -1
- 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.js +1 -1
- package/dist/internal/ui/scroll-area.js +2 -2
- package/dist/internal/ui/separator.js +1 -1
- package/dist/internal/ui/sheet.js +4 -4
- package/dist/internal/ui/sonner.js +3 -3
- package/dist/internal/ui/textarea.js +1 -1
- package/dist/internal/ui/tooltip.js +1 -1
- package/dist/layout.d.ts +4 -8
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js +26 -44
- package/dist/mdx.d.ts +55 -24
- package/dist/mdx.d.ts.map +1 -1
- package/dist/mdx.js +9 -46
- 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 +33 -5
- package/dist/pages/docs.d.ts.map +1 -1
- package/dist/pages/docs.js +57 -22
- package/dist/proxy.d.ts +24 -8
- package/dist/proxy.d.ts.map +1 -1
- package/dist/proxy.js +116 -36
- 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 +11 -5
- package/dist/routes/chat.d.ts.map +1 -1
- package/dist/routes/chat.js +386 -65
- package/dist/routes/llms.d.ts +29 -10
- package/dist/routes/llms.d.ts.map +1 -1
- package/dist/routes/llms.js +80 -9
- package/dist/routes/search.d.ts +8 -5
- package/dist/routes/search.d.ts.map +1 -1
- package/dist/routes/search.js +52 -4
- package/dist/routes/sitemap.d.ts +15 -3
- package/dist/routes/sitemap.d.ts.map +1 -1
- package/dist/routes/sitemap.js +32 -6
- 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 +155 -4
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +73 -3
- package/dist/versions.d.ts +45 -0
- package/dist/versions.d.ts.map +1 -0
- package/dist/versions.js +79 -0
- package/package.json +142 -9
- package/source-config.js +174 -0
- package/styles.css +465 -102
- package/template/AGENTS.md +95 -0
- package/template/app/[lang]/(home)/components/centered-section.tsx +1 -3
- package/template/app/[lang]/(home)/components/hero.tsx +2 -2
- package/template/app/[lang]/(home)/components/one-two-section.tsx +1 -3
- package/template/app/[lang]/(home)/components/templates.tsx +3 -5
- package/template/app/[lang]/(home)/components/text-grid-section.tsx +1 -1
- package/template/app/[lang]/(home)/layout.tsx +4 -3
- package/template/app/[lang]/(home)/page.tsx +2 -2
- package/template/app/[lang]/agents.md/route.ts +6 -0
- package/template/app/[lang]/docs/[[...slug]]/page.tsx +4 -1
- package/template/app/[lang]/layout.tsx +6 -6
- package/template/app/[lang]/llms.mdx/[[...slug]]/route.ts +1 -1
- package/template/app/[lang]/llms.txt/route.ts +1 -1
- package/template/app/[lang]/sitemap.md/route.ts +2 -2
- package/template/app/api/chat/route.ts +12 -1
- package/template/app/api/search/route.ts +2 -2
- package/template/app/styles/geistdocs.css +151 -109
- package/template/components/ui/badge.tsx +5 -5
- package/template/components/ui/button.tsx +7 -7
- package/template/components/ui/command-prompt.tsx +2 -2
- package/template/content/docs/agent-readiness.mdx +103 -0
- package/template/content/docs/ask-ai.mdx +61 -5
- package/template/content/docs/configuration.cn.mdx +47 -7
- package/template/content/docs/configuration.mdx +226 -66
- package/template/content/docs/deployment.mdx +17 -0
- package/template/content/docs/edit-on-github.mdx +6 -2
- package/template/content/docs/env.mdx +38 -3
- package/template/content/docs/feedback.mdx +6 -2
- package/template/content/docs/getting-started.cn.mdx +2 -2
- package/template/content/docs/getting-started.mdx +71 -43
- package/template/content/docs/index.cn.mdx +36 -33
- package/template/content/docs/index.mdx +69 -59
- package/template/content/docs/internationalization.cn.mdx +7 -9
- package/template/content/docs/internationalization.mdx +10 -5
- package/template/content/docs/llms-txt.cn.mdx +24 -2
- package/template/content/docs/llms-txt.mdx +48 -12
- package/template/content/docs/md.cn.mdx +12 -15
- package/template/content/docs/md.mdx +30 -16
- package/template/content/docs/meta.json +6 -2
- package/template/content/docs/migration.mdx +364 -0
- package/template/content/docs/open-in-chat.mdx +12 -10
- package/template/content/docs/provider.cn.mdx +6 -5
- package/template/content/docs/provider.mdx +13 -8
- package/template/content/docs/proxy.cn.mdx +96 -0
- package/template/content/docs/proxy.mdx +178 -0
- package/template/content/docs/rss.mdx +6 -2
- package/template/content/docs/syntax.cn.mdx +2 -2
- package/template/content/docs/syntax.mdx +6 -2
- package/template/content/docs/theme-aware-image.mdx +5 -1
- package/template/content/docs/versioned-docs.cn.mdx +117 -0
- package/template/content/docs/versioned-docs.mdx +228 -0
- package/template/geistdocs.tsx +26 -0
- package/template/lib/geistdocs/config.tsx +3 -0
- package/template/package.json +5 -5
- package/template/proxy.ts +2 -1
- package/template/source.config.ts +8 -47
- package/template/app/actions/feedback/emotions.ts +0 -18
- package/template/app/actions/feedback/index.ts +0 -45
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-arrow-up-right-small.tsx +0 -35
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-arrow-up-right.tsx +0 -27
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-check.tsx +0 -27
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-chevron-down-small.tsx +0 -30
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-chevron-right.tsx +0 -27
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-copy.tsx +0 -27
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-file-text.tsx +0 -25
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-menu-alt.tsx +0 -27
- package/template/components/geistcn-fallbacks/geistcn-assets/icons/icon-slash-forward.tsx +0 -36
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-ai-elements.tsx +0 -29
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-ai-sdk.tsx +0 -38
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-chat-sdk.tsx +0 -42
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-flags-sdk.tsx +0 -42
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-icon-vercel.tsx +0 -31
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-streamdown.tsx +0 -29
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-vercel-oss.tsx +0 -24
- package/template/components/geistcn-fallbacks/geistcn-assets/logos/logo-workflow-sdk.tsx +0 -73
- package/template/components/geistdocs/callout.tsx +0 -40
- package/template/components/geistdocs/chat.tsx +0 -24
- package/template/components/geistdocs/code-block-tabs.tsx +0 -61
- package/template/components/geistdocs/code-block.tsx +0 -134
- package/template/components/geistdocs/copy-page.tsx +0 -27
- package/template/components/geistdocs/desktop-menu.tsx +0 -52
- package/template/components/geistdocs/docs-page.tsx +0 -35
- package/template/components/geistdocs/edit-source.tsx +0 -30
- package/template/components/geistdocs/feedback.tsx +0 -139
- package/template/components/geistdocs/footer.tsx +0 -30
- package/template/components/geistdocs/github-button.tsx +0 -19
- package/template/components/geistdocs/home-layout.tsx +0 -46
- package/template/components/geistdocs/icons.tsx +0 -13
- package/template/components/geistdocs/installer.tsx +0 -58
- package/template/components/geistdocs/language-selector.tsx +0 -3
- package/template/components/geistdocs/mermaid.tsx +0 -68
- package/template/components/geistdocs/mobile-docs-bar.tsx +0 -81
- package/template/components/geistdocs/mobile-menu.tsx +0 -150
- package/template/components/geistdocs/navbar-logo.tsx +0 -124
- package/template/components/geistdocs/navbar.tsx +0 -22
- package/template/components/geistdocs/rss-button.tsx +0 -10
- package/template/components/geistdocs/scroll-top.tsx +0 -21
- package/template/components/geistdocs/search.tsx +0 -17
- package/template/components/geistdocs/sidebar.tsx +0 -128
- package/template/components/geistdocs/theme-aware-image.tsx +0 -22
- package/template/components/geistdocs/theme-toggle.tsx +0 -3
- package/template/components/geistdocs/video.tsx +0 -16
- package/template/components/ui/button-group.tsx +0 -83
- package/template/components/ui/card.tsx +0 -92
- package/template/components/ui/collapsible.tsx +0 -33
- package/template/components/ui/command.tsx +0 -184
- package/template/components/ui/dialog.tsx +0 -143
- package/template/components/ui/drawer.tsx +0 -135
- package/template/components/ui/dropdown-menu.tsx +0 -257
- package/template/components/ui/hover-card.tsx +0 -44
- package/template/components/ui/input-group.tsx +0 -170
- package/template/components/ui/input.tsx +0 -21
- package/template/components/ui/kbd.tsx +0 -28
- package/template/components/ui/navigation-menu.tsx +0 -192
- package/template/components/ui/popover.tsx +0 -48
- package/template/components/ui/scroll-area.tsx +0 -58
- package/template/components/ui/select.tsx +0 -187
- package/template/components/ui/separator.tsx +0 -28
- package/template/components/ui/sheet.tsx +0 -139
- package/template/components/ui/sonner.tsx +0 -40
- package/template/components/ui/spinner.tsx +0 -16
- package/template/components/ui/textarea.tsx +0 -18
- package/template/components/ui/tooltip.tsx +0 -61
- package/template/hooks/geistdocs/use-sidebar.ts +0 -13
- package/template/hooks/use-mobile.ts +0 -19
package/dist/routes/llms.js
CHANGED
|
@@ -1,8 +1,68 @@
|
|
|
1
1
|
import { notFound } from "next/navigation";
|
|
2
|
-
|
|
2
|
+
import { isPageVisibleForSurface } from "../internal/page-visibility";
|
|
3
|
+
const resolveSources = (source, sources, caller) => {
|
|
4
|
+
const resolvedSources = sources ?? (source ? [source] : []);
|
|
5
|
+
if (resolvedSources.length === 0) {
|
|
6
|
+
throw new Error(`${caller} requires source or sources.`);
|
|
7
|
+
}
|
|
8
|
+
return resolvedSources;
|
|
9
|
+
};
|
|
10
|
+
const pageUrlToSlug = (url) => url.split("/").filter(Boolean);
|
|
11
|
+
const getPathnameFromSlug = (slug) => {
|
|
12
|
+
const segments = slug ?? [];
|
|
13
|
+
return segments.length === 0 ? "/" : `/${segments.join("/")}`;
|
|
14
|
+
};
|
|
15
|
+
const findPageBySlug = ({ lang, slug, sources, }) => {
|
|
16
|
+
for (const source of sources) {
|
|
17
|
+
const page = source.source.getPage(slug, lang);
|
|
18
|
+
if (page) {
|
|
19
|
+
return { page, source };
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const pathname = getPathnameFromSlug(slug);
|
|
23
|
+
for (const source of sources) {
|
|
24
|
+
const page = source.source
|
|
25
|
+
.getPages(lang)
|
|
26
|
+
.find((entry) => entry.url === pathname);
|
|
27
|
+
if (page) {
|
|
28
|
+
return { page, source };
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
};
|
|
33
|
+
const getMarkdownStaticParams = ({ lang, sources, }) => {
|
|
34
|
+
if (sources.length === 1) {
|
|
35
|
+
return sources[0].source.generateParams(lang);
|
|
36
|
+
}
|
|
37
|
+
const sourceLanguages = Array.from(new Set(sources.flatMap((source) => source.source.generateParams()
|
|
38
|
+
.map((param) => param.lang)
|
|
39
|
+
.filter((value) => typeof value === "string"))));
|
|
40
|
+
let languages = sourceLanguages.length > 0 ? sourceLanguages : ["en"];
|
|
41
|
+
if (lang) {
|
|
42
|
+
languages = [lang];
|
|
43
|
+
}
|
|
44
|
+
return languages.flatMap((language) => sources.flatMap((source) => source.source.getPages(language).map((page) => {
|
|
45
|
+
const params = { slug: pageUrlToSlug(page.url) };
|
|
46
|
+
if (!lang) {
|
|
47
|
+
params.lang = language;
|
|
48
|
+
}
|
|
49
|
+
return params;
|
|
50
|
+
})));
|
|
51
|
+
};
|
|
52
|
+
export const createLlmsRoute = ({ filterPage, source, sources, transform, }) => {
|
|
53
|
+
const routeSources = resolveSources(source, sources, "createLlmsRoute");
|
|
3
54
|
const GET = async (_req, { params }) => {
|
|
4
55
|
const { lang } = await params;
|
|
5
|
-
const scanned = await Promise.all(
|
|
56
|
+
const scanned = await Promise.all(routeSources.flatMap((entry) => entry.source
|
|
57
|
+
.getPages(lang)
|
|
58
|
+
.filter((page) => isPageVisibleForSurface(page, "llms") &&
|
|
59
|
+
(filterPage?.(page, { lang }) ?? true))
|
|
60
|
+
.map(async (page) => {
|
|
61
|
+
const rendered = await entry.getPageMarkdown(page);
|
|
62
|
+
return transform
|
|
63
|
+
? await transform(rendered, { lang, page, source: entry })
|
|
64
|
+
: rendered;
|
|
65
|
+
})));
|
|
6
66
|
return new Response(scanned.join("\n\n"), {
|
|
7
67
|
headers: {
|
|
8
68
|
"Content-Type": "text/markdown; charset=utf-8",
|
|
@@ -14,22 +74,33 @@ export const createLlmsRoute = ({ source }) => {
|
|
|
14
74
|
revalidate: false,
|
|
15
75
|
};
|
|
16
76
|
};
|
|
17
|
-
export const createDocsMarkdownRoute = ({ source, }) => {
|
|
77
|
+
export const createDocsMarkdownRoute = ({ filterStaticParams, source, sources, transform, }) => {
|
|
78
|
+
const routeSources = resolveSources(source, sources, "createDocsMarkdownRoute");
|
|
18
79
|
const GET = async (_req, { params }) => {
|
|
19
80
|
const { slug, lang } = await params;
|
|
20
|
-
const
|
|
21
|
-
if (!
|
|
81
|
+
const result = findPageBySlug({ lang, slug, sources: routeSources });
|
|
82
|
+
if (!result) {
|
|
22
83
|
notFound();
|
|
23
84
|
}
|
|
24
|
-
|
|
85
|
+
const { page, source: pageSource } = result;
|
|
86
|
+
const rendered = await pageSource.getPageMarkdown(page);
|
|
87
|
+
return new Response(transform
|
|
88
|
+
? await transform(rendered, { lang, page, source: pageSource })
|
|
89
|
+
: rendered, {
|
|
25
90
|
headers: {
|
|
26
91
|
"Content-Type": "text/markdown",
|
|
27
92
|
},
|
|
28
93
|
});
|
|
29
94
|
};
|
|
30
|
-
const generateStaticParams = async ({ params, }) => {
|
|
31
|
-
const { lang } = await params;
|
|
32
|
-
|
|
95
|
+
const generateStaticParams = async ({ params, } = {}) => {
|
|
96
|
+
const { lang } = (await params) ?? {};
|
|
97
|
+
const staticParams = getMarkdownStaticParams({
|
|
98
|
+
lang,
|
|
99
|
+
sources: routeSources,
|
|
100
|
+
});
|
|
101
|
+
return filterStaticParams
|
|
102
|
+
? staticParams.filter(filterStaticParams)
|
|
103
|
+
: staticParams;
|
|
33
104
|
};
|
|
34
105
|
return {
|
|
35
106
|
GET,
|
package/dist/routes/search.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { createFromSource } from "fumadocs-core/search/server";
|
|
2
1
|
import type { GeistdocsConfig } from "../config";
|
|
3
|
-
type
|
|
2
|
+
import { type GeistdocsSourceBundle } from "../source";
|
|
3
|
+
type SourceBundle = GeistdocsSourceBundle;
|
|
4
|
+
type SearchSource = SourceBundle["source"];
|
|
5
|
+
type SearchSourceInput = SearchSource | SourceBundle;
|
|
4
6
|
interface CreateSearchRouteOptions {
|
|
5
|
-
config: Pick<GeistdocsConfig, "translations">;
|
|
6
|
-
source
|
|
7
|
+
config: Pick<GeistdocsConfig, "defaultLanguage" | "translations">;
|
|
8
|
+
source?: SearchSourceInput;
|
|
9
|
+
sources?: SearchSourceInput[];
|
|
7
10
|
}
|
|
8
|
-
export declare const createSearchRoute: ({ config, source, }: CreateSearchRouteOptions) => (request: Request) => Promise<Response>;
|
|
11
|
+
export declare const createSearchRoute: ({ config, source, sources, }: CreateSearchRouteOptions) => (request: Request) => Promise<Response>;
|
|
9
12
|
export {};
|
|
10
13
|
//# sourceMappingURL=search.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/routes/search.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/routes/search.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,EAAE,KAAK,qBAAqB,EAA2B,MAAM,WAAW,CAAC;AAEhF,KAAK,YAAY,GAAG,qBAAqB,CAAC;AAC1C,KAAK,YAAY,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;AAC3C,KAAK,iBAAiB,GAAG,YAAY,GAAG,YAAY,CAAC;AAIrD,UAAU,wBAAwB;IAChC,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,iBAAiB,GAAG,cAAc,CAAC,CAAC;IAClE,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAsCD,eAAO,MAAM,iBAAiB,GAAI,8BAI/B,wBAAwB,4CAqE1B,CAAC"}
|
package/dist/routes/search.js
CHANGED
|
@@ -1,11 +1,39 @@
|
|
|
1
1
|
import { createTokenizer as createTokenizerJapanese } from "@orama/tokenizers/japanese";
|
|
2
2
|
import { createTokenizer as createTokenizerMandarin } from "@orama/tokenizers/mandarin";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { defineI18n } from "fumadocs-core/i18n";
|
|
4
|
+
import { createI18nSearchAPI, } from "fumadocs-core/search/server";
|
|
5
|
+
import { isPageVisibleForSurface } from "../internal/page-visibility";
|
|
6
|
+
import { isGeistdocsSourceBundle } from "../source";
|
|
7
|
+
const getLanguages = (config) => {
|
|
8
|
+
const defaultLanguage = config.defaultLanguage ?? "en";
|
|
9
|
+
const languages = Object.keys(config.translations ?? {});
|
|
10
|
+
return {
|
|
11
|
+
defaultLanguage,
|
|
12
|
+
languages: Array.from(new Set([defaultLanguage, ...languages])),
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
const resolveSources = (source, sources) => {
|
|
16
|
+
const resolvedSources = sources ?? (source ? [source] : []);
|
|
17
|
+
if (resolvedSources.length === 0) {
|
|
18
|
+
throw new Error("createSearchRoute requires source or sources.");
|
|
19
|
+
}
|
|
20
|
+
return resolvedSources;
|
|
21
|
+
};
|
|
22
|
+
const getPages = (source, locale) => isGeistdocsSourceBundle(source)
|
|
23
|
+
? source.source.getPages(locale)
|
|
24
|
+
: source.getPages(locale);
|
|
25
|
+
export const createSearchRoute = ({ config, source, sources, }) => {
|
|
5
26
|
const translations = config.translations ?? {};
|
|
27
|
+
const routeSources = resolveSources(source, sources);
|
|
28
|
+
const { defaultLanguage, languages } = getLanguages(config);
|
|
29
|
+
const i18n = defineI18n({
|
|
30
|
+
defaultLanguage,
|
|
31
|
+
languages,
|
|
32
|
+
hideLocale: "default-locale",
|
|
33
|
+
});
|
|
6
34
|
const localeMap = Object.fromEntries(Object.entries(translations).map(([locale, translation]) => [
|
|
7
35
|
locale,
|
|
8
|
-
|
|
36
|
+
translation.displayName.toLowerCase(),
|
|
9
37
|
]));
|
|
10
38
|
if ("cn" in translations) {
|
|
11
39
|
localeMap.cn = {
|
|
@@ -29,5 +57,25 @@ export const createSearchRoute = ({ config, source, }) => {
|
|
|
29
57
|
},
|
|
30
58
|
};
|
|
31
59
|
}
|
|
32
|
-
|
|
60
|
+
const getIndexes = () => languages.flatMap((locale) => routeSources.flatMap((source) => getPages(source, locale)
|
|
61
|
+
.filter((page) => isPageVisibleForSurface(page, "search"))
|
|
62
|
+
.map((page) => {
|
|
63
|
+
const data = page.data;
|
|
64
|
+
return {
|
|
65
|
+
id: page.url,
|
|
66
|
+
title: data.title ?? page.url,
|
|
67
|
+
description: data.description ?? "",
|
|
68
|
+
locale,
|
|
69
|
+
structuredData: data.structuredData ?? {
|
|
70
|
+
contents: [],
|
|
71
|
+
headings: [],
|
|
72
|
+
},
|
|
73
|
+
url: page.url,
|
|
74
|
+
};
|
|
75
|
+
})));
|
|
76
|
+
return createI18nSearchAPI("advanced", {
|
|
77
|
+
i18n,
|
|
78
|
+
indexes: getIndexes,
|
|
79
|
+
localeMap,
|
|
80
|
+
}).GET;
|
|
33
81
|
};
|
package/dist/routes/sitemap.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { NextRequest } from "next/server";
|
|
2
2
|
import type { GeistdocsConfig } from "../config";
|
|
3
|
+
import { type GeistdocsPageVisibilityData } from "../internal/page-visibility";
|
|
4
|
+
import { type GeistdocsSourceBundle } from "../source";
|
|
3
5
|
interface SitemapPage {
|
|
4
6
|
data: {
|
|
5
7
|
title?: string;
|
|
@@ -9,17 +11,27 @@ interface SitemapPage {
|
|
|
9
11
|
prerequisites?: string[];
|
|
10
12
|
product?: string;
|
|
11
13
|
lastModified?: Date;
|
|
12
|
-
};
|
|
14
|
+
} & GeistdocsPageVisibilityData;
|
|
13
15
|
url: string;
|
|
14
16
|
}
|
|
15
17
|
interface SitemapSource {
|
|
16
18
|
getPages(lang: string): SitemapPage[];
|
|
17
19
|
}
|
|
20
|
+
type SitemapSourceInput = GeistdocsSourceBundle | SitemapSource;
|
|
21
|
+
interface SitemapSection {
|
|
22
|
+
source: SitemapSourceInput;
|
|
23
|
+
title?: string;
|
|
24
|
+
}
|
|
18
25
|
interface CreateSitemapMarkdownRouteOptions {
|
|
19
26
|
config: Pick<GeistdocsConfig, "defaultLanguage" | "translations">;
|
|
20
|
-
source
|
|
27
|
+
source?: SitemapSourceInput;
|
|
28
|
+
sources?: SitemapSection[];
|
|
29
|
+
title?: string;
|
|
30
|
+
transform?: (markdown: string, context: {
|
|
31
|
+
lang: string;
|
|
32
|
+
}) => Promise<string> | string;
|
|
21
33
|
}
|
|
22
|
-
export declare const createSitemapMarkdownRoute: ({ config, source, }: CreateSitemapMarkdownRouteOptions) => {
|
|
34
|
+
export declare const createSitemapMarkdownRoute: ({ config, source, sources, title, transform, }: CreateSitemapMarkdownRouteOptions) => {
|
|
23
35
|
GET: (_req: NextRequest, { params }: {
|
|
24
36
|
params: Promise<{
|
|
25
37
|
lang: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sitemap.d.ts","sourceRoot":"","sources":["../../src/routes/sitemap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"sitemap.d.ts","sourceRoot":"","sources":["../../src/routes/sitemap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,qBAAqB,EAA2B,MAAM,WAAW,CAAC;AAKhF,UAAU,WAAW;IACnB,IAAI,EAAE;QACJ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;QACzB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,YAAY,CAAC,EAAE,IAAI,CAAC;KACrB,GAAG,2BAA2B,CAAC;IAChC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,UAAU,aAAa;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE,CAAC;CACvC;AAED,KAAK,kBAAkB,GAAG,qBAAqB,GAAG,aAAa,CAAC;AAEhE,UAAU,cAAc;IACtB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,iCAAiC;IACzC,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,iBAAiB,GAAG,cAAc,CAAC,CAAC;IAClE,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,CACV,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KACtB,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;CAC/B;AA+KD,eAAO,MAAM,0BAA0B,GAAI,gDAMxC,iCAAiC;gBAK1B,WAAW,cACL;QAAE,MAAM,EAAE,OAAO,CAAC;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE;;;;;;CA0DpD,CAAC"}
|
package/dist/routes/sitemap.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { isPageVisibleForSurface, } from "../internal/page-visibility";
|
|
2
|
+
import { isGeistdocsSourceBundle } from "../source";
|
|
1
3
|
const DOCS_PREFIX_PATTERN = /^\/docs\/?/;
|
|
2
4
|
const WHITESPACE_PATTERN = /\s+/;
|
|
3
5
|
const getLanguages = (config) => {
|
|
@@ -111,13 +113,24 @@ function renderNode(node, indent, parentTitle) {
|
|
|
111
113
|
}
|
|
112
114
|
return lines.join("\n");
|
|
113
115
|
}
|
|
114
|
-
|
|
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, }) => {
|
|
115
129
|
const languages = getLanguages(config);
|
|
130
|
+
const sections = resolveSitemapSections(source, sources);
|
|
116
131
|
const GET = async (_req, { params }) => {
|
|
117
132
|
const { lang } = await params;
|
|
118
|
-
const
|
|
119
|
-
const tree = buildTree(pages);
|
|
120
|
-
const header = `# Documentation Sitemap
|
|
133
|
+
const header = `# ${title}
|
|
121
134
|
|
|
122
135
|
## Purpose
|
|
123
136
|
|
|
@@ -133,8 +146,21 @@ It is not intended to replace individual docs.
|
|
|
133
146
|
---
|
|
134
147
|
|
|
135
148
|
`;
|
|
136
|
-
const body =
|
|
137
|
-
|
|
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, {
|
|
138
164
|
headers: {
|
|
139
165
|
"Content-Type": "text/markdown",
|
|
140
166
|
},
|
|
@@ -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"}
|