@vercel/geistdocs 2.15.3-canary.f771302 → 2.15.4

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 (47) hide show
  1. package/dist/cli/index.js +1 -1
  2. package/dist/internal/mdx-to-markdown.d.ts.map +1 -1
  3. package/dist/internal/mdx-to-markdown.js +0 -9
  4. package/dist/internal/page-actions-client.js +1 -1
  5. package/dist/internal/page-actions.d.ts +4 -4
  6. package/dist/internal/page-actions.d.ts.map +1 -1
  7. package/dist/internal/page-actions.js +1 -6
  8. package/dist/mdx.d.ts +25 -3
  9. package/dist/mdx.d.ts.map +1 -1
  10. package/dist/mdx.js +61 -8
  11. package/dist/mobile-docs-bar.js +1 -1
  12. package/dist/next.d.ts +1 -9
  13. package/dist/next.d.ts.map +1 -1
  14. package/dist/next.js +2 -25
  15. package/dist/pages/docs.d.ts +98 -5
  16. package/dist/pages/docs.d.ts.map +1 -1
  17. package/dist/pages/docs.js +250 -13
  18. package/dist/source-config.d.ts +1 -10
  19. package/dist/source-config.d.ts.map +1 -1
  20. package/dist/source-config.js +10 -20
  21. package/docs/agents.md +1 -1
  22. package/docs/llms.txt +1 -9
  23. package/docs/manifest.json +1 -1
  24. package/docs/pages/configuration.md +0 -8
  25. package/package.json +8 -28
  26. package/shared-theme.css +7 -1
  27. package/source-config.js +10 -24
  28. package/template/content/docs/configuration.mdx +0 -8
  29. package/template/package.json +1 -1
  30. package/dist/mdx-basic.d.ts +0 -27
  31. package/dist/mdx-basic.d.ts.map +0 -1
  32. package/dist/mdx-basic.js +0 -61
  33. package/dist/pages/docs-custom.d.ts +0 -111
  34. package/dist/pages/docs-custom.d.ts.map +0 -1
  35. package/dist/pages/docs-custom.js +0 -250
  36. package/native-mdx/LICENSE-mdxjs-rs +0 -22
  37. package/native-mdx/binaries/darwin-arm64.node +0 -0
  38. package/native-mdx/binaries/linux-x64-gnu.node +0 -0
  39. package/native-mdx/data-entry.d.mts +0 -15
  40. package/native-mdx/data-entry.mjs +0 -116
  41. package/native-mdx/data-projection.mjs +0 -205
  42. package/native-mdx/loader-data.cjs +0 -36
  43. package/native-mdx/loader-mdx.cjs +0 -9
  44. package/native-mdx/loader-mdx.mjs +0 -235
  45. package/native-mdx/native-binding.cjs +0 -25
  46. package/rehype-code-highlights.d.ts +0 -13
  47. package/rehype-code-highlights.js +0 -230
@@ -1,14 +1,251 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import Link from "fumadocs-core/link";
3
+ import { DocsBody as FumadocsDocsBody, DocsPage as FumadocsDocsPage, DocsTitle as FumadocsDocsTitle, } from "fumadocs-ui/layouts/docs/page";
4
+ import { notFound } from "next/navigation";
5
+ import { cache, } from "react";
6
+ import { cn } from "#geistdocs-ui/utils";
7
+ import { NativeDocsLink } from "../components/link";
8
+ import { getPublicPath, withBasePath } from "../config";
9
+ import { getDocsLinkClassName } from "../internal/docs-link-class-name";
10
+ import { DocsPageErrorBoundary } from "../internal/docs-page-error-boundary";
11
+ import { resolveDocumentTitle } from "../internal/document-title";
12
+ import { omitLanguageParam, resolveRouteLanguage } from "../internal/languages";
13
+ import { resolveLinkHref, stripBasePathFromHref } from "../internal/link-href";
14
+ import { resolvePageMarkdownUrl as resolveInternalPageMarkdownUrl } from "../internal/markdown-url.js";
15
+ import { createPageActions as createInternalPageActions } from "../internal/page-actions";
16
+ import { GeistdocsPageActions } from "../internal/page-actions-gate";
17
+ import { PageBreadcrumb } from "../internal/page-breadcrumb";
18
+ import { getPageFooterItems, PageFooter } from "../internal/page-footer";
19
+ import { filterPageTree } from "../internal/page-tree-visibility";
20
+ import { createRelativeDocsLink } from "../internal/relative-docs-link";
21
+ import { GeistdocsTableOfContents } from "../internal/table-of-contents";
22
+ import { GeistdocsTableOfContentsActions } from "../internal/toc-actions-client";
1
23
  import { createMdxComponents } from "../mdx";
