@vercel/geistdocs 2.9.8 → 2.10.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/cli/index.js +1 -1
- package/dist/components/type-table.d.ts +29 -0
- package/dist/components/type-table.d.ts.map +1 -0
- package/dist/components/type-table.js +24 -0
- package/dist/config.d.ts +3 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/internal/chat/session-provider.d.ts.map +1 -1
- package/dist/internal/chat/session-provider.js +2 -7
- package/dist/internal/chat/shell.d.ts.map +1 -1
- package/dist/internal/chat/shell.js +7 -0
- package/dist/internal/localized-link.d.ts.map +1 -1
- package/dist/internal/localized-link.js +3 -1
- package/dist/internal/mdx-to-markdown.d.ts +36 -3
- package/dist/internal/mdx-to-markdown.d.ts.map +1 -1
- package/dist/internal/mdx-to-markdown.js +216 -15
- package/dist/mdx.d.ts.map +1 -1
- package/dist/mdx.js +1 -1
- package/dist/source.d.ts +17 -0
- package/dist/source.d.ts.map +1 -1
- package/dist/source.js +9 -6
- package/docs/agents.md +1 -1
- package/docs/llms.txt +94 -5
- package/docs/manifest.json +1 -1
- package/docs/pages/ask-ai.md +2 -2
- package/docs/pages/configuration.md +1 -1
- package/docs/pages/md.md +38 -1
- package/docs/pages/syntax.md +52 -0
- package/package.json +1 -1
- package/template/content/docs/ask-ai.mdx +2 -2
- package/template/content/docs/configuration.mdx +1 -1
- package/template/content/docs/md.mdx +38 -1
- package/template/content/docs/syntax.cn.mdx +52 -0
- package/template/content/docs/syntax.mdx +52 -0
- package/template/package.json +1 -1
package/dist/source.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type InferPageType, loader } from "fumadocs-core/source";
|
|
2
2
|
import type { PluggableList } from "unified";
|
|
3
3
|
import { type GeistdocsConfig, type GeistdocsPageSurface } from "./config.js";
|
|
4
|
+
import { type MarkdownComponentElement, type MarkdownComponentSerializer, type MarkdownPropValue } from "./internal/mdx-to-markdown.js";
|
|
4
5
|
import { type GeistdocsVersionPaths } from "./internal/version-paths.js";
|
|
5
6
|
export type { GeistdocsVersionPaths } from "./internal/version-paths.js";
|
|
6
7
|
type LoaderOptions = Parameters<typeof loader>[0];
|
|
@@ -36,7 +37,23 @@ export interface GeistdocsMarkdownContext {
|
|
|
36
37
|
}
|
|
37
38
|
export type GeistdocsMarkdownFrontmatterValue = boolean | Date | number | readonly string[] | string | null | undefined;
|
|
38
39
|
export type GeistdocsMarkdownFrontmatter = Record<string, GeistdocsMarkdownFrontmatterValue>;
|
|
40
|
+
/** A prop value Markdown serializers receive: literals only, never evaluated. */
|
|
41
|
+
export type GeistdocsMarkdownPropValue = MarkdownPropValue;
|
|
42
|
+
/** The MDX element a Markdown serializer converts. */
|
|
43
|
+
export type GeistdocsMarkdownComponentElement = MarkdownComponentElement;
|
|
44
|
+
/**
|
|
45
|
+
* Convert one site component to Markdown for the page's Markdown export.
|
|
46
|
+
* Return Markdown to write in its place (an empty string removes it), or
|
|
47
|
+
* `undefined` to keep the built-in conversion.
|
|
48
|
+
*/
|
|
49
|
+
export type GeistdocsMarkdownComponentSerializer = MarkdownComponentSerializer<GeistdocsMarkdownContext>;
|
|
39
50
|
export interface GeistdocsMarkdownOptions {
|
|
51
|
+
/**
|
|
52
|
+
* Markdown serializers for components the exporter cannot read, keyed by
|
|
53
|
+
* the component name used in MDX. A serializer for a built-in component
|
|
54
|
+
* name replaces its built-in conversion.
|
|
55
|
+
*/
|
|
56
|
+
components?: Record<string, GeistdocsMarkdownComponentSerializer>;
|
|
40
57
|
/** Add or override fields in the generated Markdown frontmatter. */
|
|
41
58
|
frontmatter?: (defaults: Readonly<GeistdocsMarkdownFrontmatter>, context: GeistdocsMarkdownContext) => GeistdocsMarkdownFrontmatter | Promise<GeistdocsMarkdownFrontmatter>;
|
|
42
59
|
/**
|
package/dist/source.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../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CAAC,EAAE,0BAA0B,CAAC,YAAY,CAAC,CAAC;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,sBAAsB,CAAC,EAAE,KAAK,CAAC,CAAC;CAClE;AAED;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GAAI,iCAIvC,gCAAgC,KAAG,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAiBvE,CAAC"}
|
package/dist/source.js
CHANGED
|
@@ -1,7 +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 { createMdxToMarkdown } from "./internal/mdx-to-markdown.js";
|
|
4
|
+
import { createMdxToMarkdown, } from "./internal/mdx-to-markdown.js";
|
|
5
5
|
import { stripVersionRoutePrefix, } from "./internal/version-paths.js";
|
|
6
6
|
const MARKDOWN_LINK_PATTERN = /(\]\()(\/(?!\/)[^)\s]*)/g;
|
|
7
7
|
const ROOT_ATTRIBUTE_PATTERN = /(\b(?:href|src)=["'])(\/(?!\/)[^"']*)/g;
|
|
@@ -140,10 +140,16 @@ export const createSource = ({ docs, config, baseUrl = "/docs", id, label, markd
|
|
|
140
140
|
url: getPublicPath(`/og/${segments.join("/")}`, config.basePath),
|
|
141
141
|
};
|
|
142
142
|
};
|
|
143
|
-
const mdxToMarkdown = createMdxToMarkdown(
|
|
143
|
+
const mdxToMarkdown = createMdxToMarkdown({
|
|
144
|
+
components: markdown?.components,
|
|
145
|
+
remarkPlugins: markdown?.remarkPlugins,
|
|
146
|
+
});
|
|
144
147
|
const getPageMarkdown = async (page) => {
|
|
145
148
|
const data = page.data;
|
|
146
|
-
const
|
|
149
|
+
const context = {
|
|
150
|
+
page: page,
|
|
151
|
+
};
|
|
152
|
+
const content = await mdxToMarkdown(await data.getText("processed"), context);
|
|
147
153
|
const { title, description, badge, product, type, summary, prerequisites, related, navTitle, internal, noindex, canonical, tags, keywords, excludeFrom, lastModified, } = data;
|
|
148
154
|
const sitemapPath = "/sitemap.md";
|
|
149
155
|
const llmsPath = "/llms.txt";
|
|
@@ -176,9 +182,6 @@ export const createSource = ({ docs, config, baseUrl = "/docs", id, label, markd
|
|
|
176
182
|
prerequisites,
|
|
177
183
|
related,
|
|
178
184
|
};
|
|
179
|
-
const context = {
|
|
180
|
-
page: page,
|
|
181
|
-
};
|
|
182
185
|
const overrides = markdown?.frontmatter
|
|
183
186
|
? await markdown.frontmatter(defaults, context)
|
|
184
187
|
: {};
|
package/docs/agents.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Geistdocs Package Docs
|
|
2
2
|
|
|
3
|
-
These docs are bundled with `@vercel/geistdocs` 2.
|
|
3
|
+
These docs are bundled with `@vercel/geistdocs` 2.10.0 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
|
package/docs/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Geistdocs Package Documentation
|
|
2
2
|
|
|
3
|
-
These docs are bundled with `@vercel/geistdocs` 2.
|
|
3
|
+
These docs are bundled with `@vercel/geistdocs` 2.10.0.
|
|
4
4
|
They describe how to build package-backed Geistdocs sites and how to use the package APIs from generated project adapters.
|
|
5
5
|
|
|
6
6
|
## Documentation Index
|
|
@@ -1346,7 +1346,7 @@ export const ai = {
|
|
|
1346
1346
|
};
|
|
1347
1347
|
```
|
|
1348
1348
|
|
|
1349
|
-
Set `eveAgent.prewarm` only when the agent runs eve 0.59 or newer and allocating an empty durable session
|
|
1349
|
+
Set `eveAgent.prewarm` only when the agent runs eve 0.59 or newer and allocating an empty durable session when a reader starts typing is appropriate for the site.
|
|
1350
1350
|
|
|
1351
1351
|
The `ai` config also controls the chat panel and its route:
|
|
1352
1352
|
|
|
@@ -1998,6 +1998,58 @@ Tables can also include inline code, as commonly used for file references:
|
|
|
1998
1998
|
| `.env.local` | Local environment variables |
|
|
1999
1999
|
| `tsconfig.json` | Configuration file for TypeScript |
|
|
2000
2000
|
|
|
2001
|
+
### Type Tables
|
|
2002
|
+
|
|
2003
|
+
Document component props or configuration options with `TypeTable`. Pass a `type` object keyed by prop name, and Geistdocs renders it as a table with Prop, Type, Default, and Description columns. The Default column appears only when at least one row has a default.
|
|
2004
|
+
|
|
2005
|
+
```mdx
|
|
2006
|
+
<TypeTable
|
|
2007
|
+
type={{
|
|
2008
|
+
children: {
|
|
2009
|
+
type: "string",
|
|
2010
|
+
description: "The Markdown content to render",
|
|
2011
|
+
required: true,
|
|
2012
|
+
},
|
|
2013
|
+
parseIncompleteMarkdown: {
|
|
2014
|
+
type: "boolean",
|
|
2015
|
+
default: "true",
|
|
2016
|
+
description: "Enable remend preprocessor for unterminated Markdown blocks",
|
|
2017
|
+
},
|
|
2018
|
+
shikiTheme: {
|
|
2019
|
+
type: "[ThemeInput, ThemeInput]",
|
|
2020
|
+
typeDescriptionLink: "https://shiki.style/themes",
|
|
2021
|
+
default: "['github-light', 'github-dark']",
|
|
2022
|
+
description: "Light and dark themes for code syntax highlighting",
|
|
2023
|
+
},
|
|
2024
|
+
}}
|
|
2025
|
+
/>
|
|
2026
|
+
```
|
|
2027
|
+
|
|
2028
|
+
This renders as:
|
|
2029
|
+
|
|
2030
|
+
<TypeTable
|
|
2031
|
+
type={{
|
|
2032
|
+
children: {
|
|
2033
|
+
type: "string",
|
|
2034
|
+
description: "The Markdown content to render",
|
|
2035
|
+
required: true,
|
|
2036
|
+
},
|
|
2037
|
+
parseIncompleteMarkdown: {
|
|
2038
|
+
type: "boolean",
|
|
2039
|
+
default: "true",
|
|
2040
|
+
description: "Enable remend preprocessor for unterminated Markdown blocks",
|
|
2041
|
+
},
|
|
2042
|
+
shikiTheme: {
|
|
2043
|
+
type: "[ThemeInput, ThemeInput]",
|
|
2044
|
+
typeDescriptionLink: "https://shiki.style/themes",
|
|
2045
|
+
default: "['github-light', 'github-dark']",
|
|
2046
|
+
description: "Light and dark themes for code syntax highlighting",
|
|
2047
|
+
},
|
|
2048
|
+
}}
|
|
2049
|
+
/>
|
|
2050
|
+
|
|
2051
|
+
Optional props show a `?` after their name; set `required: true` to remove it. Set `deprecated: true` to mark a prop as deprecated, and `typeDescriptionLink` to link its type. Every value is part of the page HTML, so readers, search, and agents see the full reference.
|
|
2052
|
+
|
|
2001
2053
|
### Task Lists
|
|
2002
2054
|
|
|
2003
2055
|
Create interactive task lists:
|
|
@@ -3557,7 +3609,7 @@ The response includes:
|
|
|
3557
3609
|
- Frontmatter with page metadata and discovery links
|
|
3558
3610
|
- Page content with presentation-only MDX components removed
|
|
3559
3611
|
|
|
3560
|
-
|
|
3612
|
+
Geistdocs converts its built-in MDX components to plain Markdown equivalents. Components your site defines need a Markdown serializer, described in [Convert site components](#convert-site-components).
|
|
3561
3613
|
|
|
3562
3614
|
### Customize frontmatter
|
|
3563
3615
|
|
|
@@ -3598,6 +3650,43 @@ export const geistdocsSource = createSource({
|
|
|
3598
3650
|
|
|
3599
3651
|
Plugins run before Geistdocs converts MDX components to Markdown. Use plugins that add syntax, and keep tree transforms in `source.config.ts` so they apply to the rendered page and its export together.
|
|
3600
3652
|
|
|
3653
|
+
### Convert site components
|
|
3654
|
+
|
|
3655
|
+
Geistdocs reads MDX without running your React components, so a component your site defines exports only the content written between its tags. A self-closing component such as `<TSDoc definition={...} />` or `<FluidComputeCallout />` exports nothing. Register a serializer for each one with `markdown.components`, keyed by the name you use in MDX, and return the Markdown to write in its place:
|
|
3656
|
+
|
|
3657
|
+
```ts title="lib/geistdocs/source.ts"
|
|
3658
|
+
// Your site's own generator for the type tables TSDoc renders.
|
|
3659
|
+
import { renderTypeTable } from "@/lib/tsdoc";
|
|
3660
|
+
|
|
3661
|
+
export const geistdocsSource = createSource({
|
|
3662
|
+
config,
|
|
3663
|
+
docs,
|
|
3664
|
+
markdown: {
|
|
3665
|
+
components: {
|
|
3666
|
+
FluidComputeCallout: () => "> Enable Fluid compute before deploying.",
|
|
3667
|
+
TSDoc: async ({ props }) =>
|
|
3668
|
+
renderTypeTable(props.definition, props.showSections),
|
|
3669
|
+
Author: ({ props }) => `[${props.name}](${props.link})`,
|
|
3670
|
+
Authors: ({ children, props }) => `${props.date} by ${children}`,
|
|
3671
|
+
},
|
|
3672
|
+
},
|
|
3673
|
+
});
|
|
3674
|
+
```
|
|
3675
|
+
|
|
3676
|
+
Each serializer receives the element and the export context:
|
|
3677
|
+
|
|
3678
|
+
| Field | Type | Description |
|
|
3679
|
+
| --- | --- | --- |
|
|
3680
|
+
| `name` | `string` | The component name as written in MDX, such as `TSDoc` or `Docs.Callout`. |
|
|
3681
|
+
| `props` | `Record<string, GeistdocsMarkdownPropValue>` | Props whose values are literals: strings, numbers, booleans, `null`, and arrays or objects built only from those. A bare prop such as `interactive` is `true`. |
|
|
3682
|
+
| `children` | `string` | The element's children, already converted to Markdown. Empty for self-closing elements. |
|
|
3683
|
+
| `inline` | `boolean` | `true` when the element sits inside a sentence rather than on its own lines. |
|
|
3684
|
+
| `context.page` | `object` | The page being exported, with its `data`, `path`, `slugs`, and `url`. |
|
|
3685
|
+
|
|
3686
|
+
Geistdocs never evaluates JavaScript, so props that need it, such as identifiers (`data={benchmark}`), function calls, and interpolated template literals, are left out of `props`. A spread (`{...shared}`) removes the props written before it, because the spread could replace them. Read data your component imports, such as a JSON file or a generated type table, from the serializer instead.
|
|
3687
|
+
|
|
3688
|
+
Return a Markdown string to replace the element, an empty string to remove it, or `undefined` to keep Geistdocs' built-in conversion. Serializers can be `async`. Nested elements convert from the innermost out, so `children` already contains the output of serializers for the components inside it. When an inline element returns a single paragraph, that text stays in its sentence. A serializer registered for a built-in component name, such as `Callout`, replaces the built-in conversion; return `undefined` for the cases the built-in conversion should handle. When a serializer throws, the export fails with an error that names the component.
|
|
3689
|
+
|
|
3601
3690
|
## Missing documentation pages
|
|
3602
3691
|
|
|
3603
3692
|
When a Markdown request does not match a page, Geistdocs returns an agent-readable `Page Not Found` response. It compares the requested path with visible page paths and titles, then links up to five likely matches with their descriptions. If no match is useful, the response links to `/llms.txt` instead.
|
|
@@ -4165,7 +4254,7 @@ export const ai = {
|
|
|
4165
4254
|
};
|
|
4166
4255
|
```
|
|
4167
4256
|
|
|
4168
|
-
Set `prewarm: true` to start an empty session when
|
|
4257
|
+
Set `prewarm: true` to start an empty session when a reader starts typing a question in a new conversation. The prewarm response binds the session to the reader's browser with the session cookie, and the first message waits for that request and reuses the session, avoiding workflow startup latency. Prewarming requires eve 0.59 or newer and [`GEISTDOCS_CHAT_SECRET`](#keep-eve-sessions-across-turns-with-geistdocs_chat_secret), and falls back to normal session creation if the early request fails. Leave it disabled when typing a draft should not allocate a durable session before the reader sends a message.
|
|
4169
4258
|
|
|
4170
4259
|
The URL flows to `createChatRoute` through the config object you already pass in `app/api/chat/route.ts` — no route changes are required. Geistdocs speaks eve's session API directly: it starts or resumes a durable eve session, streams the agent's NDJSON events, and translates them into the same UI message stream the chat panel already renders. With `GEISTDOCS_CHAT_SECRET` set, Geistdocs continues one eve session across turns by binding it to the reader's browser with a signed, httpOnly cookie.
|
|
4171
4260
|
|
|
@@ -4260,7 +4349,7 @@ Browsers only send a `SameSite=Strict` cookie with requests that start on the sa
|
|
|
4260
4349
|
Without `GEISTDOCS_CHAT_SECRET`, eve agent mode still answers every question, but it never sets or reads the session cookie:
|
|
4261
4350
|
|
|
4262
4351
|
- Every turn starts a new eve session, with up to 8,000 characters of the prior conversation inlined into the message.
|
|
4263
|
-
- The route refuses `{ prewarm: true }` requests with a `400` response, so `prewarm: true` only adds a failed request when
|
|
4352
|
+
- The route refuses `{ prewarm: true }` requests with a `400` response, so `prewarm: true` only adds a failed request when a reader starts typing.
|
|
4264
4353
|
- The server logs a warning that names `GEISTDOCS_CHAT_SECRET`.
|
|
4265
4354
|
|
|
4266
4355
|
### Choose what context the proxy or agent receives
|
package/docs/manifest.json
CHANGED
package/docs/pages/ask-ai.md
CHANGED
|
@@ -336,7 +336,7 @@ export const ai = {
|
|
|
336
336
|
};
|
|
337
337
|
```
|
|
338
338
|
|
|
339
|
-
Set `prewarm: true` to start an empty session when
|
|
339
|
+
Set `prewarm: true` to start an empty session when a reader starts typing a question in a new conversation. The prewarm response binds the session to the reader's browser with the session cookie, and the first message waits for that request and reuses the session, avoiding workflow startup latency. Prewarming requires eve 0.59 or newer and [`GEISTDOCS_CHAT_SECRET`](#keep-eve-sessions-across-turns-with-geistdocs_chat_secret), and falls back to normal session creation if the early request fails. Leave it disabled when typing a draft should not allocate a durable session before the reader sends a message.
|
|
340
340
|
|
|
341
341
|
The URL flows to `createChatRoute` through the config object you already pass in `app/api/chat/route.ts` — no route changes are required. Geistdocs speaks eve's session API directly: it starts or resumes a durable eve session, streams the agent's NDJSON events, and translates them into the same UI message stream the chat panel already renders. With `GEISTDOCS_CHAT_SECRET` set, Geistdocs continues one eve session across turns by binding it to the reader's browser with a signed, httpOnly cookie.
|
|
342
342
|
|
|
@@ -431,7 +431,7 @@ Browsers only send a `SameSite=Strict` cookie with requests that start on the sa
|
|
|
431
431
|
Without `GEISTDOCS_CHAT_SECRET`, eve agent mode still answers every question, but it never sets or reads the session cookie:
|
|
432
432
|
|
|
433
433
|
- Every turn starts a new eve session, with up to 8,000 characters of the prior conversation inlined into the message.
|
|
434
|
-
- The route refuses `{ prewarm: true }` requests with a `400` response, so `prewarm: true` only adds a failed request when
|
|
434
|
+
- The route refuses `{ prewarm: true }` requests with a `400` response, so `prewarm: true` only adds a failed request when a reader starts typing.
|
|
435
435
|
- The server logs a warning that names `GEISTDOCS_CHAT_SECRET`.
|
|
436
436
|
|
|
437
437
|
### Choose what context the proxy or agent receives
|
|
@@ -207,7 +207,7 @@ export const ai = {
|
|
|
207
207
|
};
|
|
208
208
|
```
|
|
209
209
|
|
|
210
|
-
Set `eveAgent.prewarm` only when the agent runs eve 0.59 or newer and allocating an empty durable session
|
|
210
|
+
Set `eveAgent.prewarm` only when the agent runs eve 0.59 or newer and allocating an empty durable session when a reader starts typing is appropriate for the site.
|
|
211
211
|
|
|
212
212
|
The `ai` config also controls the chat panel and its route:
|
|
213
213
|
|
package/docs/pages/md.md
CHANGED
|
@@ -90,7 +90,7 @@ The response includes:
|
|
|
90
90
|
- Frontmatter with page metadata and discovery links
|
|
91
91
|
- Page content with presentation-only MDX components removed
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
Geistdocs converts its built-in MDX components to plain Markdown equivalents. Components your site defines need a Markdown serializer, described in [Convert site components](#convert-site-components).
|
|
94
94
|
|
|
95
95
|
### Customize frontmatter
|
|
96
96
|
|
|
@@ -131,6 +131,43 @@ export const geistdocsSource = createSource({
|
|
|
131
131
|
|
|
132
132
|
Plugins run before Geistdocs converts MDX components to Markdown. Use plugins that add syntax, and keep tree transforms in `source.config.ts` so they apply to the rendered page and its export together.
|
|
133
133
|
|
|
134
|
+
### Convert site components
|
|
135
|
+
|
|
136
|
+
Geistdocs reads MDX without running your React components, so a component your site defines exports only the content written between its tags. A self-closing component such as `<TSDoc definition={...} />` or `<FluidComputeCallout />` exports nothing. Register a serializer for each one with `markdown.components`, keyed by the name you use in MDX, and return the Markdown to write in its place:
|
|
137
|
+
|
|
138
|
+
```ts title="lib/geistdocs/source.ts"
|
|
139
|
+
// Your site's own generator for the type tables TSDoc renders.
|
|
140
|
+
import { renderTypeTable } from "@/lib/tsdoc";
|
|
141
|
+
|
|
142
|
+
export const geistdocsSource = createSource({
|
|
143
|
+
config,
|
|
144
|
+
docs,
|
|
145
|
+
markdown: {
|
|
146
|
+
components: {
|
|
147
|
+
FluidComputeCallout: () => "> Enable Fluid compute before deploying.",
|
|
148
|
+
TSDoc: async ({ props }) =>
|
|
149
|
+
renderTypeTable(props.definition, props.showSections),
|
|
150
|
+
Author: ({ props }) => `[${props.name}](${props.link})`,
|
|
151
|
+
Authors: ({ children, props }) => `${props.date} by ${children}`,
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Each serializer receives the element and the export context:
|
|
158
|
+
|
|
159
|
+
| Field | Type | Description |
|
|
160
|
+
| --- | --- | --- |
|
|
161
|
+
| `name` | `string` | The component name as written in MDX, such as `TSDoc` or `Docs.Callout`. |
|
|
162
|
+
| `props` | `Record<string, GeistdocsMarkdownPropValue>` | Props whose values are literals: strings, numbers, booleans, `null`, and arrays or objects built only from those. A bare prop such as `interactive` is `true`. |
|
|
163
|
+
| `children` | `string` | The element's children, already converted to Markdown. Empty for self-closing elements. |
|
|
164
|
+
| `inline` | `boolean` | `true` when the element sits inside a sentence rather than on its own lines. |
|
|
165
|
+
| `context.page` | `object` | The page being exported, with its `data`, `path`, `slugs`, and `url`. |
|
|
166
|
+
|
|
167
|
+
Geistdocs never evaluates JavaScript, so props that need it, such as identifiers (`data={benchmark}`), function calls, and interpolated template literals, are left out of `props`. A spread (`{...shared}`) removes the props written before it, because the spread could replace them. Read data your component imports, such as a JSON file or a generated type table, from the serializer instead.
|
|
168
|
+
|
|
169
|
+
Return a Markdown string to replace the element, an empty string to remove it, or `undefined` to keep Geistdocs' built-in conversion. Serializers can be `async`. Nested elements convert from the innermost out, so `children` already contains the output of serializers for the components inside it. When an inline element returns a single paragraph, that text stays in its sentence. A serializer registered for a built-in component name, such as `Callout`, replaces the built-in conversion; return `undefined` for the cases the built-in conversion should handle. When a serializer throws, the export fails with an error that names the component.
|
|
170
|
+
|
|
134
171
|
## Missing documentation pages
|
|
135
172
|
|
|
136
173
|
When a Markdown request does not match a page, Geistdocs returns an agent-readable `Page Not Found` response. It compares the requested path with visible page paths and titles, then links up to five likely matches with their descriptions. If no match is useful, the response links to `/llms.txt` instead.
|
package/docs/pages/syntax.md
CHANGED
|
@@ -376,6 +376,58 @@ Tables can also include inline code, as commonly used for file references:
|
|
|
376
376
|
| `.env.local` | Local environment variables |
|
|
377
377
|
| `tsconfig.json` | Configuration file for TypeScript |
|
|
378
378
|
|
|
379
|
+
### Type Tables
|
|
380
|
+
|
|
381
|
+
Document component props or configuration options with `TypeTable`. Pass a `type` object keyed by prop name, and Geistdocs renders it as a table with Prop, Type, Default, and Description columns. The Default column appears only when at least one row has a default.
|
|
382
|
+
|
|
383
|
+
```mdx
|
|
384
|
+
<TypeTable
|
|
385
|
+
type={{
|
|
386
|
+
children: {
|
|
387
|
+
type: "string",
|
|
388
|
+
description: "The Markdown content to render",
|
|
389
|
+
required: true,
|
|
390
|
+
},
|
|
391
|
+
parseIncompleteMarkdown: {
|
|
392
|
+
type: "boolean",
|
|
393
|
+
default: "true",
|
|
394
|
+
description: "Enable remend preprocessor for unterminated Markdown blocks",
|
|
395
|
+
},
|
|
396
|
+
shikiTheme: {
|
|
397
|
+
type: "[ThemeInput, ThemeInput]",
|
|
398
|
+
typeDescriptionLink: "https://shiki.style/themes",
|
|
399
|
+
default: "['github-light', 'github-dark']",
|
|
400
|
+
description: "Light and dark themes for code syntax highlighting",
|
|
401
|
+
},
|
|
402
|
+
}}
|
|
403
|
+
/>
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
This renders as:
|
|
407
|
+
|
|
408
|
+
<TypeTable
|
|
409
|
+
type={{
|
|
410
|
+
children: {
|
|
411
|
+
type: "string",
|
|
412
|
+
description: "The Markdown content to render",
|
|
413
|
+
required: true,
|
|
414
|
+
},
|
|
415
|
+
parseIncompleteMarkdown: {
|
|
416
|
+
type: "boolean",
|
|
417
|
+
default: "true",
|
|
418
|
+
description: "Enable remend preprocessor for unterminated Markdown blocks",
|
|
419
|
+
},
|
|
420
|
+
shikiTheme: {
|
|
421
|
+
type: "[ThemeInput, ThemeInput]",
|
|
422
|
+
typeDescriptionLink: "https://shiki.style/themes",
|
|
423
|
+
default: "['github-light', 'github-dark']",
|
|
424
|
+
description: "Light and dark themes for code syntax highlighting",
|
|
425
|
+
},
|
|
426
|
+
}}
|
|
427
|
+
/>
|
|
428
|
+
|
|
429
|
+
Optional props show a `?` after their name; set `required: true` to remove it. Set `deprecated: true` to mark a prop as deprecated, and `typeDescriptionLink` to link its type. Every value is part of the page HTML, so readers, search, and agents see the full reference.
|
|
430
|
+
|
|
379
431
|
### Task Lists
|
|
380
432
|
|
|
381
433
|
Create interactive task lists:
|
package/package.json
CHANGED
|
@@ -334,7 +334,7 @@ export const ai = {
|
|
|
334
334
|
};
|
|
335
335
|
```
|
|
336
336
|
|
|
337
|
-
Set `prewarm: true` to start an empty session when
|
|
337
|
+
Set `prewarm: true` to start an empty session when a reader starts typing a question in a new conversation. The prewarm response binds the session to the reader's browser with the session cookie, and the first message waits for that request and reuses the session, avoiding workflow startup latency. Prewarming requires eve 0.59 or newer and [`GEISTDOCS_CHAT_SECRET`](#keep-eve-sessions-across-turns-with-geistdocs_chat_secret), and falls back to normal session creation if the early request fails. Leave it disabled when typing a draft should not allocate a durable session before the reader sends a message.
|
|
338
338
|
|
|
339
339
|
The URL flows to `createChatRoute` through the config object you already pass in `app/api/chat/route.ts` — no route changes are required. Geistdocs speaks eve's session API directly: it starts or resumes a durable eve session, streams the agent's NDJSON events, and translates them into the same UI message stream the chat panel already renders. With `GEISTDOCS_CHAT_SECRET` set, Geistdocs continues one eve session across turns by binding it to the reader's browser with a signed, httpOnly cookie.
|
|
340
340
|
|
|
@@ -429,7 +429,7 @@ Browsers only send a `SameSite=Strict` cookie with requests that start on the sa
|
|
|
429
429
|
Without `GEISTDOCS_CHAT_SECRET`, eve agent mode still answers every question, but it never sets or reads the session cookie:
|
|
430
430
|
|
|
431
431
|
- Every turn starts a new eve session, with up to 8,000 characters of the prior conversation inlined into the message.
|
|
432
|
-
- The route refuses `{ prewarm: true }` requests with a `400` response, so `prewarm: true` only adds a failed request when
|
|
432
|
+
- The route refuses `{ prewarm: true }` requests with a `400` response, so `prewarm: true` only adds a failed request when a reader starts typing.
|
|
433
433
|
- The server logs a warning that names `GEISTDOCS_CHAT_SECRET`.
|
|
434
434
|
|
|
435
435
|
### Choose what context the proxy or agent receives
|
|
@@ -205,7 +205,7 @@ export const ai = {
|
|
|
205
205
|
};
|
|
206
206
|
```
|
|
207
207
|
|
|
208
|
-
Set `eveAgent.prewarm` only when the agent runs eve 0.59 or newer and allocating an empty durable session
|
|
208
|
+
Set `eveAgent.prewarm` only when the agent runs eve 0.59 or newer and allocating an empty durable session when a reader starts typing is appropriate for the site.
|
|
209
209
|
|
|
210
210
|
The `ai` config also controls the chat panel and its route:
|
|
211
211
|
|
|
@@ -88,7 +88,7 @@ The response includes:
|
|
|
88
88
|
- Frontmatter with page metadata and discovery links
|
|
89
89
|
- Page content with presentation-only MDX components removed
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
Geistdocs converts its built-in MDX components to plain Markdown equivalents. Components your site defines need a Markdown serializer, described in [Convert site components](#convert-site-components).
|
|
92
92
|
|
|
93
93
|
### Customize frontmatter
|
|
94
94
|
|
|
@@ -129,6 +129,43 @@ export const geistdocsSource = createSource({
|
|
|
129
129
|
|
|
130
130
|
Plugins run before Geistdocs converts MDX components to Markdown. Use plugins that add syntax, and keep tree transforms in `source.config.ts` so they apply to the rendered page and its export together.
|
|
131
131
|
|
|
132
|
+
### Convert site components
|
|
133
|
+
|
|
134
|
+
Geistdocs reads MDX without running your React components, so a component your site defines exports only the content written between its tags. A self-closing component such as `<TSDoc definition={...} />` or `<FluidComputeCallout />` exports nothing. Register a serializer for each one with `markdown.components`, keyed by the name you use in MDX, and return the Markdown to write in its place:
|
|
135
|
+
|
|
136
|
+
```ts title="lib/geistdocs/source.ts"
|
|
137
|
+
// Your site's own generator for the type tables TSDoc renders.
|
|
138
|
+
import { renderTypeTable } from "@/lib/tsdoc";
|
|
139
|
+
|
|
140
|
+
export const geistdocsSource = createSource({
|
|
141
|
+
config,
|
|
142
|
+
docs,
|
|
143
|
+
markdown: {
|
|
144
|
+
components: {
|
|
145
|
+
FluidComputeCallout: () => "> Enable Fluid compute before deploying.",
|
|
146
|
+
TSDoc: async ({ props }) =>
|
|
147
|
+
renderTypeTable(props.definition, props.showSections),
|
|
148
|
+
Author: ({ props }) => `[${props.name}](${props.link})`,
|
|
149
|
+
Authors: ({ children, props }) => `${props.date} by ${children}`,
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
});
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Each serializer receives the element and the export context:
|
|
156
|
+
|
|
157
|
+
| Field | Type | Description |
|
|
158
|
+
| --- | --- | --- |
|
|
159
|
+
| `name` | `string` | The component name as written in MDX, such as `TSDoc` or `Docs.Callout`. |
|
|
160
|
+
| `props` | `Record<string, GeistdocsMarkdownPropValue>` | Props whose values are literals: strings, numbers, booleans, `null`, and arrays or objects built only from those. A bare prop such as `interactive` is `true`. |
|
|
161
|
+
| `children` | `string` | The element's children, already converted to Markdown. Empty for self-closing elements. |
|
|
162
|
+
| `inline` | `boolean` | `true` when the element sits inside a sentence rather than on its own lines. |
|
|
163
|
+
| `context.page` | `object` | The page being exported, with its `data`, `path`, `slugs`, and `url`. |
|
|
164
|
+
|
|
165
|
+
Geistdocs never evaluates JavaScript, so props that need it, such as identifiers (`data={benchmark}`), function calls, and interpolated template literals, are left out of `props`. A spread (`{...shared}`) removes the props written before it, because the spread could replace them. Read data your component imports, such as a JSON file or a generated type table, from the serializer instead.
|
|
166
|
+
|
|
167
|
+
Return a Markdown string to replace the element, an empty string to remove it, or `undefined` to keep Geistdocs' built-in conversion. Serializers can be `async`. Nested elements convert from the innermost out, so `children` already contains the output of serializers for the components inside it. When an inline element returns a single paragraph, that text stays in its sentence. A serializer registered for a built-in component name, such as `Callout`, replaces the built-in conversion; return `undefined` for the cases the built-in conversion should handle. When a serializer throws, the export fails with an error that names the component.
|
|
168
|
+
|
|
132
169
|
## Missing documentation pages
|
|
133
170
|
|
|
134
171
|
When a Markdown request does not match a page, Geistdocs returns an agent-readable `Page Not Found` response. It compares the requested path with visible page paths and titles, then links up to five likely matches with their descriptions. If no match is useful, the response links to `/llms.txt` instead.
|
|
@@ -117,6 +117,58 @@ Geistdocs 支持 GFM 扩展,包括表格、任务列表和自动链接。
|
|
|
117
117
|
| GFM | GitHub extensions | Supported |
|
|
118
118
|
| MDX | JSX in Markdown | Supported |
|
|
119
119
|
|
|
120
|
+
### 类型表格
|
|
121
|
+
|
|
122
|
+
使用 `TypeTable` 记录组件属性或配置选项。传入以属性名为键的 `type` 对象,Geistdocs 会将其渲染为包含 Prop、Type、Default 和 Description 列的表格。只有当至少一行包含默认值时,才会显示 Default 列。
|
|
123
|
+
|
|
124
|
+
```mdx
|
|
125
|
+
<TypeTable
|
|
126
|
+
type={{
|
|
127
|
+
children: {
|
|
128
|
+
type: "string",
|
|
129
|
+
description: "The Markdown content to render",
|
|
130
|
+
required: true,
|
|
131
|
+
},
|
|
132
|
+
parseIncompleteMarkdown: {
|
|
133
|
+
type: "boolean",
|
|
134
|
+
default: "true",
|
|
135
|
+
description: "Enable remend preprocessor for unterminated Markdown blocks",
|
|
136
|
+
},
|
|
137
|
+
shikiTheme: {
|
|
138
|
+
type: "[ThemeInput, ThemeInput]",
|
|
139
|
+
typeDescriptionLink: "https://shiki.style/themes",
|
|
140
|
+
default: "['github-light', 'github-dark']",
|
|
141
|
+
description: "Light and dark themes for code syntax highlighting",
|
|
142
|
+
},
|
|
143
|
+
}}
|
|
144
|
+
/>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
渲染效果如下:
|
|
148
|
+
|
|
149
|
+
<TypeTable
|
|
150
|
+
type={{
|
|
151
|
+
children: {
|
|
152
|
+
type: "string",
|
|
153
|
+
description: "The Markdown content to render",
|
|
154
|
+
required: true,
|
|
155
|
+
},
|
|
156
|
+
parseIncompleteMarkdown: {
|
|
157
|
+
type: "boolean",
|
|
158
|
+
default: "true",
|
|
159
|
+
description: "Enable remend preprocessor for unterminated Markdown blocks",
|
|
160
|
+
},
|
|
161
|
+
shikiTheme: {
|
|
162
|
+
type: "[ThemeInput, ThemeInput]",
|
|
163
|
+
typeDescriptionLink: "https://shiki.style/themes",
|
|
164
|
+
default: "['github-light', 'github-dark']",
|
|
165
|
+
description: "Light and dark themes for code syntax highlighting",
|
|
166
|
+
},
|
|
167
|
+
}}
|
|
168
|
+
/>
|
|
169
|
+
|
|
170
|
+
可选属性会在名称后显示 `?`;设置 `required: true` 可将其移除。设置 `deprecated: true` 可将属性标记为已弃用,设置 `typeDescriptionLink` 可为其类型添加链接。所有值都包含在页面 HTML 中,读者、搜索和智能体都能看到完整的参考信息。
|
|
171
|
+
|
|
120
172
|
### 任务列表
|
|
121
173
|
|
|
122
174
|
创建交互式任务列表:
|
|
@@ -380,6 +380,58 @@ Tables can also include inline code, as commonly used for file references:
|
|
|
380
380
|
| `.env.local` | Local environment variables |
|
|
381
381
|
| `tsconfig.json` | Configuration file for TypeScript |
|
|
382
382
|
|
|
383
|
+
### Type Tables
|
|
384
|
+
|
|
385
|
+
Document component props or configuration options with `TypeTable`. Pass a `type` object keyed by prop name, and Geistdocs renders it as a table with Prop, Type, Default, and Description columns. The Default column appears only when at least one row has a default.
|
|
386
|
+
|
|
387
|
+
```mdx
|
|
388
|
+
<TypeTable
|
|
389
|
+
type={{
|
|
390
|
+
children: {
|
|
391
|
+
type: "string",
|
|
392
|
+
description: "The Markdown content to render",
|
|
393
|
+
required: true,
|
|
394
|
+
},
|
|
395
|
+
parseIncompleteMarkdown: {
|
|
396
|
+
type: "boolean",
|
|
397
|
+
default: "true",
|
|
398
|
+
description: "Enable remend preprocessor for unterminated Markdown blocks",
|
|
399
|
+
},
|
|
400
|
+
shikiTheme: {
|
|
401
|
+
type: "[ThemeInput, ThemeInput]",
|
|
402
|
+
typeDescriptionLink: "https://shiki.style/themes",
|
|
403
|
+
default: "['github-light', 'github-dark']",
|
|
404
|
+
description: "Light and dark themes for code syntax highlighting",
|
|
405
|
+
},
|
|
406
|
+
}}
|
|
407
|
+
/>
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
This renders as:
|
|
411
|
+
|
|
412
|
+
<TypeTable
|
|
413
|
+
type={{
|
|
414
|
+
children: {
|
|
415
|
+
type: "string",
|
|
416
|
+
description: "The Markdown content to render",
|
|
417
|
+
required: true,
|
|
418
|
+
},
|
|
419
|
+
parseIncompleteMarkdown: {
|
|
420
|
+
type: "boolean",
|
|
421
|
+
default: "true",
|
|
422
|
+
description: "Enable remend preprocessor for unterminated Markdown blocks",
|
|
423
|
+
},
|
|
424
|
+
shikiTheme: {
|
|
425
|
+
type: "[ThemeInput, ThemeInput]",
|
|
426
|
+
typeDescriptionLink: "https://shiki.style/themes",
|
|
427
|
+
default: "['github-light', 'github-dark']",
|
|
428
|
+
description: "Light and dark themes for code syntax highlighting",
|
|
429
|
+
},
|
|
430
|
+
}}
|
|
431
|
+
/>
|
|
432
|
+
|
|
433
|
+
Optional props show a `?` after their name; set `required: true` to remove it. Set `deprecated: true` to mark a prop as deprecated, and `typeDescriptionLink` to link its type. Every value is part of the page HTML, so readers, search, and agents see the full reference.
|
|
434
|
+
|
|
383
435
|
### Task Lists
|
|
384
436
|
|
|
385
437
|
Create interactive task lists:
|
package/template/package.json
CHANGED