@vercel/geistdocs 1.25.1-canary.f56ac48 → 1.25.1-canary.fb7a9dd

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 (114) hide show
  1. package/dist/cli/index.js +1 -1
  2. package/dist/components/callout.d.ts.map +1 -1
  3. package/dist/components/callout.js +1 -1
  4. package/dist/components/code-block-tabs.js +1 -1
  5. package/dist/components/code-block.d.ts.map +1 -1
  6. package/dist/components/code-block.js +1 -1
  7. package/dist/components/copy-prompt.js +1 -1
  8. package/dist/components/image.d.ts +19 -0
  9. package/dist/components/image.d.ts.map +1 -0
  10. package/dist/components/image.js +9 -0
  11. package/dist/components/steps.d.ts +9 -0
  12. package/dist/components/steps.d.ts.map +1 -0
  13. package/dist/components/steps.js +9 -0
  14. package/dist/internal/chat/activity.d.ts +20 -0
  15. package/dist/internal/chat/activity.d.ts.map +1 -0
  16. package/dist/internal/chat/activity.js +43 -0
  17. package/dist/internal/chat/message-metadata.d.ts.map +1 -1
  18. package/dist/internal/chat/message-metadata.js +15 -30
  19. package/dist/internal/chat/message-sources.d.ts +3 -0
  20. package/dist/internal/chat/message-sources.d.ts.map +1 -0
  21. package/dist/internal/chat/message-sources.js +23 -0
  22. package/dist/internal/chat/message.d.ts.map +1 -1
  23. package/dist/internal/chat/message.js +44 -10
  24. package/dist/internal/chat/shell.d.ts.map +1 -1
  25. package/dist/internal/chat/shell.js +7 -2
  26. package/dist/internal/chat/source-chunks.d.ts +9 -0
  27. package/dist/internal/chat/source-chunks.d.ts.map +1 -0
  28. package/dist/internal/chat/source-chunks.js +7 -0
  29. package/dist/internal/chat/sources.d.ts +1 -1
  30. package/dist/internal/chat/sources.d.ts.map +1 -1
  31. package/dist/internal/chat/sources.js +6 -3
  32. package/dist/internal/link-href.d.ts +13 -0
  33. package/dist/internal/link-href.d.ts.map +1 -0
  34. package/dist/internal/link-href.js +51 -0
  35. package/dist/internal/mdx-to-markdown.d.ts +3 -0
  36. package/dist/internal/mdx-to-markdown.d.ts.map +1 -0
  37. package/dist/internal/mdx-to-markdown.js +166 -0
  38. package/dist/internal/mousedown-navigation-utils.d.ts +5 -0
  39. package/dist/internal/mousedown-navigation-utils.d.ts.map +1 -0
  40. package/dist/internal/mousedown-navigation-utils.js +95 -0
  41. package/dist/internal/mousedown-navigation.d.ts +10 -0
  42. package/dist/internal/mousedown-navigation.d.ts.map +1 -0
  43. package/dist/internal/mousedown-navigation.js +42 -0
  44. package/dist/internal/navbar/navbar-shell.d.ts.map +1 -1
  45. package/dist/internal/navbar/navbar-shell.js +2 -1
  46. package/dist/internal/provider-client.d.ts.map +1 -1
  47. package/dist/internal/provider-client.js +1 -11
  48. package/dist/internal/react-node-text.d.ts +4 -0
  49. package/dist/internal/react-node-text.d.ts.map +1 -0
  50. package/dist/internal/react-node-text.js +11 -0
  51. package/dist/internal/search.js +1 -1
  52. package/dist/internal/sidebar-tree.d.ts.map +1 -1
  53. package/dist/internal/sidebar-tree.js +6 -1
  54. package/dist/internal/sidebar.d.ts.map +1 -1
  55. package/dist/internal/sidebar.js +15 -14
  56. package/dist/internal/table-of-contents-visibility.d.ts +27 -0
  57. package/dist/internal/table-of-contents-visibility.d.ts.map +1 -0
  58. package/dist/internal/table-of-contents-visibility.js +15 -0
  59. package/dist/internal/toc-items.d.ts.map +1 -1
  60. package/dist/internal/toc-items.js +2 -1
  61. package/dist/mdx.d.ts +1 -0
  62. package/dist/mdx.d.ts.map +1 -1
  63. package/dist/mdx.js +7 -4
  64. package/dist/page.d.ts +35 -0
  65. package/dist/page.d.ts.map +1 -0
  66. package/dist/page.js +26 -0
  67. package/dist/pages/docs.d.ts +6 -0
  68. package/dist/pages/docs.d.ts.map +1 -1
  69. package/dist/pages/docs.js +29 -17
  70. package/dist/routes/chat.d.ts.map +1 -1
  71. package/dist/routes/chat.js +30 -13
  72. package/dist/routes/llms.d.ts +1 -1
  73. package/dist/routes/llms.d.ts.map +1 -1
  74. package/dist/routes/llms.js +12 -2
  75. package/dist/source-config.d.ts +11 -0
  76. package/dist/source-config.d.ts.map +1 -1
  77. package/dist/source-config.js +21 -2
  78. package/dist/source.d.ts +10 -1
  79. package/dist/source.d.ts.map +1 -1
  80. package/dist/source.js +75 -34
  81. package/dist/versions.js +2 -2
  82. package/docs/agents.md +6 -3
  83. package/docs/llms.txt +495 -33
  84. package/docs/manifest.json +30 -3
  85. package/docs/pages/components/steps.md +129 -0
  86. package/docs/pages/deployment.md +30 -5
  87. package/docs/pages/getting-started.md +38 -12
  88. package/docs/pages/guides/hidden-outline.md +31 -0
  89. package/docs/pages/guides/nested-navigation.md +1 -1
  90. package/docs/pages/md.md +24 -5
  91. package/docs/pages/migration-2.md +106 -0
  92. package/docs/pages/migration.md +5 -2
  93. package/docs/pages/syntax.md +73 -5
  94. package/docs/pages/table-of-contents.md +40 -0
  95. package/docs/sitemap.md +5 -2
  96. package/package.json +19 -5
  97. package/source-config.js +38 -2
  98. package/template/app/[lang]/docs/custom-page/page.tsx +49 -0
  99. package/template/content/docs/components/meta.json +4 -0
  100. package/template/content/docs/components/steps.mdx +125 -0
  101. package/template/content/docs/deployment.mdx +31 -6
  102. package/template/content/docs/getting-started.mdx +39 -13
  103. package/template/content/docs/guides/hidden-outline.mdx +28 -0
  104. package/template/content/docs/guides/meta.json +1 -1
  105. package/template/content/docs/guides/nested-navigation.mdx +1 -1
  106. package/template/content/docs/md.mdx +24 -5
  107. package/template/content/docs/meta.json +3 -0
  108. package/template/content/docs/migration-2.mdx +106 -0
  109. package/template/content/docs/migration.mdx +5 -1
  110. package/template/content/docs/syntax.mdx +74 -5
  111. package/template/content/docs/table-of-contents.mdx +40 -0
  112. package/template/next.config.ts +9 -0
  113. package/template/package.json +4 -4
  114. package/theme.css +56 -4