2
- import { createDocsPage as createCustomDocsPage, } from "./docs-custom";
3
- // biome-ignore lint/performance/noBarrelFile: Keep the existing public API while the custom entry avoids the default registry.
4
- export { createPageActions, resolvePageMarkdownUrl, } from "./docs-custom";
5
- /** The default factory keeps the complete Geistdocs MDX component registry. */
6
- export const createDocsPage = (options) => createCustomDocsPage({
7
- ...options,
8
- mdx: (context) => ({
9
- ...createMdxComponents({ a: context.link }),
10
- ...(typeof options.mdx === "function"
11
- ? options.mdx(context)
12
- : options.mdx),
13
- }),
14
- });
24
+ import { getPageRobots, } from "../page-visibility";
25
+ const renderPrefetchedDocsLink = (siteUrl, basePath, { children, className, href, rel, target, ...props }) => {
26
+ const originalHref = String(href ?? "");
27
+ const resolved = resolveLinkHref(originalHref, siteUrl);
28
+ const linkHref = resolved.href === originalHref
29
+ ? resolved.href
30
+ : stripBasePathFromHref(resolved.href, basePath);
31
+ return (_jsx(Link, { ...props, className: getDocsLinkClassName(className), href: linkHref, prefetch: !resolved.external, rel: resolved.external ? rel : undefined, target: resolved.external ? target : undefined, children: children }));
32
+ };
33
+ export const resolvePageMarkdownUrl = (options) => resolveInternalPageMarkdownUrl(options);
34
+ /**
35
+ * The page's visible article parts carry `data-geistdocs-article` (`title`,
36
+ * `body`) so tools that read the rendered HTML (docs
37
+ * crawlers, parity checks against the Markdown route) can select the
38
+ * article without depending on Fumadocs' element ids or on class names.
39
+ * The marked elements hold content only: page actions, breadcrumbs, the
40
+ * table of contents, and the previous/next footer sit outside them.
41
+ */
42
+ const DocsTitle = ({ className, ...props }) => (_jsx(FumadocsDocsTitle, { className: cn("mb-4 text-balance", className), "data-geistdocs-article": "title", ...props }));
43
+ const DocsBody = ({ className, ...props }) => (_jsx(FumadocsDocsBody, { className: cn("mx-auto w-full", className), "data-geistdocs-article": "body", ...props }));
44
+ /** App-provided footer content below the table-of-contents actions. */
45
+ const TocFooterSlot = ({ children }) => children ? _jsx("div", { className: "mt-4", children: children }) : null;
46
+ const hasTableOfContentsActions = (config, extraActions) => config.pageActions?.scrollTop !== false ||
47
+ config.feedback?.enabled !== false ||
48
+ extraActions.length > 0;
49
+ const serializeParams = (params) => JSON.stringify(Object.entries(params)
50
+ .filter(([, value]) => value !== undefined)
51
+ .sort(([left], [right]) => left.localeCompare(right)));
52
+ export const createDocsPage = ({ canViewPage, config, source, mdx, pageActions = createInternalPageActions({ config }), filterStaticParams, getMarkdownUrl, getPageUrl, getPublicPageUrl, metadata, openGraph, renderTop, resolveLink, tableOfContent, tableOfContentPopover, }) => {
53
+ const DocsLink = renderPrefetchedDocsLink.bind(null, config.siteUrl, config.basePath);
54
+ const resolvePageUrls = (page, params) => {
55
+ const pageUrl = getPageUrl?.({ page, params }) ?? page.url;
56
+ const publicPageUrl = getPublicPageUrl?.({ page, params, pageUrl }) ??
57
+ getPublicPath(pageUrl, config.basePath);
58
+ const markdownUrl = getMarkdownUrl?.({ page, params, pageUrl, publicPageUrl }) ??
59
+ resolveInternalPageMarkdownUrl({
60
+ basePath: config.basePath,
61
+ isRootMountedPage: source.baseUrl === "/" && page.slugs.length === 0,
62
+ pageUrl,
63
+ publicPageUrl,
64
+ });
65
+ return { markdownUrl, pageUrl, publicPageUrl };
66
+ };
67
+ const getAccessState = cache(async (paramsKey) => {
68
+ const params = Object.fromEntries(JSON.parse(paramsKey));
69
+ const tree = source.source.getPageTree(params.lang);
70
+ if (!canViewPage) {
71
+ return { tree, visibleUrls: undefined };
72
+ }
73
+ const access = await Promise.all(source.source.getPages(params.lang).map(async (page) => ({
74
+ page,
75
+ visible: await canViewPage(page, { params, source }),
76
+ })));
77
+ const visibleUrls = new Set(access.filter(({ visible }) => visible).map(({ page }) => page.url));
78
+ const hiddenUrls = new Set(access.filter(({ visible }) => !visible).map(({ page }) => page.url));
79
+ return { tree: filterPageTree(tree, hiddenUrls), visibleUrls };
80
+ });
81
+ // Single-language apps have no [lang] segment, so params arrive without it.
82
+ const resolveParams = async (params) => {
83
+ const resolved = await params;
84
+ return {
85
+ ...resolved,
86
+ lang: resolveRouteLanguage(config, resolved.lang),
87
+ };
88
+ };
89
+ const getPage = async (params) => {
90
+ const page = source.source.getPage(params.slug, params.lang);
91
+ if (!page) {
92
+ notFound();
93
+ }
94
+ if (canViewPage) {
95
+ const { visibleUrls } = await getAccessState(serializeParams(params));
96
+ if (!visibleUrls?.has(page.url)) {
97
+ notFound();
98
+ }
99
+ }
100
+ return page;
101
+ };
102
+ const getPageTree = async (params) => (await getAccessState(serializeParams(params))).tree;
103
+ const PageContent = async ({ params }) => {
104
+ const resolvedParams = await resolveParams(params);
105
+ const { lang } = resolvedParams;
106
+ const page = await getPage(resolvedParams);
107
+ const pageTree = await getPageTree(resolvedParams);
108
+ const data = page.data;
109
+ const MDX = data.body;
110
+ const defaultLink = createRelativeDocsLink(source.source, page, DocsLink);
111
+ const link = resolveLink
112
+ ? resolveLink({
113
+ link: defaultLink,
114
+ nativeLink: NativeDocsLink,
115
+ page,
116
+ source,
117
+ })
118
+ : defaultLink;
119
+ const resolvedMdx = typeof mdx === "function" ? mdx({ link, page, source }) : mdx;
120
+ const { markdownUrl, pageUrl, publicPageUrl } = resolvePageUrls(page, resolvedParams);
121
+ const footerItems = getPageFooterItems(pageTree, page.url);
122
+ const pagesByUrl = getPageUrl
123
+ ? new Map(source.source.getPages(lang).map((entry) => [entry.url, entry]))
124
+ : undefined;
125
+ const resolveFooterItem = (item) => {
126
+ if (!(item && getPageUrl && pagesByUrl)) {
127
+ return item;
128
+ }
129
+ const itemPage = pagesByUrl.get(item.url);
130
+ if (!itemPage) {
131
+ return item;
132
+ }
133
+ return {
134
+ ...item,
135
+ url: getPageUrl({
136
+ page: itemPage,
137
+ params: { ...resolvedParams, slug: itemPage.slugs },
138
+ }),
139
+ };
140
+ };
141
+ const resolvedFooterItems = {
142
+ previous: resolveFooterItem(footerItems.previous),
143
+ next: resolveFooterItem(footerItems.next),
144
+ };
145
+ const markdown = pageActions.getExtraActions || renderTop
146
+ ? await source.getPageMarkdown(page)
147
+ : undefined;
148
+ const footerActions = markdown
149
+ ? (pageActions.getExtraActions?.({
150
+ markdown,
151
+ page: {
152
+ path: page.path,
153
+ url: publicPageUrl,
154
+ },
155
+ }) ?? [])
156
+ : [];
157
+ const hasTocActions = hasTableOfContentsActions(pageActions.config, footerActions);
158
+ const hasTocLinks = Boolean(data.toc?.length);
159
+ // Actions stay adjacent to the table of contents; the app-provided
160
+ // footer (promos and other custom content) renders below them.
161
+ const tocFooter = (_jsxs(_Fragment, { children: [hasTocLinks && hasTocActions ? (_jsx("div", { className: "mt-4 border-gray-alpha-400 border-t pt-4", children: _jsx("nav", { "aria-label": "Page actions", className: "flex min-w-0 flex-col gap-1", children: _jsx(GeistdocsTableOfContentsActions, { config: pageActions.config, extraActions: footerActions }) }) })) : null, _jsx(TocFooterSlot, { children: tableOfContent?.footer })] }));
162
+ const tocComponent = tableOfContent?.component ?? (_jsx(GeistdocsTableOfContents, { footer: tocFooter, header: tableOfContent?.header, toc: data.toc ?? [] }));
163
+ return (_jsxs(FumadocsDocsPage, { breadcrumb: {
164
+ component: _jsx(PageBreadcrumb, { tree: pageTree, url: page.url }),
165
+ }, footer: { component: _jsx(PageFooter, { ...resolvedFooterItems }) }, full: data.full, tableOfContent: {
166
+ enabled: true,
167
+ single: true,
168
+ ...tableOfContent,
169
+ component: tocComponent,
170
+ }, tableOfContentPopover: {
171
+ enabled: false,
172
+ ...tableOfContentPopover,
173
+ }, toc: data.toc, children: [renderTop?.({
174
+ data,
175
+ markdown: markdown ?? "",
176
+ markdownUrl,
177
+ page,
178
+ pageUrl,
179
+ publicPageUrl,
180
+ }), _jsxs("div", { className: "mb-8 flex flex-col-reverse gap-4 md:flex-row md:items-end md:justify-between", children: [_jsx(DocsTitle, { className: "mb-0 min-w-0", children: data.title }), _jsx(GeistdocsPageActions, { config: pageActions.config, only: "desktop", page: {
181
+ markdownUrl,
182
+ path: page.path,
183
+ title: data.title,
184
+ url: publicPageUrl,
185
+ } })] }), _jsx("div", { className: "-mt-6 mb-4 @min-[961px]:hidden", children: _jsx(GeistdocsPageActions, { config: pageActions.config, only: "mobile", page: {
186
+ markdownUrl,
187
+ path: page.path,
188
+ title: data.title,
189
+ url: publicPageUrl,
190
+ } }) }), _jsx(DocsBody, { children: _jsx(MDX, { components: {
191
+ ...createMdxComponents({ a: link }),
192
+ ...resolvedMdx,
193
+ } }) })] }));
194
+ };
195
+ const Page = ({ params }) => (_jsx(DocsPageErrorBoundary, { children: _jsx(PageContent, { params: params }) }));
196
+ const generateStaticParams = () => {
197
+ const params = source.source.generateParams();
198
+ const filtered = filterStaticParams
199
+ ? params.filter(filterStaticParams)
200
+ : params;
201
+ return omitLanguageParam(config, filtered);
202
+ };
203
+ const generateMetadata = async ({ params, }) => {
204
+ const resolvedParams = await resolveParams(params);
205
+ const page = await getPage(resolvedParams);
206
+ const pageTree = await getPageTree(resolvedParams);
207
+ const data = page.data;
208
+ const { markdownUrl, publicPageUrl } = resolvePageUrls(page, resolvedParams);
209
+ const openGraphImages = openGraph?.images === true
210
+ ? source.getPageImage(page).url
211
+ : openGraph?.images;
212
+ let canonicalUrl;
213
+ if (data.canonical) {
214
+ canonicalUrl = withBasePath(data.canonical, config.basePath);
215
+ }
216
+ else if (config.siteUrl) {
217
+ canonicalUrl = new URL(publicPageUrl, config.siteUrl).toString();
218
+ }
219
+ const defaultMetadata = {
220
+ title: resolveDocumentTitle({
221
+ pageTitle: data.title,
222
+ pageUrl: page.url,
223
+ tree: pageTree,
224
+ }),
225
+ description: data.description,
226
+ keywords: data.keywords,
227
+ robots: getPageRobots(page),
228
+ ...(openGraphImages ? { openGraph: { images: openGraphImages } } : {}),
229
+ alternates: {
230
+ canonical: canonicalUrl,
231
+ types: {
232
+ "text/markdown": markdownUrl,
233
+ },
234
+ },
235
+ };
236
+ return metadata
237
+ ? await metadata({
238
+ metadata: defaultMetadata,
239
+ page,
240
+ params: resolvedParams,
241
+ })
242
+ : defaultMetadata;
243
+ };
244
+ return {
245
+ Page,
246
+ getPageTree,
247
+ generateStaticParams,
248
+ generateMetadata,
249
+ };
250
+ };
251
+ export const createPageActions = createInternalPageActions;
@@ -3,15 +3,6 @@ import type { Pluggable } from "unified";
3
3
  import { z } from "zod";
