@vercel/geistdocs 1.3.0-canary.41d37f1 → 1.3.0-canary.5af98bc

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.
Files changed (51) hide show
  1. package/dist/cli/index.js +2 -2
  2. package/dist/components/code-block.d.ts.map +1 -1
  3. package/dist/components/code-block.js +5 -1
  4. package/dist/components/copy-prompt.d.ts +11 -0
  5. package/dist/components/copy-prompt.d.ts.map +1 -0
  6. package/dist/components/copy-prompt.js +58 -0
  7. package/dist/internal/page-actions-client.d.ts +1 -2
  8. package/dist/internal/page-actions-client.d.ts.map +1 -1
  9. package/dist/internal/page-actions-client.js +12 -6
  10. package/dist/internal/provider-client.d.ts +9 -0
  11. package/dist/internal/provider-client.d.ts.map +1 -0
  12. package/dist/internal/provider-client.js +23 -0
  13. package/dist/internal/sidebar.d.ts.map +1 -1
  14. package/dist/internal/sidebar.js +4 -3
  15. package/dist/internal/table-of-contents.d.ts +9 -0
  16. package/dist/internal/table-of-contents.d.ts.map +1 -0
  17. package/dist/internal/table-of-contents.js +5 -0
  18. package/dist/layout.d.ts +2 -7
  19. package/dist/layout.d.ts.map +1 -1
  20. package/dist/layout.js +25 -43
  21. package/dist/mdx.d.ts.map +1 -1
  22. package/dist/mdx.js +2 -0
  23. package/dist/pages/docs.d.ts.map +1 -1
  24. package/dist/pages/docs.js +15 -9
  25. package/dist/sidebar.d.ts +11 -0
  26. package/dist/sidebar.d.ts.map +1 -0
  27. package/dist/sidebar.js +16 -0
  28. package/package.json +9 -1
  29. package/template/_gitignore +28 -0
  30. package/template/app/styles/geistdocs.css +1 -0
  31. package/template/components/geistdocs/mobile-docs-bar.tsx +2 -6
  32. package/template/content/docs/ask-ai.mdx +4 -0
  33. package/template/content/docs/configuration.mdx +75 -72
  34. package/template/content/docs/deployment.mdx +6 -0
  35. package/template/content/docs/edit-on-github.mdx +4 -0
  36. package/template/content/docs/env.mdx +4 -0
  37. package/template/content/docs/feedback.mdx +4 -0
  38. package/template/content/docs/getting-started.mdx +64 -43
  39. package/template/content/docs/index.mdx +57 -59
  40. package/template/content/docs/internationalization.cn.mdx +7 -9
  41. package/template/content/docs/internationalization.mdx +9 -4
  42. package/template/content/docs/llms-txt.mdx +4 -0
  43. package/template/content/docs/md.mdx +4 -0
  44. package/template/content/docs/meta.json +2 -2
  45. package/template/content/docs/open-in-chat.mdx +4 -0
  46. package/template/content/docs/provider.mdx +4 -0
  47. package/template/content/docs/rss.mdx +4 -0
  48. package/template/content/docs/syntax.cn.mdx +2 -2
  49. package/template/content/docs/syntax.mdx +5 -1
  50. package/template/content/docs/theme-aware-image.mdx +4 -0
  51. package/template/package.json +1 -1
@@ -37,20 +37,18 @@ CLI 会从 `geistdocs.tsx` 中读取目标语言并提示您选择要翻译的
37
37
  您可以直接传递选项以跳过交互式提示:
38
38
 
39
39
  ```bash
40
- # Translate a single file
41
- npx @vercel/geistdocs translate --file content/docs/getting-started.mdx
40
+ # Translate files using the default glob pattern
41
+ npx @vercel/geistdocs translate
42
42
 
43
- # Translate multiple files using a glob pattern
44
- npx @vercel/geistdocs translate --pattern "content/docs/**/*.mdx"
43
+ # Translate files matching a specific glob pattern
44
+ npx @vercel/geistdocs translate "content/docs/**/*.mdx"
45
45
 
46
46
  # Use a custom config file
47
- npx @vercel/geistdocs translate --pattern "content/**/*.mdx" --config custom-config.tsx
47
+ npx @vercel/geistdocs translate "content/**/*.mdx" --config custom-config.tsx
48
48
  ```
49
49
 
50
50
  | 选项 | 描述 |
51
51
  | ----------- | ---------------------------------------------------------- |
52
- | `--file` | 要翻译的单个 MDX 文件的路径 |
53
- | `--pattern` | 匹配多个 MDX 文件的 glob 模式 |
54
52
  | `--config` | 含有翻译配置的配置文件路径(默认:`geistdocs.tsx`) |
55
53
  | `--url` | 自定义翻译 API URL |
56
54
 