package/dist/source.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { defineI18n } from "fumadocs-core/i18n";
2
2
  import { loader, } from "fumadocs-core/source";
3
3
  import { getPublicPath, withBasePath, } from "./config.js";
4
+ import { mdxToMarkdown } from "./internal/mdx-to-markdown.js";
4
5
  import { stripVersionRoutePrefix, } from "./internal/version-paths.js";
5
6
  const MARKDOWN_LINK_PATTERN = /(\]\()(\/(?!\/)[^)\s]*)/g;
6
7
  const ROOT_ATTRIBUTE_PATTERN = /(\b(?:href|src)=["'])(\/(?!\/)[^"']*)/g;
@@ -64,6 +65,40 @@ const getLanguages = (config) => {
64
65
  languages: Array.from(new Set([defaultLanguage, ...languages])),
65
66
  };
66
67
  };
68
+ const YAML_NEEDS_QUOTING = /[:#{}[\]&*!|>'"%@`]/;
69
+ const ALWAYS_QUOTED_FRONTMATTER = new Set(["badge", "navTitle"]);
70
+ const formatFrontmatterValue = (value, forceQuotes = false) => {
71
+ if (value instanceof Date) {
72
+ return value.toISOString().slice(0, 10);
73
+ }
74
+ if (typeof value === "string") {
75
+ return forceQuotes ||
76
+ YAML_NEEDS_QUOTING.test(value) ||
77
+ value.trim() !== value
78
+ ? JSON.stringify(value)
79
+ : value;
80
+ }
81
+ return String(value);
82
+ };
83
+ const formatFrontmatter = (fields) => {
84
+ const lines = ["---"];
85
+ const isStringArray = (value) => Array.isArray(value);
86
+ for (const [key, value] of Object.entries(fields)) {
87
+ if (value == null || value === false) {
88
+ continue;
89
+ }
90
+ if (isStringArray(value)) {
91
+ if (value.length === 0) {
92
+ continue;
93
+ }
94
+ lines.push(`${key}:`, ...value.map((entry) => ` - ${formatFrontmatterValue(entry)}`));
95
+ continue;
96
+ }
97
+ lines.push(`${key}: ${formatFrontmatterValue(value, ALWAYS_QUOTED_FRONTMATTER.has(key))}`);
98
+ }
99
+ lines.push("---");
100
+ return lines.join("\n");
101
+ };
67
102
  const pageTreeTransformer = {
68
103
  file(node, filePath) {
69
104
  if (!filePath) {
@@ -107,51 +142,56 @@ export const createSource = ({ docs, config, baseUrl = "/docs", id, label, markd
107
142
  };
108
143
  const getPageMarkdown = async (page) => {
109
144
  const data = page.data;
110
- const processed = await data.getText("processed");
111
- const { title, description, badge, product, type, summary, prerequisites, related, navTitle, internal, noindex, canonical, tags, keywords, excludeFrom, } = data;
112
- const frontmatter = [
113
- "---",
114
- `title: ${title}`,
115
- description && `description: ${description}`,
116
- badge && `badge: ${JSON.stringify(badge)}`,
117
- product && `product: ${product}`,
118
- navTitle && `navTitle: ${JSON.stringify(navTitle)}`,
119
- type && `type: ${type}`,
120
- summary && `summary: ${summary}`,
121
- internal && "internal: true",
122
- noindex && "noindex: true",
123
- canonical && `canonical: ${canonical}`,
124
- tags?.length && `tags:\n${tags.map((tag) => ` - ${tag}`).join("\n")}`,
125
- keywords?.length &&
126
- `keywords:\n${keywords.map((keyword) => ` - ${keyword}`).join("\n")}`,
127
- excludeFrom?.length &&
128
- `excludeFrom:\n${excludeFrom.map((surface) => ` - ${surface}`).join("\n")}`,
129
- prerequisites?.length &&
130
- `prerequisites:\n${prerequisites
131
- .map((prerequisite) => ` - ${prerequisite}`)
132
- .join("\n")}`,
133
- related?.length &&
134
- `related:\n${related
135
- .map((entry) => ` - ${entry}`)
136
- .join("\n")}`,
137
- "---",
138
- ]
139
- .filter(Boolean)
140
- .join("\n");
145
+ const content = await mdxToMarkdown(await data.getText("processed"));
146
+ const { title, description, badge, product, type, summary, prerequisites, related, navTitle, internal, noindex, canonical, tags, keywords, excludeFrom, lastModified, } = data;
141
147
  const sitemapPath = "/sitemap.md";
142
148
  const llmsPath = "/llms.txt";
143
149
  const agentsPath = "/agents.md";
144
150
  const sitemapLabel = getPublicPath(sitemapPath, config.basePath);
145
151
  const llmsLabel = getPublicPath(llmsPath, config.basePath);
146
152
  const agentsLabel = getPublicPath(agentsPath, config.basePath);
153
+ const pagePath = canonical
154
+ ? withBasePath(canonical, config.basePath)
155
+ : getPublicPath(page.url, config.basePath);
156
+ const defaults = {
157
+ title,
158
+ description,
159
+ url: config.siteUrl
160
+ ? new URL(pagePath, config.siteUrl).toString()
161
+ : undefined,
162
+ docs_index: llmsLabel,
163
+ lastUpdated: lastModified,
164
+ badge,
165
+ product,
166
+ navTitle,
167
+ type,
168
+ summary,
169
+ internal,
170
+ noindex,
171
+ canonical,
172
+ tags,
173
+ keywords,
174
+ excludeFrom,
175
+ prerequisites,
176
+ related,
177
+ };
178
+ const context = {
179
+ page: page,
180
+ };
181
+ const overrides = markdown?.frontmatter
182
+ ? await markdown.frontmatter(defaults, context)
183
+ : {};
184
+ const fields = { ...defaults, ...overrides };
185
+ const frontmatter = formatFrontmatter(fields);
186
+ const docsIndex = typeof fields.docs_index === "string" ? fields.docs_index : llmsLabel;
147
187
  const agentDiscoveryLink = config.agent && config.agent.enabled !== false
148
188
  ? `\n\nFor agent-facing discovery, including API and MCP surfaces, see [${agentsLabel}](${agentsPath})`
149
189
  : "";
150
190
  const rendered = `${frontmatter}
151
191
 
152
- # ${title}
192
+ > For an index of all documentation, see [${docsIndex}](${docsIndex}).
153
193
 
154
- ${processed}
194
+ ${content}
155
195
 
156
196
  ---
157
197
 
@@ -160,7 +200,7 @@ For a semantic overview of all documentation, see [${sitemapLabel}](${sitemapPat
160
200
  For an index of all available documentation, see [${llmsLabel}](${llmsPath})${agentDiscoveryLink}`;
161
201
  const transformed = markdown?.transform
162
202
  ? await markdown.transform(rendered, {
163
- page: page,
203
+ ...context,
164
204
  })
165
205
  : rendered;
166
206
  return prefixMarkdownLinks(transformed, config.basePath);
@@ -171,6 +211,7 @@ For an index of all available documentation, see [${llmsLabel}](${llmsPath})${ag
171
211
  agent: config.agent,
172
212
  basePath: config.basePath,
173
213
  defaultLanguage: config.defaultLanguage,
214
+ siteUrl: config.siteUrl,
174
215
  title: config.title,
175
216
  translations: config.translations,
176
217
  },
package/dist/versions.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { cn } from "@vercel/geistcn/utils";
4
- import { IconArchive, IconBox, IconCheck, IconChevronDownSmall, } from "@vercel/geistcn-assets/icons";
4
+ import { IconArchive, IconBox, IconCheck, IconChevronUpDown, } from "@vercel/geistcn-assets/icons";
5
5
  import { usePathname, useRouter } from "next/navigation";
6
6
  import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "./internal/ui/dropdown-menu";
7
7
  import { resolveVersionSwitchPath, } from "./internal/version-paths.js";
@@ -73,7 +73,7 @@ export const GeistdocsRouteSelect = ({ ariaLabel = "Select route", className, cu
73
73
  const currentDescription = currentItem
74
74
  ? getDescription({ active: true, item: currentItem })
75
75
  : null;
76
- return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs("button", { "aria-label": ariaLabel, className: cn("group flex w-full items-center gap-2 rounded-md px-2 py-2 text-left outline-none transition-colors duration-150 ease-[cubic-bezier(0.175,0.885,0.32,1.1)] hover:bg-gray-alpha-100 focus-visible:shadow-[var(--ds-focus-ring)] active:bg-gray-alpha-300 data-[state=open]:bg-gray-alpha-100 motion-reduce:transition-none", className), type: "button", children: [currentItem ? renderIcon({ active: true, item: currentItem }) : null, _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate text-button-14 text-gray-1000", children: currentItem?.label ?? currentId }), currentDescription ? (_jsx("span", { className: "block truncate text-gray-900 text-label-13", children: currentDescription })) : null] }), _jsx(IconChevronDownSmall, { className: "size-4 shrink-0 text-gray-900 transition-transform duration-150 ease-[cubic-bezier(0.175,0.885,0.32,1.1)] group-data-[state=open]:rotate-180 motion-reduce:transition-none" })] }) }), _jsx(DropdownMenuContent, { align: "start", className: "w-(--radix-dropdown-menu-trigger-width) min-w-64 rounded-xl bg-background-100 p-1 shadow-(--ds-shadow-menu)", children: items.map((item) => {
76
+ return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs("button", { "aria-label": ariaLabel, className: cn("group flex w-full items-center gap-2 rounded-md px-2 py-2 text-left outline-none transition-colors duration-150 ease-[cubic-bezier(0.175,0.885,0.32,1.1)] hover:bg-gray-alpha-100 focus-visible:shadow-[var(--ds-focus-ring)] active:bg-gray-alpha-300 data-[state=open]:bg-gray-alpha-100 motion-reduce:transition-none", className), type: "button", children: [currentItem ? renderIcon({ active: true, item: currentItem }) : null, _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate text-button-14 text-gray-1000", children: currentItem?.label ?? currentId }), currentDescription ? (_jsx("span", { className: "block truncate text-gray-900 text-label-13", children: currentDescription })) : null] }), _jsx(IconChevronUpDown, { className: "size-4 shrink-0 text-gray-900" })] }) }), _jsx(DropdownMenuContent, { align: "start", className: "w-(--radix-dropdown-menu-trigger-width) min-w-64 rounded-xl bg-background-100 p-1 shadow-(--ds-shadow-menu)", children: items.map((item) => {
77
77
  const active = item.id === currentId;
78
78
  const description = getDescription({ active, item });
79
79
  return (_jsxs(DropdownMenuItem, { "aria-current": active ? "page" : undefined, className: "flex cursor-pointer items-center gap-2 rounded-md px-2 py-2", onSelect: () => navigateToItem(item), children: [renderIcon({ active, item }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate text-button-14 text-gray-1000", children: item.label }), description ? (_jsx("span", { className: "block truncate text-gray-900 text-label-13", children: description })) : null] }), active ? _jsx(IconCheck, { className: "size-4 text-blue-900" }) : null] }, item.id));
package/docs/agents.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Geistdocs Package Docs
2
2
 
3
- These docs are bundled with `@vercel/geistdocs` 1.25.1-canary.f56ac48 so agents can understand the installed package without web access.
3
+ These docs are bundled with `@vercel/geistdocs` 1.25.1-canary.fb7a9dd so agents can understand the installed package without web access.
4
4
  They are generated from `apps/template/content/docs` during the package build.
5
5
 
6
6
  ## How to use these files
@@ -25,8 +25,9 @@ They are generated from `apps/template/content/docs` during the package build.
25
25
  - [Overview](pages/index.md): Geistdocs is a packaged documentation system for creating Next.js and Fumadocs sites with shared runtime features.
26
26
  - [Getting Started](pages/getting-started.md): Create a Geistdocs project, run it locally, and edit your first documentation page.
27
27
  - [Environment Variables](pages/env.md): Environment variables required by Geistdocs for AI chat, proxy mode, and production URL configuration.
28
- - [Deploy to Vercel](pages/deployment.md): Deploy your Geistdocs site to Vercel from the dashboard with the correct project settings.
29
- - [Migration guide](pages/migration.md): Move an existing documentation site to @vercel/geistdocs while keeping local content, routing, middleware behavior, and AI-readable surfaces intact.
28
+ - [Deploy to Vercel](pages/deployment.md): Deploy a Geistdocs site to Vercel with the required project settings, environment variables, and private-package access.
29
+ - [Migrate to Geistdocs](pages/migration.md): Move an existing documentation site to @vercel/geistdocs while keeping local content, routing, middleware behavior, and AI-readable surfaces intact.
30
+ - [Migrate from Geistdocs 1.x to 2.0](pages/migration-2.md): A concise, agent-friendly checklist for upgrading an existing Geistdocs 1.x site to 2.0.
30
31
  - [Configuration](pages/configuration.md): Configure site metadata, navigation, AI features, page actions, translations, and local adapters.
31
32
  - [Syntax](pages/syntax.md): Supported MDX syntax including text formatting, code blocks, line highlighting, and Mermaid diagrams.
32
33
  - [Geistdocs Provider](pages/provider.md): The root provider component that wraps your application to handle toast notifications, search, and analytics.
@@ -38,8 +39,10 @@ They are generated from `apps/template/content/docs` during the package build.
38
39
  - [Configure sidebar navigation](pages/guides/nested-navigation.md): Configure sidebar order, section labels, folder landing pages, and deeply nested page trees with meta.json files.
39
40
  - [Edit on GitHub](pages/edit-on-github.md): A direct link on every documentation page that lets readers propose changes through GitHub pull requests.
40
41
  - [Feedback](pages/feedback.md): An interactive feedback widget that collects user sentiment and creates structured GitHub Issues automatically.
42
+ - [Hide the outline](pages/guides/hidden-outline.md): Example page with tableOfContents set to false in frontmatter. The outline column is hidden and the content spans that column, while page actions stay in place.
41
43
  - [Internationalization](pages/internationalization.md): Serve documentation in multiple languages with automatic translation via the Geistdocs CLI and Fumadocs routing.
42
44
  - [llms.txt](pages/llms-txt.md): A single endpoint that returns all documentation as plain Markdown text following the llms.txt standard.
43
45
  - [Open in Chat](pages/open-in-chat.md): Transfer documentation context to AI chat platforms like ChatGPT, Claude, Cursor, and v0 with a single click.
44
46
  - [RSS](pages/rss.md): An automatically generated RSS 2.0 feed that keeps users informed when documentation is published or updated.
47
+ - [Steps](pages/components/steps.md): Write consecutive headings that start with a number, such as "### 1. Install", to render a numbered step list. The Steps and Step components cover cases where a heading must be wrapped in another component.
45
48
  - [Table of contents](pages/table-of-contents.md): Geistdocs builds the "On this page" outline from your headings, indents sub-headings under their parent, and tracks the active section along a straight vertical guide rail.