4
4
  type FumadocsConfigInput = NonNullable<Parameters<typeof defineFumadocsConfig>[0]>;
5
5
  export interface GeistdocsSourceConfigOptions {
6
- /**
7
- * Code block highlighter. `highlights` tokenizes with @pierre/highlights'
8
- * Wasm lexers, keeping Shiki's HTML output and Fumadocs' code block
9
- * transformers. `shiki` uses Shiki's TextMate grammars, for languages
10
- * Highlights doesn't support or custom grammars.
11
- *
12
- * @defaultValue "highlights"
13
- */
14
- highlighter?: "shiki" | "highlights";
15
6
  mdxOptions?: DefaultMDXOptions;
16
7
  plugins?: FumadocsConfigInput["plugins"];
17
8
  }
@@ -90,7 +81,7 @@ export declare const geistdocsMetaSchema: z.ZodObject<{
90
81
  * Fumadocs, which places it among its defaults; a function receives those
91
82
  * defaults and returns the final list.
92
83
  */
93
- export declare const resolveGeistdocsRehypePlugins: (consumerPlugins: DefaultMDXOptions["rehypePlugins"], leadingPlugins?: Pluggable[]) => NonNullable<DefaultMDXOptions["rehypePlugins"]>;
84
+ export declare const resolveGeistdocsRehypePlugins: (consumerPlugins: DefaultMDXOptions["rehypePlugins"]) => NonNullable<DefaultMDXOptions["rehypePlugins"]>;
94
85
  export declare const defineGeistdocsSourceConfig: (config?: GeistdocsSourceConfigOptions) => import("fumadocs-mdx/config").GlobalConfig;
95
86
  export {};
96
87
  //# sourceMappingURL=source-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"source-config.d.ts","sourceRoot":"","sources":["../src/source-config.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,iBAAiB,EACtB,YAAY,IAAI,oBAAoB,EAGrC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,KAAK,mBAAmB,GAAG,WAAW,CACpC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAC3C,CAAC;AAEF,MAAM,WAAW,4BAA4B;IAC3C;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;IACrC,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,OAAO,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;CAC1C;AAQD;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B,GACxC,UAAU,SAAS,EAAE,EACrB,kBAAiB,SAAS,EAAO,KAChC,SAAS,EAgBX,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;CAsG3B,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwCrC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;iBAAa,CAAC;AAE9C;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,GACxC,iBAAiB,iBAAiB,CAAC,eAAe,CAAC,EACnD,iBAAgB,SAAS,EAAO,KAC/B,WAAW,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAShD,CAAC;AAEF,eAAO,MAAM,2BAA2B,GACtC,SAAQ,4BAAiC,+CAiC1C,CAAC"}
1
+ {"version":3,"file":"source-config.d.ts","sourceRoot":"","sources":["../src/source-config.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,iBAAiB,EACtB,YAAY,IAAI,oBAAoB,EAGrC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,KAAK,mBAAmB,GAAG,WAAW,CACpC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAC3C,CAAC;AAEF,MAAM,WAAW,4BAA4B;IAC3C,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,OAAO,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;CAC1C;AAQD;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B,GACxC,UAAU,SAAS,EAAE,EACrB,kBAAiB,SAAS,EAAO,KAChC,SAAS,EAgBX,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;CAsG3B,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwCrC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;iBAAa,CAAC;AAE9C;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,GACxC,iBAAiB,iBAAiB,CAAC,eAAe,CAAC,KAClD,WAAW,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAKhD,CAAC;AAEF,eAAO,MAAM,2BAA2B,GACtC,SAAQ,4BAAiC,+CA2B1C,CAAC"}
@@ -2,7 +2,6 @@ import { remarkHeading, remarkMdxMermaid, remarkSteps, remarkStructure, } from "
2
2
  import { defineConfig as defineFumadocsConfig, frontmatterSchema, metaSchema, } from "fumadocs-mdx/config";
3
3
  import lastModified from "fumadocs-mdx/plugins/last-modified";
4
4
  import { z } from "zod";
5
- import { rehypeCodeHighlights } from "../rehype-code-highlights.js";
6
5
  import { rehypeTaskListLabels } from "../rehype-task-list-labels.js";
7
6
  import { remarkDetails } from "../remark-details.js";
8
7
  import { getLastModified } from "./internal/last-modified.js";
@@ -170,37 +169,28 @@ export const geistdocsMetaSchema = metaSchema;
170
169
  * Fumadocs, which places it among its defaults; a function receives those
171
170
  * defaults and returns the final list.
172
171
  */
173
- export const resolveGeistdocsRehypePlugins = (consumerPlugins, leadingPlugins = []) => {
172
+ export const resolveGeistdocsRehypePlugins = (consumerPlugins) => {
174
173
  if (typeof consumerPlugins === "function") {
175
- return (defaults) => [
176
- ...leadingPlugins,
177
- ...consumerPlugins(defaults),
178
- rehypeTaskListLabels,
179
- ];
174
+ return (defaults) => [...consumerPlugins(defaults), rehypeTaskListLabels];
180
175
  }
181
- return [...leadingPlugins, ...(consumerPlugins ?? []), rehypeTaskListLabels];
176
+ return [...(consumerPlugins ?? []), rehypeTaskListLabels];
182
177
  };
183
178
  export const defineGeistdocsSourceConfig = (config = {}) => {
184
179
  const existingRemarkPlugins = Array.isArray(config.mdxOptions?.remarkPlugins)
185
180
  ? config.mdxOptions.remarkPlugins
186
181
  : [];
187
182
  const existingPlugins = Array.isArray(config.plugins) ? config.plugins : [];
188
- const { highlighter = "highlights", ...fumadocsConfig } = config;
189
- const rehypeCodeOptions = {
190
- ...config.mdxOptions?.rehypeCodeOptions,
191
- themes: { light: geistShikiTheme },
192
- defaultColor: "light",
193
- };
194
- // `highlights` swaps Shiki's tokenizer for @pierre/highlights; `shiki`
195
- // keeps Fumadocs' rehypeCode.
196
- const useHighlights = highlighter === "highlights";
197
183
  return defineFumadocsConfig({
198
- ...fumadocsConfig,
184
+ ...config,
199
185
  mdxOptions: {
200
186
  ...config.mdxOptions,
201
187
  remarkPlugins: (defaults) => resolveGeistdocsRemarkPlugins(defaults, existingRemarkPlugins),
202
- rehypePlugins: resolveGeistdocsRehypePlugins(config.mdxOptions?.rehypePlugins, useHighlights ? [[rehypeCodeHighlights, rehypeCodeOptions]] : []),
203
- rehypeCodeOptions: useHighlights ? false : rehypeCodeOptions,
188
+ rehypePlugins: resolveGeistdocsRehypePlugins(config.mdxOptions?.rehypePlugins),
189
+ rehypeCodeOptions: {
190
+ ...config.mdxOptions?.rehypeCodeOptions,
191
+ themes: { light: geistShikiTheme },
192
+ defaultColor: "light",
193
+ },
204
194
  },
205
195
  plugins: [
206
196
  lastModified({ versionControl: getLastModified }),
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.15.3-canary.f771302 so agents can understand the installed package without web access.
3
+ These docs are bundled with `@vercel/geistdocs` 2.15.4 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.15.3-canary.f771302.
3
+ These docs are bundled with `@vercel/geistdocs` 2.15.4.
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
@@ -1424,14 +1424,6 @@ export const docs = defineDocs({
1424
1424
  export default defineGeistdocsSourceConfig();
1425
1425
  ```
1426
1426
 
1427
- ### Code highlighter
1428
-
1429
- Code blocks are tokenized by [Highlights](https://diffs.com/highlights), which uses hand-written WebAssembly lexers, and rendered with the same HTML as Shiki: Geist colors, titles, icons, tabs, and `[!code ...]` notation all work. Languages without a built-in Highlights lexer render as plain text. To use Shiki's TextMate grammars instead, for example for an unsupported language, pass `highlighter: "shiki"`:
1430
-
1431
- ```ts title="source.config.ts"
1432
- export default defineGeistdocsSourceConfig({ highlighter: "shiki" });
1433
- ```
1434
-
1435
1427
  To serve docs from the site root, use `route: "/"` in `content` and `baseUrl: "/"` in `createSource`. Root-mounted docs need explicit `markdownRoutes`; Geistdocs does not infer a broad `/*path` mapping because it can capture homepages and non-docs app routes.
1436
1428
 
1437
1429
  ## Page URLs
@@ -467,5 +467,5 @@
467
467
  }
468
468
  ],
469
469
  "source": "apps/template/content/docs",
470
- "version": "2.15.3-canary.f771302"
470
+ "version": "2.15.4"
471
471
  }
@@ -285,14 +285,6 @@ export const docs = defineDocs({
285
285
  export default defineGeistdocsSourceConfig();
286
286
  ```
287
287
 
288
- ### Code highlighter
289
-
290
- Code blocks are tokenized by [Highlights](https://diffs.com/highlights), which uses hand-written WebAssembly lexers, and rendered with the same HTML as Shiki: Geist colors, titles, icons, tabs, and `[!code ...]` notation all work. Languages without a built-in Highlights lexer render as plain text. To use Shiki's TextMate grammars instead, for example for an unsupported language, pass `highlighter: "shiki"`:
291
-
292
- ```ts title="source.config.ts"
293
- export default defineGeistdocsSourceConfig({ highlighter: "shiki" });
294
- ```
295
-
296
288
  To serve docs from the site root, use `route: "/"` in `content` and `baseUrl: "/"` in `createSource`. Root-mounted docs need explicit `markdownRoutes`; Geistdocs does not infer a broad `/*path` mapping because it can capture homepages and non-docs app routes.
297
289
 
298
290
  ## Page URLs
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vercel/geistdocs",
3
3
  "description": "Runtime and CLI for Geistdocs projects.",
4
- "version": "2.15.3-canary.f771302",
4
+ "version": "2.15.4",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -27,8 +27,6 @@
27
27
  "cli.js",
28
28
  "dist",
29
29
  "docs",
30
- "rehype-code-highlights.d.ts",
31
- "rehype-code-highlights.js",
32
30
  "rehype-task-list-labels.d.ts",
33
31
  "rehype-task-list-labels.js",
34
32
  "remark-details.d.ts",
@@ -39,8 +37,7 @@
39
37
  "shared-theme.css",
40
38
  "styles.css",
41
39
  "theme.css",
42
- "LICENSE",
43
- "native-mdx"
40
+ "LICENSE"
44
41
  ],
45
42
  "exports": {
46
43
  "./changelog": {
@@ -302,25 +299,7 @@
302
299
  },
303
300
  "./styles.css": "./styles.css",
304
301
  "./theme.css": "./theme.css",
305
- "./package.json": "./package.json",
306
- "./pages/docs/custom": {
307
- "types": "./dist/pages/docs-custom.d.ts",
308
- "default": "./dist/pages/docs-custom.js"
309
- },
310
- "./mdx/basic": {
311
- "types": "./dist/mdx-basic.d.ts",
312
- "default": "./dist/mdx-basic.js"
313
- },
314
- "./native-mdx": "./native-mdx/loader-mdx.cjs",
315
- "./native-mdx/data-loader": "./native-mdx/loader-data.cjs",
316
- "./native-mdx/data-entry": {
317
- "types": "./native-mdx/data-entry.d.mts",
318
- "import": "./native-mdx/data-entry.mjs"
319
- }
320
- },
321
- "scripts": {
322
- "build": "rm -rf dist docs template && node ./scripts/bundle-template.mjs && node ./scripts/bundle-docs.mjs && tsc -p tsconfig.runtime.json && tsup --config tsup.config.cli.ts",
323
- "dev": "tsc -p tsconfig.runtime.json --watch --preserveWatchOutput"
302
+ "./package.json": "./package.json"
324
303
  },
325
304
  "dependencies": {
326
305
  "@ai-sdk/react": "^3.0.134",
@@ -328,8 +307,6 @@
328
307
  "@modelcontextprotocol/server": "^2.0.0",
329
308
  "@next/env": "16.3.3",
330
309
  "@orama/tokenizers": "^3.1.16",
331
- "@pierre/highlights": "0.5.1",
332
- "@shikijs/rehype": "3.19.0",
333
310
  "@streamdown/cjk": "^1.0.1",
334
311
  "@types/mdx": "^2.0.13",
335
312
  "@types/react": "^19.2.7",
@@ -358,7 +335,6 @@
358
335
  "remark-mdx": "^3.1.1",
359
336
  "remark-parse": "^11.0.0",
360
337
  "remark-stringify": "^11.0.0",
361
- "shiki": "3.19.0",
362
338
  "sonner": "^2.0.8",
363
339
  "streamdown": "^2.1.0",
364
340
  "tailwind-merge": "^3.4.0",
@@ -388,5 +364,9 @@
388
364
  "react-dom": "^19.2.3",
389
365
  "tsup": "^8.5.1",
390
366
  "typescript": "^5.9.3"
367
+ },
368
+ "scripts": {
369
+ "build": "rm -rf dist docs template && node ./scripts/bundle-template.mjs && node ./scripts/bundle-docs.mjs && tsc -p tsconfig.runtime.json && tsup --config tsup.config.cli.ts",
370
+ "dev": "tsc -p tsconfig.runtime.json --watch --preserveWatchOutput"
391
371
  }
392
- }
372
+ }
package/shared-theme.css CHANGED
@@ -281,7 +281,13 @@ button:not(:disabled, [aria-disabled="true"]) {
281
281
  }
282
282
  }
283
283
 
284
- @container (max-width: 960px) {
284
+ @container (width < 961px) {
285
+ #nd-page {
286
+ max-width: none;
287
+ padding-inline: 1.5rem;
288
+ transform: none;
289
+ }
290
+
285
291
  #nd-page > .text-gray-900:first-child {
286
292
  display: none;
287
293
  }
package/source-config.js CHANGED
@@ -15,7 +15,6 @@ import {
15
15
  } from "fumadocs-mdx/config";
16
16
  import lastModified from "fumadocs-mdx/plugins/last-modified";
17
17
  import { z } from "zod";
18
- import { rehypeCodeHighlights } from "./rehype-code-highlights.js";
19
18
  import { rehypeTaskListLabels } from "./rehype-task-list-labels.js";
20
19
  import { remarkDetails } from "./remark-details.js";
21
20
 
@@ -277,18 +276,11 @@ export const resolveGeistdocsRemarkPlugins = (
277
276
  // Mirrors src/source-config.ts. Geistdocs rehype plugins run after the
278
277
  // consumer's: an array is handed to Fumadocs, which places it among its
279
278
  // defaults; a function receives those defaults and returns the final list.
280
- export const resolveGeistdocsRehypePlugins = (
281
- consumerPlugins,
282
- leadingPlugins = []
283
- ) => {
279
+ export const resolveGeistdocsRehypePlugins = (consumerPlugins) => {
284
280
  if (typeof consumerPlugins === "function") {
285
- return (defaults) => [
286
- ...leadingPlugins,
287
- ...consumerPlugins(defaults),
288
- rehypeTaskListLabels,
289
- ];
281
+ return (defaults) => [...consumerPlugins(defaults), rehypeTaskListLabels];
290
282
  }
291
- return [...leadingPlugins, ...(consumerPlugins ?? []), rehypeTaskListLabels];
283
+ return [...(consumerPlugins ?? []), rehypeTaskListLabels];
292
284
  };
293
285
 
294
286
  export const defineGeistdocsSourceConfig = (config = {}) => {
@@ -296,27 +288,21 @@ export const defineGeistdocsSourceConfig = (config = {}) => {
296
288
  ? config.mdxOptions.remarkPlugins
297
289
  : [];
298
290
  const existingPlugins = Array.isArray(config.plugins) ? config.plugins : [];
299
- const { highlighter = "highlights", ...fumadocsConfig } = config;
300
- const rehypeCodeOptions = {
301
- ...config.mdxOptions?.rehypeCodeOptions,
302
- themes: { light: geistShikiTheme },
303
- defaultColor: "light",
304
- };
305
- // `highlights` swaps Shiki's tokenizer for @pierre/highlights; `shiki`
306
- // keeps Fumadocs' rehypeCode.
307
- const useHighlights = highlighter === "highlights";
308
291
 
309
292
  return defineFumadocsConfig({
310
- ...fumadocsConfig,
293
+ ...config,
311
294
  mdxOptions: {
312
295
  ...config.mdxOptions,
313
296
  remarkPlugins: (defaults) =>
314
297
  resolveGeistdocsRemarkPlugins(defaults, existingRemarkPlugins),
315
298
  rehypePlugins: resolveGeistdocsRehypePlugins(
316
- config.mdxOptions?.rehypePlugins,
317
- useHighlights ? [[rehypeCodeHighlights, rehypeCodeOptions]] : []
299
+ config.mdxOptions?.rehypePlugins
318
300
  ),
319
- rehypeCodeOptions: useHighlights ? false : rehypeCodeOptions,
301
+ rehypeCodeOptions: {
302
+ ...config.mdxOptions?.rehypeCodeOptions,
303
+ themes: { light: geistShikiTheme },
304
+ defaultColor: "light",
305
+ },
320
306
  },
321
307
  plugins: [
322
308
  lastModified({ versionControl: getLastModified }),
@@ -283,14 +283,6 @@ export const docs = defineDocs({
283
283
  export default defineGeistdocsSourceConfig();
284
284
  ```
285
285
 
286
- ### Code highlighter
287
-
288
- Code blocks are tokenized by [Highlights](https://diffs.com/highlights), which uses hand-written WebAssembly lexers, and rendered with the same HTML as Shiki: Geist colors, titles, icons, tabs, and `[!code ...]` notation all work. Languages without a built-in Highlights lexer render as plain text. To use Shiki's TextMate grammars instead, for example for an unsupported language, pass `highlighter: "shiki"`:
289
-
290
- ```ts title="source.config.ts"
291
- export default defineGeistdocsSourceConfig({ highlighter: "shiki" });
292
- ```
293
-
294
286
  To serve docs from the site root, use `route: "/"` in `content` and `baseUrl: "/"` in `createSource`. Root-mounted docs need explicit `markdownRoutes`; Geistdocs does not infer a broad `/*path` mapping because it can capture homepages and non-docs app routes.
295
287
 
296
288
  ## Page URLs
@@ -17,7 +17,7 @@
17
17
  "@streamdown/code": "^1.0.1",
18
18
  "@vercel/agent-readability": "^0.7.0",
19
19
  "@vercel/analytics": "^1.6.1",
20
- "@vercel/geistdocs": "2.15.3-canary.f771302",
20
+ "@vercel/geistdocs": "2.15.4",
21
21
  "@vercel/speed-insights": "^1.3.1",
22
22
  "ai": "^6.0.132",
23
23
  "clsx": "^2.1.1",
@@ -1,27 +0,0 @@
1
- import type { MDXComponents } from "mdx/types";
2
- import type { GeistdocsSourceConfigOptions as SourceConfigOptions } from "./source-config";
3
- export declare const geistShikiTheme: {
4
- name: string;
5
- type: "dark";
6
- colors: {
7
- "editor.foreground": string;
8
- "editor.background": string;
9
- };
10
- tokenColors: ({
11
- scope: string[];
12
- settings: {
13
- foreground: string;
14
- };
15
- } | {
16
- scope: string;
17
- settings: {
18
- foreground: string;
19
- };
20
- })[];
21
- };
22
- export type GeistdocsSourceConfigOptions = SourceConfigOptions;
23
- export type GeistdocsMDXComponents = MDXComponents;
24
- export declare const getGeistdocsMDXComponents: (components?: GeistdocsMDXComponents) => GeistdocsMDXComponents;
25
- export declare const createMdxComponents: (components?: GeistdocsMDXComponents) => GeistdocsMDXComponents;
26
- export declare const mergeGeistdocsMDXComponents: (...componentSets: Array<GeistdocsMDXComponents | undefined>) => GeistdocsMDXComponents;
27
- //# sourceMappingURL=mdx-basic.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mdx-basic.d.ts","sourceRoot":"","sources":["../src/mdx-basic.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAoB/C,OAAO,KAAK,EAAE,4BAA4B,IAAI,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAK3F,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;CAAa,CAAC;AAC1C,MAAM,MAAM,4BAA4B,GAAG,mBAAmB,CAAC;AAE/D,MAAM,MAAM,sBAAsB,GAAG,aAAa,CAAC;AAEnD,eAAO,MAAM,yBAAyB,GACpC,aAAa,sBAAsB,KAClC,sBA2DD,CAAC;AAEH,eAAO,MAAM,mBAAmB,GAC9B,aAAa,sBAAsB,KAClC,sBAA+D,CAAC;AAEnE,eAAO,MAAM,2BAA2B,GACtC,GAAG,eAAe,KAAK,CAAC,sBAAsB,GAAG,SAAS,CAAC,KAC1D,sBACkD,CAAC"}