@@ -82,7 +80,7 @@ export const translations = {
82
80
 
83
81
  1. 在 `translations` 对象中添加带有语言代码的新键
84
82
  2. 为诸如 `displayName` 和 `search` 之类的 UI 元素添加翻译
85
- 3. 运行 `npx @vercel/geistdocs translate --pattern "content/**/*.mdx"` 以生成翻译内容
83
+ 3. 运行 `npx @vercel/geistdocs translate "content/**/*.mdx"` 以生成翻译内容
86
84
 
87
85
  语言选择器将自动包含您添加的新语言。
88
86
 
@@ -110,4 +108,4 @@ Fumadocs 会根据 URL 路径自动提供正确的文件。
110
108
 
111
109
  语言由 URL 路径确定。不根据浏览器设置进行自动检测——用户必须使用语言选择器显式选择他们的语言。
112
110
 
113
- 这种方法为用户提供了完全的控制,并确保他们看到预期的语言。
111
+ 这种方法为用户提供了完全的控制,并确保他们看到预期的语言。
@@ -11,6 +11,10 @@ related:
11
11
 
12
12
  Geistdocs supports internationalization (i18n) out of the box using Fumadocs' language-aware routing. You can serve documentation in multiple languages with automatic translation via the Geistdocs CLI.
13
13
 
14
+ <CopyPrompt text="Help me add a new language to this Geistdocs project. Update translations in geistdocs.tsx, run the Geistdocs translate command for content/docs, and explain how localized routes are generated.">
15
+ Help me add a new language to this Geistdocs project. Update `translations` in `geistdocs.tsx`, run the Geistdocs translate command for `content/docs`, and explain how localized routes are generated.
16
+ </CopyPrompt>
17
+
14
18
  ## How It Works
15
19
 
16
20
  The i18n system uses dynamic routing with a `[lang]` URL segment. The default language (English) doesn't show in URLs, while other languages get a prefix:
@@ -41,10 +45,10 @@ You can pass options directly to customize the translation behavior:
41
45
  pnpm translate
42
46
 
43
47
  # Translate files matching a specific glob pattern
44
- pnpm translate --pattern "content/docs/**/*.mdx"
48
+ pnpm translate "content/docs/**/*.mdx"
45
49
 
46
50
  # Use a custom config file
47
- pnpm translate --pattern "content/**/*.mdx" --config custom-config.tsx
51
+ pnpm translate "content/**/*.mdx" --config custom-config.tsx
48
52
 
49
53
  # Use a custom translation API URL
50
54
  pnpm translate --url "https://custom-api.example.com/translate"
@@ -52,10 +56,11 @@ pnpm translate --url "https://custom-api.example.com/translate"
52
56
 
53
57
  | Option | Description |
54
58
  | ----------- | -------------------------------------------------------- |
55
- | `--pattern` | Glob pattern to match MDX files (default: `content/docs/**/*.mdx`) |
56
59
  | `--config` | Path to config file with translations (default: `geistdocs.tsx`) |
57
60
  | `--url` | Custom translation API URL (can also use `GEISTDOCS_TRANSLATE_URL` env var) |
58
61
 
62
+ Pass the glob pattern as the command argument. If you omit it, Geistdocs uses `content/docs/**/*.mdx`.
63
+
59
64
  The CLI automatically excludes files that already have a locale suffix (e.g., `getting-started.cn.mdx`) to avoid translating already-translated content.
60
65
 
61
66
  ### Batch Processing
@@ -86,7 +91,7 @@ To add a new language:
86
91
 
87
92
  1. Add a new key to the `translations` object with the language code
88
93
  2. Add translations for UI elements like `displayName` and `search`
89
- 3. Run `pnpm translate --pattern "content/**/*.mdx"` to generate translated content
94
+ 3. Run `pnpm translate "content/**/*.mdx"` to generate translated content
90
95
 
91
96
  The language selector will automatically include your new language.
92
97
 
@@ -10,6 +10,10 @@ related:
10
10
 
11
11
  Geistdocs implements the [llms.txt standard](https://llmstxt.org/) - a convention that provides all your documentation content in a single, AI-readable text file. This makes it easy for language models to understand your entire documentation at once.
12
12
 
13
+ <CopyPrompt text="Help me verify this Geistdocs site's AI-readable docs. Check /llms.txt and a few .mdx page URLs, then explain whether an AI assistant can retrieve the full documentation context.">
14
+ Help me verify this Geistdocs site's AI-readable docs. Check `/llms.txt` and a few `.mdx` page URLs, then explain whether an AI assistant can retrieve the full documentation context.
15
+ </CopyPrompt>
16
+
13
17
  ## What It Is
14
18
 
15
19
  The `/llms.txt` endpoint returns all your documentation pages as plain Markdown in a single response. Each page is separated by blank lines, making it easy for AI tools to parse and understand your complete documentation.
@@ -9,6 +9,10 @@ related:
9
9
 
10
10
  Geistdocs includes a built-in feature that allows AI tools and language models to access your documentation as plain Markdown. Simply append `.mdx` to any documentation page URL to get the processed Markdown content.
11
11
 
12
+ <CopyPrompt text="Help me test raw Markdown routes in this Geistdocs project. Fetch a docs page with .mdx appended, compare it to the rendered page, and explain how AI tools can use it.">
13
+ Help me test raw Markdown routes in this Geistdocs project. Fetch a docs page with `.mdx` appended, compare it to the rendered page, and explain how AI tools can use it.
14
+ </CopyPrompt>
15
+
12
16
  ## How It Works
13
17
 
14
18
  When you add `.md` or `.mdx` to any documentation URL, you get back the page content as plain text Markdown instead of the rendered HTML. This makes it easy for AI tools to read and understand your documentation.
@@ -1,6 +1,6 @@
1
1
  {
2
- "title": "Vercel Documentation",
3
- "description": "Vercel Documentation",
2
+ "title": "Geistdocs Documentation",
3
+ "description": "Learn how to use and customize Geistdocs",
4
4
  "root": true,
5
5
  "pages": [
6
6
  "index",
@@ -10,6 +10,10 @@ related:
10
10
 
11
11
  The "Open in Chat" feature enables users to seamlessly transfer documentation context to their preferred AI assistant. With a single click, users can open the current page in external AI chat platforms like ChatGPT, Claude, v0, Cursor, and more.
12
12
 
13
+ <CopyPrompt text="Help me test Open in Chat for this Geistdocs site. Verify that page URLs resolve correctly, markdown endpoints work, and each configured AI platform receives useful context.">
14
+ Help me test Open in Chat for this Geistdocs site. Verify that page URLs resolve correctly, markdown endpoints work, and each configured AI platform receives useful context.
15
+ </CopyPrompt>
16
+
13
17
  ## How It Works
14
18
 
15
19
  On every documentation page, users will find an "Open in chat" button in the table of contents sidebar. When clicked, a menu appears with options to open the page in various AI platforms:
@@ -11,6 +11,10 @@ related:
11
11
 
12
12
  The `GeistdocsProvider` is a wrapper component that sits at the root of your application. It wraps Fumadocs' `RootProvider` and adds Geistdocs-specific functionality to make everything work seamlessly.
13
13
 
14
+ <CopyPrompt text="Review my Geistdocs provider setup. Check that the root layout wraps the app with GeistdocsProvider, that config is passed correctly, and that analytics, search, theme, and Ask AI behavior are wired safely.">
15
+ Review my Geistdocs provider setup. Check that the root layout wraps the app with `GeistdocsProvider`, that config is passed correctly, and that analytics, search, theme, and Ask AI behavior are wired safely.
16
+ </CopyPrompt>
17
+
14
18
  ## What It Does
15
19
 
16
20
  The provider handles these main things for you:
@@ -10,6 +10,10 @@ related:
10
10
 
11
11
  The RSS feature provides an automatically generated RSS 2.0 feed for your documentation. This allows users to subscribe to updates and stay informed when new content is published or existing pages are modified.
12
12
 
13
+ <CopyPrompt text="Help me verify the RSS feed for this Geistdocs site. Check the /rss.xml route, confirm the production URL environment variable is set, and explain how page metadata affects feed items.">
14
+ Help me verify the RSS feed for this Geistdocs site. Check the `/rss.xml` route, confirm the production URL environment variable is set, and explain how page metadata affects feed items.
15
+ </CopyPrompt>
16
+
13
17
  ## How It Works
14
18
 
15
19
  Geistdocs automatically generates an RSS feed that includes:
@@ -39,7 +39,7 @@ description: A brief description of the page content
39
39
 
40
40
  使用 `#` 符号创建标题:
41
41
 
42
- ```md
42
+ ```text
43
43
  # Heading 1
44
44
 
45
45
  ## Heading 2
@@ -413,4 +413,4 @@ graph TD;
413
413
  C --> E
414
414
  E --> F
415
415
  E --> G
416
- ```
416
+ ```
@@ -11,6 +11,10 @@ related:
11
11
 
12
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
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
+
14
18
  ## Frontmatter
15
19
 
16
20
  Every MDX file should include frontmatter at the top:
@@ -39,7 +43,7 @@ You can style text using standard Markdown syntax:
39
43
 
40
44
  Use `#` symbols to create headings:
41
45
 
42
- ```md
46
+ ```text
43
47
  # Heading 1
44
48
 
45
49
  ## Heading 2
@@ -13,6 +13,10 @@ related:
13
13
 
14
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
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
+
16
20
  ## Usage
17
21
 
18
22
  Import the component and pass a `src` object with `light` and `dark` variants:
@@ -14,7 +14,7 @@
14
14
  "@ai-sdk/react": "^2.0.115",
15
15
  "@icons-pack/react-simple-icons": "^13.8.0",
16
16
  "@orama/tokenizers": "^3.1.16",
17
- "@vercel/geistdocs": "1.3.0-canary.41d37f1",
17
+ "@vercel/geistdocs": "1.3.0-canary.5af98bc",
18
18
  "@streamdown/cjk": "^1.0.1",
19
19
  "@streamdown/code": "^1.0.1",
20
20
  "@vercel/agent-readability": "^0.2.1",