@vercel/geistdocs 1.2.2 → 1.2.3-canary.a12a9c6
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 +13 -0
- package/dist/assets/logos/index.d.ts.map +1 -0
- package/dist/assets/logos/index.js +13 -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-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-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 +71 -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/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/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/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/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 +160 -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/provider-client.d.ts +9 -0
- package/dist/internal/provider-client.d.ts.map +1 -0
- package/dist/internal/provider-client.js +23 -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/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 +36 -0
- package/dist/mdx.d.ts.map +1 -0
- package/dist/mdx.js +80 -0
- package/dist/pages/docs.d.ts +77 -0
- package/dist/pages/docs.d.ts.map +1 -0
- package/dist/pages/docs.js +92 -0
- package/dist/proxy.d.ts +37 -0
- package/dist/proxy.d.ts.map +1 -0
- package/dist/proxy.js +162 -0
- package/dist/routes/chat.d.ts +14 -0
- package/dist/routes/chat.d.ts.map +1 -0
- package/dist/routes/chat.js +242 -0
- package/dist/routes/llms.d.ts +51 -0
- package/dist/routes/llms.d.ts.map +1 -0
- package/dist/routes/llms.js +59 -0
- package/dist/routes/search.d.ts +11 -0
- package/dist/routes/search.d.ts.map +1 -0
- package/dist/routes/search.js +74 -0
- package/dist/routes/sitemap.d.ts +44 -0
- package/dist/routes/sitemap.d.ts.map +1 -0
- package/dist/routes/sitemap.js +168 -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.d.ts +174 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +129 -0
- package/dist/versions.d.ts +15 -0
- package/dist/versions.d.ts.map +1 -0
- package/dist/versions.js +52 -0
- package/package.json +161 -9
- package/styles.css +556 -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 +14 -0
- package/template/app/[lang]/(home)/page.tsx +126 -0
- package/template/app/[lang]/docs/[[...slug]]/page.tsx +19 -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/actions/feedback/emotions.ts +18 -0
- package/template/app/actions/feedback/index.ts +45 -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/chat.tsx +24 -0
- package/template/components/geistdocs/desktop-menu.tsx +52 -0
- package/template/components/geistdocs/docs-layout.tsx +20 -0
- package/template/components/geistdocs/feedback.tsx +139 -0
- package/template/components/geistdocs/footer.tsx +30 -0
- package/template/components/geistdocs/github-button.tsx +19 -0
- package/template/components/geistdocs/home-layout.tsx +46 -0
- package/template/components/geistdocs/language-selector.tsx +3 -0
- package/template/components/geistdocs/mdx-components.tsx +5 -0
- package/template/components/geistdocs/mobile-docs-bar.tsx +77 -0
- package/template/components/geistdocs/mobile-menu.tsx +150 -0
- package/template/components/geistdocs/navbar-logo.tsx +124 -0
- package/template/components/geistdocs/navbar.tsx +22 -0
- package/template/components/geistdocs/provider.tsx +31 -0
- package/template/components/geistdocs/rss-button.tsx +10 -0
- package/template/components/geistdocs/search.tsx +17 -0
- package/template/components/geistdocs/sidebar.tsx +128 -0
- package/template/components/geistdocs/theme-aware-image.tsx +22 -0
- package/template/components/geistdocs/theme-toggle.tsx +3 -0
- package/template/components/ui/badge.tsx +46 -0
- package/template/components/ui/button.tsx +60 -0
- package/template/components/ui/card.tsx +92 -0
- package/template/components/ui/command-prompt.tsx +488 -0
- package/template/components/ui/dialog.tsx +143 -0
- package/template/components/ui/input-group.tsx +170 -0
- package/template/components/ui/input.tsx +21 -0
- package/template/components/ui/navigation-menu.tsx +192 -0
- package/template/components/ui/popover.tsx +48 -0
- package/template/components/ui/separator.tsx +28 -0
- package/template/components/ui/sheet.tsx +139 -0
- package/template/components/ui/textarea.tsx +18 -0
- package/template/components.json +22 -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 +200 -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 +107 -0
- package/template/content/docs/index.cn.mdx +57 -0
- package/template/content/docs/index.mdx +92 -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 +85 -0
- package/template/content/docs/md.cn.mdx +65 -0
- package/template/content/docs/md.mdx +81 -0
- package/template/content/docs/meta.json +23 -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 +124 -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 +181 -0
- package/template/geistdocs.tsx +51 -0
- package/template/hooks/geistdocs/use-sidebar.ts +13 -0
- package/template/hooks/use-mobile.ts +19 -0
- package/template/lib/geistdocs/config.tsx +27 -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 +18 -0
- package/template/source.config.ts +179 -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,411 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Syntax
|
|
3
|
+
description: Learn about the supported markdown syntax and formatting options
|
|
4
|
+
type: reference
|
|
5
|
+
summary: Supported MDX syntax including text formatting, code blocks, line highlighting, and Mermaid diagrams.
|
|
6
|
+
prerequisites:
|
|
7
|
+
- /docs/getting-started
|
|
8
|
+
related:
|
|
9
|
+
- /docs/configuration
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Geistdocs supports MDX, a superset of Markdown that allows you to use JSX components within your documentation. This guide covers all the formatting options available.
|
|
13
|
+
|
|
14
|
+
<CopyPrompt text="Help me write a Geistdocs MDX page. Use this page as a syntax reference and create an example page with frontmatter, headings, links, a code block, a Callout, and a CopyPrompt component.">
|
|
15
|
+
Help me write a Geistdocs MDX page. Use this page as a syntax reference and create an example page with frontmatter, headings, links, a code block, a `Callout`, and a `CopyPrompt` component.
|
|
16
|
+
</CopyPrompt>
|
|
17
|
+
|
|
18
|
+
## Frontmatter
|
|
19
|
+
|
|
20
|
+
Every MDX file should include frontmatter at the top:
|
|
21
|
+
|
|
22
|
+
```yaml
|
|
23
|
+
---
|
|
24
|
+
title: Page Title
|
|
25
|
+
description: A brief description of the page content
|
|
26
|
+
---
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The `title` property is required and is used for the page heading and navigation. The `description` is used for SEO and page previews.
|
|
30
|
+
|
|
31
|
+
## Basic Markdown
|
|
32
|
+
|
|
33
|
+
### Text Formatting
|
|
34
|
+
|
|
35
|
+
You can style text using standard Markdown syntax:
|
|
36
|
+
|
|
37
|
+
- **Bold text** with `**double asterisks**`
|
|
38
|
+
- _Italic text_ with `*single asterisks*`
|
|
39
|
+
- ~~Strikethrough~~ with `~~double tildes~~`
|
|
40
|
+
- `Inline code` with `` `backticks` ``
|
|
41
|
+
|
|
42
|
+
### Headings
|
|
43
|
+
|
|
44
|
+
Use `#` symbols to create headings:
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
# Heading 1
|
|
48
|
+
|
|
49
|
+
## Heading 2
|
|
50
|
+
|
|
51
|
+
### Heading 3
|
|
52
|
+
|
|
53
|
+
#### Heading 4
|
|
54
|
+
|
|
55
|
+
##### Heading 5
|
|
56
|
+
|
|
57
|
+
###### Heading 6
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Headings automatically generate anchor links for navigation and deep linking.
|
|
61
|
+
|
|
62
|
+
### Lists
|
|
63
|
+
|
|
64
|
+
Create unordered lists with `-`, `*`, or `+`:
|
|
65
|
+
|
|
66
|
+
- First item
|
|
67
|
+
- Second item
|
|
68
|
+
- Nested item
|
|
69
|
+
- Another nested item
|
|
70
|
+
- Third item
|
|
71
|
+
|
|
72
|
+
Create ordered lists with numbers:
|
|
73
|
+
|
|
74
|
+
1. First step
|
|
75
|
+
2. Second step
|
|
76
|
+
3. Third step
|
|
77
|
+
|
|
78
|
+
### Blockquotes
|
|
79
|
+
|
|
80
|
+
Use `>` to create blockquotes:
|
|
81
|
+
|
|
82
|
+
> This is a blockquote. You can use it to highlight important information or quotes from external sources.
|
|
83
|
+
|
|
84
|
+
### Links
|
|
85
|
+
|
|
86
|
+
Create links with `[text](url)`:
|
|
87
|
+
|
|
88
|
+
- [External link](https://vercel.com)
|
|
89
|
+
- [Internal link](/docs/getting-started)
|
|
90
|
+
|
|
91
|
+
### Images
|
|
92
|
+
|
|
93
|
+
Add images with ``:
|
|
94
|
+
|
|
95
|
+
```md
|
|
96
|
+

|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## GitHub Flavored Markdown
|
|
100
|
+
|
|
101
|
+
Geistdocs supports GFM extensions including tables, task lists, and autolinks.
|
|
102
|
+
|
|
103
|
+
### Tables
|
|
104
|
+
|
|
105
|
+
Create tables using pipes and dashes:
|
|
106
|
+
|
|
107
|
+
```md
|
|
108
|
+
| Feature | Description | Status |
|
|
109
|
+
| -------- | ----------------- | --------- |
|
|
110
|
+
| Markdown | Basic formatting | Supported |
|
|
111
|
+
| GFM | GitHub extensions | Supported |
|
|
112
|
+
| MDX | JSX in Markdown | Supported |
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
This renders as:
|
|
116
|
+
|
|
117
|
+
| Feature | Description | Status |
|
|
118
|
+
| -------- | ----------------- | --------- |
|
|
119
|
+
| Markdown | Basic formatting | Supported |
|
|
120
|
+
| GFM | GitHub extensions | Supported |
|
|
121
|
+
| MDX | JSX in Markdown | Supported |
|
|
122
|
+
|
|
123
|
+
### Task Lists
|
|
124
|
+
|
|
125
|
+
Create interactive task lists:
|
|
126
|
+
|
|
127
|
+
```md
|
|
128
|
+
- [x] Completed task
|
|
129
|
+
- [ ] Incomplete task
|
|
130
|
+
- [ ] Another task to do
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
This renders as:
|
|
134
|
+
|
|
135
|
+
- [x] Completed task
|
|
136
|
+
- [ ] Incomplete task
|
|
137
|
+
- [ ] Another task to do
|
|
138
|
+
|
|
139
|
+
### Autolinks
|
|
140
|
+
|
|
141
|
+
URLs are automatically converted to clickable links:
|
|
142
|
+
|
|
143
|
+
```md
|
|
144
|
+
https://vercel.com
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
This renders as:
|
|
148
|
+
|
|
149
|
+
https://vercel.com
|
|
150
|
+
|
|
151
|
+
## Code Blocks
|
|
152
|
+
|
|
153
|
+
Fenced code blocks support syntax highlighting for many languages.
|
|
154
|
+
|
|
155
|
+
### Basic Syntax Highlighting
|
|
156
|
+
|
|
157
|
+
Specify the language after the opening backticks:
|
|
158
|
+
|
|
159
|
+
````md
|
|
160
|
+
```typescript
|
|
161
|
+
const greet = (name: string): string => {
|
|
162
|
+
return `Hello, ${name}!`;
|
|
163
|
+
};
|
|
164
|
+
```
|
|
165
|
+
````
|
|
166
|
+
|
|
167
|
+
This renders as:
|
|
168
|
+
|
|
169
|
+
```typescript
|
|
170
|
+
const greet = (name: string): string => {
|
|
171
|
+
return `Hello, ${name}!`;
|
|
172
|
+
};
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Titles
|
|
176
|
+
|
|
177
|
+
Add a title to your code block with the `title` attribute:
|
|
178
|
+
|
|
179
|
+
````md
|
|
180
|
+
```tsx title="components/button.tsx"
|
|
181
|
+
export const Button = ({ children }) => {
|
|
182
|
+
return <button type="button">{children}</button>;
|
|
183
|
+
};
|
|
184
|
+
```
|
|
185
|
+
````
|
|
186
|
+
|
|
187
|
+
This renders as:
|
|
188
|
+
|
|
189
|
+
```tsx title="components/button.tsx"
|
|
190
|
+
export const Button = ({ children }) => {
|
|
191
|
+
return <button type="button">{children}</button>;
|
|
192
|
+
};
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Line Numbers
|
|
196
|
+
|
|
197
|
+
Display line numbers by adding the `lineNumbers` attribute:
|
|
198
|
+
|
|
199
|
+
````md
|
|
200
|
+
```typescript lineNumbers
|
|
201
|
+
const numbers = [1, 2, 3, 4, 5];
|
|
202
|
+
const doubled = numbers.map((n) => n * 2);
|
|
203
|
+
console.log(doubled);
|
|
204
|
+
```
|
|
205
|
+
````
|
|
206
|
+
|
|
207
|
+
This renders as:
|
|
208
|
+
|
|
209
|
+
```typescript lineNumbers
|
|
210
|
+
const numbers = [1, 2, 3, 4, 5];
|
|
211
|
+
const doubled = numbers.map((n) => n * 2);
|
|
212
|
+
console.log(doubled);
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Line Highlighting
|
|
216
|
+
|
|
217
|
+
Highlight specific lines using the `[!code highlight]` comment:
|
|
218
|
+
|
|
219
|
+
````md
|
|
220
|
+
```typescript
|
|
221
|
+
const config = {
|
|
222
|
+
theme: "dark", // [ !code highlight]
|
|
223
|
+
language: "en",
|
|
224
|
+
};
|
|
225
|
+
```
|
|
226
|
+
````
|
|
227
|
+
|
|
228
|
+
Remove the space before `!` when using this syntax. This renders as:
|
|
229
|
+
|
|
230
|
+
```typescript
|
|
231
|
+
const config = {
|
|
232
|
+
theme: "dark", // [!code highlight]
|
|
233
|
+
language: "en",
|
|
234
|
+
};
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Word Highlighting
|
|
238
|
+
|
|
239
|
+
Highlight specific words with `[!code word:term]`:
|
|
240
|
+
|
|
241
|
+
````md
|
|
242
|
+
```typescript
|
|
243
|
+
// [ !code word:config]
|
|
244
|
+
const config = {
|
|
245
|
+
theme: "dark",
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
console.log(config);
|
|
249
|
+
```
|
|
250
|
+
````
|
|
251
|
+
|
|
252
|
+
Remove the space before `!` when using this syntax. This renders as:
|
|
253
|
+
|
|
254
|
+
```typescript
|
|
255
|
+
// [!code word:config]
|
|
256
|
+
const config = {
|
|
257
|
+
theme: "dark",
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
console.log(config);
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### Diff Syntax
|
|
264
|
+
|
|
265
|
+
Show additions and deletions with `[!code ++]` and `[!code --]`:
|
|
266
|
+
|
|
267
|
+
````md
|
|
268
|
+
```typescript
|
|
269
|
+
const config = {
|
|
270
|
+
theme: "light", // [ !code --]
|
|
271
|
+
theme: "dark", // [ !code ++]
|
|
272
|
+
language: "en",
|
|
273
|
+
};
|
|
274
|
+
```
|
|
275
|
+
````
|
|
276
|
+
|
|
277
|
+
Remove the space before `!` when using this syntax. This renders as:
|
|
278
|
+
|
|
279
|
+
```typescript
|
|
280
|
+
const config = {
|
|
281
|
+
theme: "light", // [!code --]
|
|
282
|
+
theme: "dark", // [!code ++]
|
|
283
|
+
language: "en",
|
|
284
|
+
};
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### Focus Lines
|
|
288
|
+
|
|
289
|
+
Draw attention to specific lines with `[!code focus]`:
|
|
290
|
+
|
|
291
|
+
````md
|
|
292
|
+
```typescript
|
|
293
|
+
const numbers = [1, 2, 3, 4, 5];
|
|
294
|
+
const sum = numbers.reduce((a, b) => a + b, 0); // [ !code focus]
|
|
295
|
+
console.log(sum);
|
|
296
|
+
```
|
|
297
|
+
````
|
|
298
|
+
|
|
299
|
+
Remove the space before `!` when using this syntax. This renders as:
|
|
300
|
+
|
|
301
|
+
```typescript
|
|
302
|
+
const numbers = [1, 2, 3, 4, 5];
|
|
303
|
+
const sum = numbers.reduce((a, b) => a + b, 0); // [!code focus]
|
|
304
|
+
console.log(sum);
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
## Mermaid Diagrams
|
|
308
|
+
|
|
309
|
+
Create diagrams and flowcharts using Mermaid syntax.
|
|
310
|
+
|
|
311
|
+
### Flowcharts
|
|
312
|
+
|
|
313
|
+
````md
|
|
314
|
+
```mermaid
|
|
315
|
+
graph TD;
|
|
316
|
+
A[Start] --> B{Is it working?};
|
|
317
|
+
B -->|Yes| C[Great!];
|
|
318
|
+
B -->|No| D[Debug];
|
|
319
|
+
D --> B;
|
|
320
|
+
```
|
|
321
|
+
````
|
|
322
|
+
|
|
323
|
+
This renders as:
|
|
324
|
+
|
|
325
|
+
```mermaid
|
|
326
|
+
graph TD;
|
|
327
|
+
A[Start] --> B{Is it working?};
|
|
328
|
+
B -->|Yes| C[Great!];
|
|
329
|
+
B -->|No| D[Debug];
|
|
330
|
+
D --> B;
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
### Sequence Diagrams
|
|
334
|
+
|
|
335
|
+
````md
|
|
336
|
+
```mermaid
|
|
337
|
+
sequenceDiagram
|
|
338
|
+
participant User
|
|
339
|
+
participant API
|
|
340
|
+
participant Database
|
|
341
|
+
User->>API: Request data
|
|
342
|
+
API->>Database: Query
|
|
343
|
+
Database-->>API: Results
|
|
344
|
+
API-->>User: Response
|
|
345
|
+
```
|
|
346
|
+
````
|
|
347
|
+
|
|
348
|
+
This renders as:
|
|
349
|
+
|
|
350
|
+
```mermaid
|
|
351
|
+
sequenceDiagram
|
|
352
|
+
participant User
|
|
353
|
+
participant API
|
|
354
|
+
participant Database
|
|
355
|
+
User->>API: Request data
|
|
356
|
+
API->>Database: Query
|
|
357
|
+
Database-->>API: Results
|
|
358
|
+
API-->>User: Response
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
### Architecture Diagrams
|
|
362
|
+
|
|
363
|
+
````md
|
|
364
|
+
```mermaid
|
|
365
|
+
graph TD;
|
|
366
|
+
subgraph Frontend
|
|
367
|
+
A[Web App]
|
|
368
|
+
B[Mobile App]
|
|
369
|
+
end
|
|
370
|
+
subgraph Backend
|
|
371
|
+
C[API Gateway]
|
|
372
|
+
D[Auth Service]
|
|
373
|
+
E[Data Service]
|
|
374
|
+
end
|
|
375
|
+
subgraph Storage
|
|
376
|
+
F[(Database)]
|
|
377
|
+
G[(Cache)]
|
|
378
|
+
end
|
|
379
|
+
A --> C
|
|
380
|
+
B --> C
|
|
381
|
+
C --> D
|
|
382
|
+
C --> E
|
|
383
|
+
E --> F
|
|
384
|
+
E --> G
|
|
385
|
+
```
|
|
386
|
+
````
|
|
387
|
+
|
|
388
|
+
This renders as:
|
|
389
|
+
|
|
390
|
+
```mermaid
|
|
391
|
+
graph TD;
|
|
392
|
+
subgraph Frontend
|
|
393
|
+
A[Web App]
|
|
394
|
+
B[Mobile App]
|
|
395
|
+
end
|
|
396
|
+
subgraph Backend
|
|
397
|
+
C[API Gateway]
|
|
398
|
+
D[Auth Service]
|
|
399
|
+
E[Data Service]
|
|
400
|
+
end
|
|
401
|
+
subgraph Storage
|
|
402
|
+
F[(Database)]
|
|
403
|
+
G[(Cache)]
|
|
404
|
+
end
|
|
405
|
+
A --> C
|
|
406
|
+
B --> C
|
|
407
|
+
C --> D
|
|
408
|
+
C --> E
|
|
409
|
+
E --> F
|
|
410
|
+
E --> G
|
|
411
|
+
```
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Theme-Aware Image
|
|
3
|
+
description: Display different images based on the user's light or dark theme preference
|
|
4
|
+
type: reference
|
|
5
|
+
summary: A component that swaps images based on the active theme, built on top of Next.js Image.
|
|
6
|
+
prerequisites:
|
|
7
|
+
- /docs/getting-started
|
|
8
|
+
- /docs/provider
|
|
9
|
+
related:
|
|
10
|
+
- /docs/syntax
|
|
11
|
+
- /docs/configuration
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
The `ThemeAwareImage` component renders different images depending on whether the user is viewing your documentation in light or dark mode. It extends the Next.js `Image` component, so you get all the same optimization benefits like lazy loading, responsive sizing, and format conversion.
|
|
15
|
+
|
|
16
|
+
<CopyPrompt text="Help me add a theme-aware image to a Geistdocs MDX page. Create a usage example with light and dark image sources, alt text, width, and height, then explain where to place the image files.">
|
|
17
|
+
Help me add a theme-aware image to a Geistdocs MDX page. Create a usage example with light and dark image sources, alt text, width, and height, then explain where to place the image files.
|
|
18
|
+
</CopyPrompt>
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
Import the component and pass a `src` object with `light` and `dark` variants:
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { ThemeAwareImage } from "@/components/geistdocs/theme-aware-image";
|
|
26
|
+
|
|
27
|
+
<ThemeAwareImage
|
|
28
|
+
src={{
|
|
29
|
+
light: "/images/diagram-light.png",
|
|
30
|
+
dark: "/images/diagram-dark.png",
|
|
31
|
+
}}
|
|
32
|
+
alt="Architecture diagram"
|
|
33
|
+
width={800}
|
|
34
|
+
height={400}
|
|
35
|
+
/>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The component reads the current theme from `next-themes` and resolves the correct image source automatically. All standard Next.js `Image` props (such as `width`, `height`, `alt`, `priority`, and `className`) are supported.
|
|
39
|
+
|
|
40
|
+
## How it works
|
|
41
|
+
|
|
42
|
+
`ThemeAwareImage` uses the `resolvedTheme` value from the `useTheme` hook provided by `next-themes`. This ensures it responds to the actual rendered theme, even when the user's preference is set to "system".
|
|
43
|
+
|
|
44
|
+
- When `resolvedTheme` is `"dark"`, the `src.dark` image is displayed.
|
|
45
|
+
- Otherwise, the `src.light` image is used.
|
|
46
|
+
|
|
47
|
+
Because this component relies on client-side theme detection, it is a client component (`"use client"`).
|
|
48
|
+
|
|
49
|
+
## Props
|
|
50
|
+
|
|
51
|
+
| Prop | Type | Description |
|
|
52
|
+
| --- | --- | --- |
|
|
53
|
+
| `src` | `{ light: ImageProps["src"]; dark: ImageProps["src"] }` | An object containing the light and dark image sources |
|
|
54
|
+
| `alt` | `string` | Accessible alt text for the image |
|
|
55
|
+
| `width` | `number` | The width of the image in pixels |
|
|
56
|
+
| `height` | `number` | The height of the image in pixels |
|
|
57
|
+
| `...rest` | `ImageProps` | Any additional props supported by the Next.js `Image` component |
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 版本化文档
|
|
3
|
+
description: 使用包提供的 source helper 配置多个文档版本
|
|
4
|
+
type: guide
|
|
5
|
+
summary: 使用 createVersionedSources 配置稳定版、预发布版或基于域名的文档版本。
|
|
6
|
+
prerequisites:
|
|
7
|
+
- /docs/configuration
|
|
8
|
+
related:
|
|
9
|
+
- /docs/proxy
|
|
10
|
+
- /docs/llms-txt
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
版本化文档让一个 Geistdocs 项目服务多个文档集合。可用于稳定版、预发布版、旧主版本,或基于域名的版本切换。
|
|
14
|
+
|
|
15
|
+
## 配置 source collection
|
|
16
|
+
|
|
17
|
+
在 `source.config.ts` 中为每个版本创建一个 Fumadocs collection:
|
|
18
|
+
|
|
19
|
+
```ts title="source.config.ts"
|
|
20
|
+
import { defineConfig, defineDocs } from "fumadocs-mdx/config";
|
|
21
|
+
|
|
22
|
+
export const v4docs = defineDocs({
|
|
23
|
+
dir: "content/docs/v4",
|
|
24
|
+
docs: {
|
|
25
|
+
postprocess: {
|
|
26
|
+
includeProcessedMarkdown: true,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export const v5docs = defineDocs({
|
|
32
|
+
dir: "content/docs/v5",
|
|
33
|
+
docs: {
|
|
34
|
+
postprocess: {
|
|
35
|
+
includeProcessedMarkdown: true,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export default defineConfig({});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## 创建版本化 sources
|
|
44
|
+
|
|
45
|
+
在 `lib/geistdocs/source.ts` 中使用 `createVersionedSources`:
|
|
46
|
+
|
|
47
|
+
```ts title="lib/geistdocs/source.ts"
|
|
48
|
+
import { createVersionedSources } from "@vercel/geistdocs/source";
|
|
49
|
+
import { v4docs, v5docs } from "@/.source/server";
|
|
50
|
+
import { config } from "./config";
|
|
51
|
+
|
|
52
|
+
export const versions = createVersionedSources({
|
|
53
|
+
config,
|
|
54
|
+
current: "v4",
|
|
55
|
+
versions: [
|
|
56
|
+
{ id: "v4", label: "v4", docs: v4docs, baseUrl: "/docs" },
|
|
57
|
+
{
|
|
58
|
+
id: "v5",
|
|
59
|
+
label: "v5 pre-release",
|
|
60
|
+
docs: v5docs,
|
|
61
|
+
baseUrl: "/docs",
|
|
62
|
+
routePrefix: "/v5",
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
});
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## 渲染版本化页面
|
|
69
|
+
|
|
70
|
+
当前版本可以用于 `/docs`,特定版本可以用于带版本前缀的路由:
|
|
71
|
+
|
|
72
|
+
```tsx title="app/[lang]/v5/docs/[[...slug]]/page.tsx"
|
|
73
|
+
import { createDocsPage } from "@vercel/geistdocs/pages/docs";
|
|
74
|
+
import { config } from "@/lib/geistdocs/config";
|
|
75
|
+
import { versions } from "@/lib/geistdocs/source";
|
|
76
|
+
|
|
77
|
+
const docsPage = createDocsPage({
|
|
78
|
+
config,
|
|
79
|
+
source: versions.byId.v5,
|
|
80
|
+
getPageUrl: ({ page }) => `/v5${page.url}`,
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
当公开 URL 和 source 的 `baseUrl` 不一致时,使用 `getPageUrl` 保持页面操作和 Markdown 链接指向公开 URL。
|
|
85
|
+
|
|
86
|
+
## 添加版本选择器
|
|
87
|
+
|
|
88
|
+
在本地布局适配器中使用 `GeistdocsVersionSelect`:
|
|
89
|
+
|
|
90
|
+
```tsx title="components/geistdocs/docs-layout.tsx"
|
|
91
|
+
import { GeistdocsVersionSelect } from "@vercel/geistdocs/versions";
|
|
92
|
+
|
|
93
|
+
<GeistdocsVersionSelect
|
|
94
|
+
current="v4"
|
|
95
|
+
versions={[
|
|
96
|
+
{ id: "v4", label: "v4" },
|
|
97
|
+
{ id: "v5", label: "v5 pre-release", routePrefix: "/v5" },
|
|
98
|
+
]}
|
|
99
|
+
/>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
对于基于域名的版本,使用 `href`:
|
|
103
|
+
|
|
104
|
+
```tsx
|
|
105
|
+
<GeistdocsVersionSelect
|
|
106
|
+
current="v6"
|
|
107
|
+
versions={[
|
|
108
|
+
{ id: "v6", label: "v6 latest" },
|
|
109
|
+
{ id: "v5", label: "v5", href: "https://v5.example.com/:path*" },
|
|
110
|
+
]}
|
|
111
|
+
/>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## 下一步
|
|
115
|
+
|
|
116
|
+
- 阅读 [Proxy 和 Markdown 路由](/docs/proxy),将版本化页面连接到 `.md`、`.mdx` 和 AI agent 重写。
|
|
117
|
+
- 阅读 [llms.txt](/docs/llms-txt),为多个 source 配置完整文档的 Markdown 输出。
|