@farming-labs/docs 0.1.1-beta.1 → 0.1.1-beta.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.
@@ -1,1433 +0,0 @@
1
- //#region src/types.d.ts
2
- /**
3
- * Theme / UI configuration types for the docs framework.
4
- * Inspired by Fumadocs: https://github.com/fuma-nama/fumadocs
5
- */
6
- /**
7
- * Fine-grained UI configuration for docs themes.
8
- *
9
- * Theme authors define defaults for these values in their `createTheme` call.
10
- * End users can override any value when calling the theme factory.
11
- *
12
- * @example
13
- * ```ts
14
- * const myTheme = createTheme({
15
- * name: "my-theme",
16
- * ui: {
17
- * colors: { primary: "#6366f1", background: "#0a0a0a" },
18
- * radius: "0px",
19
- * codeBlock: { showLineNumbers: true, theme: "github-dark" },
20
- * sidebar: { width: 280, style: "bordered" },
21
- * },
22
- * });
23
- * ```
24
- */
25
- /**
26
- * Font style configuration for a single text element (heading, body, etc.).
27
- *
28
- * @example
29
- * ```ts
30
- * h1: { size: "2.25rem", weight: 700, lineHeight: "1.2", letterSpacing: "-0.02em" }
31
- * ```
32
- */
33
- interface FontStyle {
34
- /** CSS `font-size` value (e.g. "2.25rem", "36px", "clamp(1.8rem, 3vw, 2.5rem)") */
35
- size?: string;
36
- /** CSS `font-weight` value (e.g. 700, "bold", "600") */
37
- weight?: string | number;
38
- /** CSS `line-height` value (e.g. "1.2", "1.5", "28px") */
39
- lineHeight?: string;
40
- /** CSS `letter-spacing` value (e.g. "-0.02em", "0.05em") */
41
- letterSpacing?: string;
42
- }
43
- /**
44
- * Typography configuration for the docs.
45
- *
46
- * @example
47
- * ```ts
48
- * typography: {
49
- * font: {
50
- * style: { sans: "Inter, sans-serif", mono: "JetBrains Mono, monospace" },
51
- * h1: { size: "2.25rem", weight: 700, letterSpacing: "-0.02em" },
52
- * h2: { size: "1.75rem", weight: 600 },
53
- * body: { size: "1rem", lineHeight: "1.75" },
54
- * },
55
- * }
56
- * ```
57
- */
58
- interface TypographyConfig {
59
- /**
60
- * Font configuration.
61
- */
62
- font?: {
63
- /**
64
- * Font family definitions.
65
- */
66
- style?: {
67
- /** Sans-serif font family — used for body text, headings, and UI elements. */sans?: string; /** Monospace font family — used for code blocks, inline code, and terminal output. */
68
- mono?: string;
69
- }; /** Heading 1 (`<h1>`) style overrides */
70
- h1?: FontStyle; /** Heading 2 (`<h2>`) style overrides */
71
- h2?: FontStyle; /** Heading 3 (`<h3>`) style overrides */
72
- h3?: FontStyle; /** Heading 4 (`<h4>`) style overrides */
73
- h4?: FontStyle; /** Body text style */
74
- body?: FontStyle; /** Small text style (captions, meta text) */
75
- small?: FontStyle;
76
- };
77
- }
78
- interface UIConfig {
79
- /**
80
- * Theme color tokens.
81
- *
82
- * These are mapped to `--color-fd-*` CSS variables at runtime.
83
- * Accepts any valid CSS color value (hex, rgb, oklch, hsl, etc.).
84
- *
85
- * @example
86
- * ```ts
87
- * colors: {
88
- * primary: "oklch(0.72 0.19 149)", // green primary
89
- * primaryForeground: "#ffffff", // white text on primary
90
- * accent: "hsl(220 80% 60%)", // blue accent
91
- * }
92
- * ```
93
- */
94
- colors?: {
95
- primary?: string;
96
- primaryForeground?: string;
97
- background?: string;
98
- foreground?: string;
99
- muted?: string;
100
- mutedForeground?: string;
101
- border?: string;
102
- card?: string;
103
- cardForeground?: string;
104
- accent?: string;
105
- accentForeground?: string;
106
- secondary?: string;
107
- secondaryForeground?: string;
108
- popover?: string;
109
- popoverForeground?: string;
110
- ring?: string;
111
- };
112
- /**
113
- * Typography settings — font families, heading sizes, weights, etc.
114
- *
115
- * @example
116
- * ```ts
117
- * typography: {
118
- * font: {
119
- * style: { sans: "Inter, sans-serif", mono: "JetBrains Mono, monospace" },
120
- * h1: { size: "2.25rem", weight: 700, letterSpacing: "-0.02em" },
121
- * body: { size: "1rem", lineHeight: "1.75" },
122
- * },
123
- * }
124
- * ```
125
- */
126
- typography?: TypographyConfig;
127
- /**
128
- * Global border-radius. Maps to CSS `--radius`.
129
- * Use "0px" for sharp corners, "0.5rem" for rounded, etc.
130
- */
131
- radius?: string;
132
- /** Layout dimensions */
133
- layout?: {
134
- contentWidth?: number;
135
- sidebarWidth?: number;
136
- tocWidth?: number;
137
- toc?: {
138
- enabled?: boolean;
139
- depth?: number;
140
- /**
141
- * Visual style of the TOC indicator.
142
- * - `"default"` — highlight active link text color only
143
- * - `"directional"` — animated thumb bar that tracks active headings (fumadocs style)
144
- * @default "default"
145
- */
146
- style?: "default" | "directional";
147
- };
148
- header?: {
149
- height?: number;
150
- sticky?: boolean;
151
- };
152
- };
153
- /** Code block rendering config */
154
- codeBlock?: {
155
- /** Show line numbers in code blocks @default false */showLineNumbers?: boolean; /** Show copy button @default true */
156
- showCopyButton?: boolean; /** Shiki theme name for syntax highlighting */
157
- theme?: string; /** Dark mode shiki theme (for dual-theme setups) */
158
- darkTheme?: string;
159
- };
160
- /** Sidebar styling hints (consumed by theme CSS) */
161
- sidebar?: {
162
- /**
163
- * Visual style of the sidebar.
164
- * - "default" — standard fumadocs sidebar
165
- * - "bordered" — visible bordered sections (like better-auth)
166
- * - "floating" — floating card sidebar
167
- */
168
- style?: "default" | "bordered" | "floating"; /** Background color override */
169
- background?: string; /** Border color override */
170
- borderColor?: string;
171
- };
172
- /** Card styling */
173
- card?: {
174
- /** Whether cards have visible borders @default true */bordered?: boolean; /** Card background color override */
175
- background?: string;
176
- };
177
- /** Default props/variants for built-in MDX components (Callout, CodeBlock, Tabs, HoverLink, etc.) */
178
- components?: {
179
- [key: string]: Record<string, unknown> | ((defaults: unknown) => unknown);
180
- };
181
- }
182
- /**
183
- * A docs theme configuration.
184
- *
185
- * Theme authors create these with `createTheme()`. The `name` identifies the
186
- * theme (useful for CSS scoping, debugging, analytics). The `ui` object holds
187
- * all visual configuration.
188
- *
189
- * @example
190
- * ```ts
191
- * import { createTheme } from "@farming-labs/docs";
192
- *
193
- * export const myTheme = createTheme({
194
- * name: "my-theme",
195
- * ui: {
196
- * colors: { primary: "#ff4d8d" },
197
- * radius: "0px",
198
- * },
199
- * });
200
- * ```
201
- */
202
- interface DocsTheme {
203
- /** Unique name for this theme (used for CSS scoping and debugging) */
204
- name?: string;
205
- /** UI configuration — colors, typography, layout, components */
206
- ui?: UIConfig;
207
- /**
208
- * @internal
209
- * User-provided color overrides tracked by `createTheme`.
210
- * Only these colors are emitted as inline CSS variables at runtime.
211
- * Preset defaults stay in the theme's CSS file.
212
- */
213
- _userColorOverrides?: Record<string, string>;
214
- }
215
- interface DocsMetadata {
216
- titleTemplate?: string;
217
- description?: string;
218
- twitterCard?: "summary" | "summary_large_image";
219
- }
220
- interface OGConfig {
221
- enabled?: boolean;
222
- type?: "static" | "dynamic";
223
- endpoint?: string;
224
- defaultImage?: string;
225
- }
226
- /** Single image entry for Open Graph (frontmatter or Next metadata). */
227
- interface OpenGraphImage {
228
- url: string;
229
- width?: number;
230
- height?: number;
231
- }
232
- /** Open Graph block in page frontmatter. When present, used as-is for metadata (replaces generated OG). */
233
- interface PageOpenGraph {
234
- images?: OpenGraphImage[];
235
- title?: string;
236
- description?: string;
237
- }
238
- /** Twitter card block in page frontmatter. When present, used as-is for metadata (replaces generated twitter). */
239
- interface PageTwitter {
240
- card?: "summary" | "summary_large_image";
241
- images?: string[];
242
- title?: string;
243
- description?: string;
244
- }
245
- interface PageFrontmatter {
246
- title: string;
247
- description?: string;
248
- tags?: string[];
249
- icon?: string;
250
- /** Path to custom OG image for this page (shorthand). Ignored if `openGraph` is set. */
251
- ogImage?: string;
252
- /** Full Open Graph object. When set, replaces any generated OG from config (e.g. dynamic endpoint). */
253
- openGraph?: PageOpenGraph;
254
- /** Full Twitter card object. When set, replaces any generated twitter from config. */
255
- twitter?: PageTwitter;
256
- /** Sort order in the sidebar. Lower numbers appear first. Pages without `order` are sorted alphabetically after ordered pages. */
257
- order?: number;
258
- }
259
- interface DocsNav {
260
- /**
261
- * Sidebar title — a plain string or a React element (e.g. a div with an icon).
262
- *
263
- * @example
264
- * ```tsx
265
- * // Simple string
266
- * nav: { title: "My Docs" }
267
- *
268
- * // React element with icon
269
- * nav: {
270
- * title: <div style={{ display: "flex", alignItems: "center", gap: 8 }}>
271
- * <Rocket size={18} /> Example Docs
272
- * </div>
273
- * }
274
- * ```
275
- */
276
- title?: unknown;
277
- /** URL the title links to. Defaults to `/{entry}`. */
278
- url?: string;
279
- }
280
- interface ThemeToggleConfig {
281
- /**
282
- * Whether to show the light/dark theme toggle in the sidebar.
283
- * @default true
284
- */
285
- enabled?: boolean;
286
- /**
287
- * The default / forced theme when the toggle is hidden.
288
- * Only applies when `enabled` is `false`.
289
- * @default "system"
290
- *
291
- * @example
292
- * ```ts
293
- * // Hide toggle, force dark mode
294
- * themeToggle: { enabled: false, default: "dark" }
295
- * ```
296
- */
297
- default?: "light" | "dark" | "system";
298
- /**
299
- * Toggle mode — show only light/dark, or include a system option.
300
- * @default "light-dark"
301
- */
302
- mode?: "light-dark" | "light-dark-system";
303
- }
304
- interface BreadcrumbConfig {
305
- /**
306
- * Whether to show the breadcrumb navigation above page content.
307
- * @default true
308
- */
309
- enabled?: boolean;
310
- /**
311
- * Custom breadcrumb component. Receives the default breadcrumb as children
312
- * so you can wrap/modify it.
313
- *
314
- * @example
315
- * ```tsx
316
- * breadcrumb: {
317
- * component: ({ items }) => <MyBreadcrumb items={items} />,
318
- * }
319
- * ```
320
- */
321
- component?: unknown;
322
- }
323
- /**
324
- * A leaf page in the sidebar tree.
325
- */
326
- interface SidebarPageNode {
327
- type: "page";
328
- name: string;
329
- url: string;
330
- icon?: unknown;
331
- }
332
- /**
333
- * A folder (group) in the sidebar tree. May contain child pages
334
- * and nested folders, forming a recursive hierarchy.
335
- */
336
- interface SidebarFolderNode {
337
- type: "folder";
338
- name: string;
339
- icon?: unknown;
340
- /** Index page for this folder (the folder's own landing page). */
341
- index?: SidebarPageNode;
342
- /** Child pages and sub-folders. */
343
- children: SidebarNode[];
344
- /** Whether this folder section is collapsible. */
345
- collapsible?: boolean;
346
- /** Whether this folder starts open. */
347
- defaultOpen?: boolean;
348
- }
349
- /** A node in the sidebar tree — either a page or a folder. */
350
- type SidebarNode = SidebarPageNode | SidebarFolderNode;
351
- /** The full sidebar tree passed to custom sidebar components. */
352
- interface SidebarTree {
353
- name: string;
354
- children: SidebarNode[];
355
- }
356
- /**
357
- * Props passed to a custom sidebar component.
358
- *
359
- * Contains all the information needed to build a fully custom sidebar:
360
- * the complete page tree with parent-child relationships, and the
361
- * current sidebar configuration.
362
- */
363
- interface SidebarComponentProps {
364
- /** Full page tree with all parent-child-folder relationships. */
365
- tree: SidebarTree;
366
- /** Whether folders are collapsible. */
367
- collapsible: boolean;
368
- /** Whether folders are rendered flat (Mintlify-style). */
369
- flat: boolean;
370
- }
371
- interface SidebarConfig {
372
- /**
373
- * Whether to show the sidebar.
374
- * @default true
375
- */
376
- enabled?: boolean;
377
- /**
378
- * Custom sidebar component to replace the default navigation.
379
- *
380
- * **Next.js** — Pass a render function that receives `SidebarComponentProps`:
381
- * ```tsx
382
- * sidebar: {
383
- * component: ({ tree, collapsible, flat }) => (
384
- * <MySidebar tree={tree} />
385
- * ),
386
- * }
387
- * ```
388
- *
389
- * **Astro** — Use the `sidebar` named slot on `<DocsLayout>`:
390
- * ```astro
391
- * <DocsLayout tree={tree} config={config}>
392
- * <MySidebar slot="sidebar" tree={tree} />
393
- * <slot />
394
- * </DocsLayout>
395
- * ```
396
- *
397
- * **SvelteKit** — Use the `sidebar` snippet on `<DocsLayout>`:
398
- * ```svelte
399
- * <DocsLayout {tree} {config}>
400
- * {#snippet sidebar({ tree, isActive })}
401
- * <MySidebarNav {tree} {isActive} />
402
- * {/snippet}
403
- * {@render children()}
404
- * </DocsLayout>
405
- * ```
406
- *
407
- * **Nuxt / Vue** — Use the `#sidebar` scoped slot on `<DocsLayout>`:
408
- * ```vue
409
- * <DocsLayout :tree="tree" :config="config">
410
- * <template #sidebar="{ tree, isActive }">
411
- * <MySidebarNav :tree="tree" :is-active="isActive" />
412
- * </template>
413
- * <DocsContent />
414
- * </DocsLayout>
415
- * ```
416
- */
417
- component?: (props: SidebarComponentProps) => unknown;
418
- /**
419
- * Sidebar footer content (rendered below navigation items).
420
- */
421
- footer?: unknown;
422
- /**
423
- * Sidebar banner content (rendered above navigation items).
424
- */
425
- banner?: unknown;
426
- /**
427
- * Whether the sidebar is collapsible on desktop.
428
- * @default true
429
- */
430
- collapsible?: boolean;
431
- /**
432
- * When true, all folder children are rendered flat in the sidebar
433
- * (no collapsible sections). Folder index pages appear as category
434
- * headings with all children listed directly below them.
435
- *
436
- * This creates a Mintlify-style sidebar where all navigation items
437
- * are always visible.
438
- *
439
- * @default false
440
- */
441
- flat?: boolean;
442
- }
443
- /**
444
- * A single "Open in …" provider shown in the Open dropdown.
445
- *
446
- * @example
447
- * ```ts
448
- * { name: "Claude", icon: <ClaudeIcon />, urlTemplate: "https://claude.ai?url={url}" }
449
- * ```
450
- */
451
- interface OpenDocsProvider {
452
- /** Display name (e.g. "ChatGPT", "Claude", "Cursor") */
453
- name: string;
454
- /** Icon element rendered next to the name */
455
- icon?: unknown;
456
- /**
457
- * URL template. Placeholders:
458
- * - `{url}` — current page URL (encoded).
459
- * - `{mdxUrl}` — page URL with `.mdx` suffix (encoded).
460
- * - `{githubUrl}` — GitHub edit URL for the current page (same as "Edit on GitHub"). Requires `github` in config.
461
- *
462
- * @example "https://claude.ai/new?q=Read+this+doc:+{url}"
463
- * @example "{githubUrl}" — open current page file on GitHub (edit view)
464
- */
465
- urlTemplate: string;
466
- }
467
- /**
468
- * Configuration for the "Open in …" dropdown that lets users
469
- * send the current page to an LLM or external tool.
470
- *
471
- * @example
472
- * ```ts
473
- * openDocs: {
474
- * enabled: true,
475
- * providers: [
476
- * { name: "ChatGPT", icon: <ChatGPTIcon />, urlTemplate: "https://chatgpt.com/?q={url}" },
477
- * { name: "Claude", icon: <ClaudeIcon />, urlTemplate: "https://claude.ai/new?q={url}" },
478
- * ],
479
- * }
480
- * ```
481
- */
482
- interface OpenDocsConfig {
483
- /** Whether to show the "Open" dropdown. @default false */
484
- enabled?: boolean;
485
- /**
486
- * List of LLM / tool providers to show in the dropdown.
487
- * If not provided, a sensible default list is used.
488
- */
489
- providers?: OpenDocsProvider[];
490
- }
491
- /**
492
- * Configuration for the "Copy Markdown" button that copies
493
- * the current page's content as Markdown to the clipboard.
494
- */
495
- interface CopyMarkdownConfig {
496
- /** Whether to show the "Copy Markdown" button. @default false */
497
- enabled?: boolean;
498
- }
499
- /**
500
- * Page-level action buttons shown above the page content
501
- * (e.g. "Copy Markdown", "Open in …" dropdown).
502
- *
503
- * @example
504
- * ```ts
505
- * pageActions: {
506
- * copyMarkdown: { enabled: true },
507
- * openDocs: {
508
- * enabled: true,
509
- * providers: [
510
- * { name: "Claude", urlTemplate: "https://claude.ai/new?q={url}" },
511
- * ],
512
- * },
513
- * }
514
- * ```
515
- */
516
- interface PageActionsConfig {
517
- /** "Copy Markdown" button */
518
- copyMarkdown?: boolean | CopyMarkdownConfig;
519
- /** "Open in …" dropdown with LLM / tool providers */
520
- openDocs?: boolean | OpenDocsConfig;
521
- /**
522
- * Where to render the page action buttons relative to the page title.
523
- *
524
- * - `"below-title"` — render below the first `<h1>` heading (default)
525
- * - `"above-title"` — render above the page title / content
526
- *
527
- * @default "below-title"
528
- */
529
- position?: "above-title" | "below-title";
530
- /**
531
- * Horizontal alignment of page action buttons.
532
- *
533
- * - `"left"` — align to the left (default)
534
- * - `"right"` — align to the right
535
- *
536
- * @default "left"
537
- */
538
- alignment?: "left" | "right";
539
- }
540
- /**
541
- * Configuration for the "Last updated" date display.
542
- *
543
- * @example
544
- * ```ts
545
- * lastUpdated: { position: "below-title" }
546
- * ```
547
- */
548
- /**
549
- * Configuration for auto-generated `/llms.txt` and `/llms-full.txt` routes.
550
- *
551
- * @see https://llmstxt.org
552
- */
553
- interface LlmsTxtConfig {
554
- /**
555
- * Whether to enable llms.txt generation.
556
- * @default true
557
- */
558
- enabled?: boolean;
559
- /**
560
- * Base URL for your docs site (used to build absolute links in llms.txt).
561
- * @example "https://docs.example.com"
562
- */
563
- baseUrl?: string;
564
- /**
565
- * Site title shown at the top of llms.txt.
566
- * Falls back to `nav.title` if not set.
567
- */
568
- siteTitle?: string;
569
- /**
570
- * Site description shown below the title.
571
- */
572
- siteDescription?: string;
573
- }
574
- interface LastUpdatedConfig {
575
- /**
576
- * Whether to show the "Last updated" date.
577
- * @default true
578
- */
579
- enabled?: boolean;
580
- /**
581
- * Where to render the "Last updated" date.
582
- *
583
- * - `"footer"` — next to the "Edit on GitHub" link at the bottom (default)
584
- * - `"below-title"` — below the page title/description, above the content
585
- *
586
- * @default "footer"
587
- */
588
- position?: "footer" | "below-title";
589
- }
590
- /**
591
- * GitHub repository configuration for "Edit on GitHub" links
592
- * and source file references.
593
- *
594
- * @example
595
- * ```ts
596
- * // Simple repo (not a monorepo)
597
- * github: {
598
- * url: "https://github.com/Kinfe123/my-docs",
599
- * }
600
- *
601
- * // Monorepo — docs site lives in "website/" subdirectory
602
- * github: {
603
- * url: "https://github.com/farming-labs/docs",
604
- * directory: "website",
605
- * branch: "main",
606
- * }
607
- * ```
608
- *
609
- * Or as a simple string (branch defaults to "main", no directory prefix):
610
- * ```ts
611
- * github: "https://github.com/Kinfe123/my-docs"
612
- * ```
613
- */
614
- interface GithubConfig {
615
- /** Repository URL (e.g. "https://github.com/farming-labs/docs") */
616
- url: string;
617
- /** Branch name. @default "main" */
618
- branch?: string;
619
- /**
620
- * Subdirectory inside the repo where the docs site lives.
621
- * Use this for monorepos where the docs app is not at the repo root.
622
- *
623
- * @example "website" → links point to `website/app/docs/…/page.mdx`
624
- */
625
- directory?: string;
626
- }
627
- /**
628
- * Configuration for "Ask AI" — a RAG-powered chat that lets users
629
- * ask questions about the documentation content.
630
- *
631
- * The AI handler searches relevant doc pages, builds context, and
632
- * streams a response from an LLM (OpenAI-compatible API).
633
- *
634
- * The API key is **never** stored in the config. It is read from the
635
- * `OPENAI_API_KEY` environment variable at runtime on the server.
636
- *
637
- * @example
638
- * ```ts
639
- * ai: {
640
- * enabled: true,
641
- * model: "gpt-4o-mini",
642
- * systemPrompt: "You are a helpful assistant for our developer docs.",
643
- * }
644
- * ```
645
- */
646
- interface AIConfig {
647
- /**
648
- * Whether to enable "Ask AI" functionality.
649
- * When enabled, the unified `/api/docs` route handler will accept
650
- * POST requests for AI chat.
651
- * @default false
652
- */
653
- enabled?: boolean;
654
- /**
655
- * How the AI chat UI is presented.
656
- *
657
- * - `"search"` — AI tab integrated into the Cmd+K search dialog (default)
658
- * - `"floating"` — A floating chat widget (bubble button + slide-out panel)
659
- *
660
- * @default "search"
661
- *
662
- * @example
663
- * ```ts
664
- * // Floating chat bubble in the bottom-right corner
665
- * ai: {
666
- * enabled: true,
667
- * mode: "floating",
668
- * position: "bottom-right",
669
- * }
670
- * ```
671
- */
672
- mode?: "search" | "floating" | "sidebar-icon";
673
- /**
674
- * Position of the floating chat button on screen.
675
- * Only used when `mode` is `"floating"`.
676
- *
677
- * - `"bottom-right"` — bottom-right corner (default)
678
- * - `"bottom-left"` — bottom-left corner
679
- * - `"bottom-center"` — bottom center
680
- *
681
- * @default "bottom-right"
682
- */
683
- position?: "bottom-right" | "bottom-left" | "bottom-center";
684
- /**
685
- * Visual style of the floating chat when opened.
686
- * Only used when `mode` is `"floating"`.
687
- *
688
- * - `"panel"` — A tall panel that slides up from the button position (default).
689
- * Stays anchored near the floating button. No backdrop overlay.
690
- *
691
- * - `"modal"` — A centered modal dialog with a backdrop overlay,
692
- * similar to the Cmd+K search dialog. Feels more focused and immersive.
693
- *
694
- * - `"popover"` — A compact popover near the button. Smaller than the
695
- * panel, suitable for quick questions without taking much screen space.
696
- *
697
- * - `"full-modal"` — A full-screen immersive overlay (inspired by better-auth).
698
- * Messages scroll in the center, input is pinned at the bottom.
699
- * Suggested questions appear as horizontal pills. Best for
700
- * documentation-heavy sites that want a premium AI experience.
701
- *
702
- * @default "panel"
703
- *
704
- * @example
705
- * ```ts
706
- * ai: {
707
- * enabled: true,
708
- * mode: "floating",
709
- * position: "bottom-right",
710
- * floatingStyle: "full-modal",
711
- * }
712
- * ```
713
- */
714
- floatingStyle?: "panel" | "modal" | "popover" | "full-modal";
715
- /**
716
- * Custom trigger component for the floating chat button (Next.js only).
717
- * Only used when `mode` is `"floating"`.
718
- *
719
- * The click handler is attached automatically by the wrapper.
720
- *
721
- * - **Next.js**: Pass a JSX element via this config option.
722
- * - **SvelteKit**: Use the `aiTrigger` snippet on `<DocsLayout>`.
723
- * - **Nuxt / Vue**: Use the `ai-trigger` slot on `<DocsLayout>`.
724
- * - **Astro**: Use `<MyTrigger slot="ai-trigger" />` on `<DocsLayout>`.
725
- *
726
- * @example
727
- * ```tsx
728
- * // Next.js — pass JSX directly in config
729
- * triggerComponent: <button className="my-chat-btn">Ask AI</button>,
730
- * ```
731
- *
732
- * ```svelte
733
- * <!-- SvelteKit — use snippet in layout -->
734
- * <DocsLayout {tree} {config}>
735
- * {#snippet aiTrigger()}<AskAITrigger />{/snippet}
736
- * {@render children()}
737
- * </DocsLayout>
738
- * ```
739
- *
740
- * ```vue
741
- * <!-- Nuxt / Vue — use named slot in layout -->
742
- * <DocsLayout :tree="tree" :config="config">
743
- * <template #ai-trigger><AskAITrigger /></template>
744
- * <DocsContent />
745
- * </DocsLayout>
746
- * ```
747
- *
748
- * ```astro
749
- * <!-- Astro — use named slot in layout -->
750
- * <DocsLayout tree={tree} config={config}>
751
- * <AskAITrigger slot="ai-trigger" />
752
- * <DocsContent />
753
- * </DocsLayout>
754
- * ```
755
- */
756
- triggerComponent?: unknown;
757
- /**
758
- * The LLM model configuration.
759
- *
760
- * **Simple** — pass a plain string for a single model:
761
- * ```ts
762
- * model: "gpt-4o-mini"
763
- * ```
764
- *
765
- * **Advanced** — pass an object with multiple selectable models and an
766
- * optional `provider` key that references a named provider in `providers`:
767
- * ```ts
768
- * model: {
769
- * models: [
770
- * { id: "gpt-4o-mini", label: "GPT-4o mini (fast)", provider: "openai" },
771
- * { id: "llama-3.3-70b-versatile", label: "Llama 3.3 70B", provider: "groq" },
772
- * ],
773
- * defaultModel: "gpt-4o-mini",
774
- * }
775
- * ```
776
- *
777
- * When an object is provided, a model selector dropdown appears in the
778
- * AI chat interface.
779
- *
780
- * @default "gpt-4o-mini"
781
- */
782
- model?: string | {
783
- models: {
784
- id: string;
785
- label: string;
786
- provider?: string;
787
- }[];
788
- defaultModel?: string;
789
- };
790
- /**
791
- * Named provider configurations for multi-provider setups.
792
- *
793
- * Each key is a provider name referenced by `model.models[].provider`.
794
- * Each value contains a `baseUrl` and optional `apiKey`.
795
- *
796
- * @example
797
- * ```ts
798
- * providers: {
799
- * openai: {
800
- * baseUrl: "https://api.openai.com/v1",
801
- * apiKey: process.env.OPENAI_API_KEY,
802
- * },
803
- * groq: {
804
- * baseUrl: "https://api.groq.com/openai/v1",
805
- * apiKey: process.env.GROQ_API_KEY,
806
- * },
807
- * }
808
- * ```
809
- */
810
- providers?: Record<string, {
811
- baseUrl: string;
812
- apiKey?: string;
813
- }>;
814
- /**
815
- * Custom system prompt prepended to the AI conversation.
816
- * The documentation context is automatically appended after this prompt.
817
- *
818
- * @default "You are a helpful documentation assistant. Answer questions
819
- * based on the provided documentation context. Be concise and accurate.
820
- * If the answer is not in the context, say so honestly."
821
- */
822
- systemPrompt?: string;
823
- /**
824
- * Default base URL for an OpenAI-compatible API endpoint.
825
- * Used when no per-model `provider` is configured.
826
- * @default "https://api.openai.com/v1"
827
- */
828
- baseUrl?: string;
829
- /**
830
- * Default API key for the LLM provider.
831
- * Used when no per-model `provider` is configured.
832
- * Falls back to `process.env.OPENAI_API_KEY` if not set.
833
- *
834
- * @default process.env.OPENAI_API_KEY
835
- *
836
- * @example
837
- * ```ts
838
- * // Default — reads OPENAI_API_KEY automatically
839
- * ai: { enabled: true }
840
- *
841
- * // Custom provider key
842
- * ai: {
843
- * enabled: true,
844
- * apiKey: process.env.GROQ_API_KEY,
845
- * }
846
- * ```
847
- */
848
- apiKey?: string;
849
- /**
850
- * Maximum number of search results to include as context for the AI.
851
- * More results = more context but higher token usage.
852
- * @default 5
853
- */
854
- maxResults?: number;
855
- /**
856
- * Pre-filled suggested questions shown in the AI chat when empty.
857
- * When a user clicks one, it fills the input and submits automatically.
858
- *
859
- * @example
860
- * ```ts
861
- * ai: {
862
- * enabled: true,
863
- * suggestedQuestions: [
864
- * "How do I install this?",
865
- * "What themes are available?",
866
- * "How do I create a custom component?",
867
- * ],
868
- * }
869
- * ```
870
- */
871
- suggestedQuestions?: string[];
872
- /**
873
- * Display name for the AI assistant in the chat UI.
874
- * Shown as the message label, header title, and passed to the loading component.
875
- *
876
- * @default "AI"
877
- *
878
- * @example
879
- * ```ts
880
- * ai: {
881
- * enabled: true,
882
- * aiLabel: "DocsBot",
883
- * }
884
- * ```
885
- */
886
- aiLabel?: string;
887
- /**
888
- * The npm package name used in import examples.
889
- * The AI will use this in code snippets instead of generic placeholders.
890
- *
891
- * @example
892
- * ```ts
893
- * ai: {
894
- * enabled: true,
895
- * packageName: "@farming-labs/docs",
896
- * }
897
- * ```
898
- */
899
- packageName?: string;
900
- /**
901
- * The public URL of the documentation site.
902
- * The AI will use this for links instead of relative paths.
903
- *
904
- * @example
905
- * ```ts
906
- * ai: {
907
- * enabled: true,
908
- * docsUrl: "https://docs.farming-labs.dev",
909
- * }
910
- * ```
911
- */
912
- docsUrl?: string;
913
- /**
914
- * Loading indicator variant shown while the AI generates a response.
915
- *
916
- * - `"shimmer-dots"` — shimmer text + typing dots (default)
917
- * - `"circular"` — spinning ring
918
- * - `"dots"` — bouncing dots
919
- * - `"typing"` — typing dots
920
- * - `"wave"` — wave bars
921
- * - `"bars"` — thick wave bars
922
- * - `"pulse"` — pulsing ring
923
- * - `"pulse-dot"` — pulsing dot
924
- * - `"terminal"` — blinking terminal cursor
925
- * - `"text-blink"` — blinking text
926
- * - `"text-shimmer"` — shimmer text only
927
- * - `"loading-dots"` — "Thinking..." with animated dots
928
- *
929
- * @default "shimmer-dots"
930
- *
931
- * @example
932
- * ```ts
933
- * ai: {
934
- * enabled: true,
935
- * loader: "wave",
936
- * }
937
- * ```
938
- */
939
- loader?: "shimmer-dots" | "circular" | "dots" | "typing" | "wave" | "bars" | "pulse" | "pulse-dot" | "terminal" | "text-blink" | "text-shimmer" | "loading-dots";
940
- /**
941
- * Custom loading indicator that overrides the built-in `loader` variant.
942
- * Receives `{ name }` (the `aiLabel` value) and returns a React element.
943
- *
944
- * Only works in Next.js. For other frameworks, use the `loader` option.
945
- *
946
- * @example
947
- * ```tsx
948
- * ai: {
949
- * enabled: true,
950
- * aiLabel: "Sage",
951
- * loadingComponent: ({ name }) => (
952
- * <div className="flex items-center gap-2 text-sm text-zinc-400">
953
- * <span className="animate-pulse">🤔</span>
954
- * <span>{name} is thinking...</span>
955
- * </div>
956
- * ),
957
- * }
958
- * ```
959
- */
960
- loadingComponent?: (props: {
961
- name: string;
962
- }) => unknown;
963
- }
964
- /**
965
- * A single item in the slug-based sidebar ordering.
966
- *
967
- * @example
968
- * ```ts
969
- * ordering: [
970
- * { slug: "installation" },
971
- * { slug: "cli" },
972
- * { slug: "themes", children: [
973
- * { slug: "default" },
974
- * { slug: "darksharp" },
975
- * { slug: "pixel-border" },
976
- * { slug: "creating-themes" },
977
- * ]},
978
- * { slug: "reference" },
979
- * ]
980
- * ```
981
- */
982
- interface OrderingItem {
983
- /** Folder name (not the full path, just the directory name at this level) */
984
- slug: string;
985
- /** Ordering for child pages within this folder */
986
- children?: OrderingItem[];
987
- }
988
- /**
989
- * Data passed to the `onCopyClick` callback when the user clicks the copy button
990
- * on a code block in the docs.
991
- */
992
- interface CodeBlockCopyData {
993
- /** Title of the code block (e.g. from the fenced code block meta string), if present */
994
- title?: string;
995
- /** Raw code content (the text that was copied to the clipboard) */
996
- content: string;
997
- /** Current page URL at the time of copy */
998
- url: string;
999
- /** Language / syntax hint (e.g. "tsx", "bash"), if present */
1000
- language?: string;
1001
- }
1002
- /** Feedback value emitted by the built-in docs page feedback buttons. */
1003
- type DocsFeedbackValue = "positive" | "negative";
1004
- /**
1005
- * Data passed to the `feedback.onFeedback` callback when the user submits
1006
- * page feedback from the built-in docs feedback UI.
1007
- */
1008
- interface DocsFeedbackData {
1009
- /** Whether the user gave positive or negative feedback. */
1010
- value: DocsFeedbackValue;
1011
- /** Optional free-form feedback left by the reader. */
1012
- comment?: string;
1013
- /** Current page title, when available. */
1014
- title?: string;
1015
- /** Current page description, when available. */
1016
- description?: string;
1017
- /** Full current page URL at the time of feedback. */
1018
- url: string;
1019
- /** Current URL pathname (without origin). */
1020
- pathname: string;
1021
- /** Alias of `pathname` for analytics tools that prefer `path`. */
1022
- path: string;
1023
- /** Docs entry root, e.g. `"docs"`. */
1024
- entry: string;
1025
- /** Page slug relative to the docs entry, e.g. `"installation"` or `"guides/setup"`. */
1026
- slug: string;
1027
- /** Active locale, when docs i18n is enabled. */
1028
- locale?: string;
1029
- }
1030
- /**
1031
- * Built-in page feedback configuration.
1032
- *
1033
- * When enabled, docs pages render a small feedback prompt at the end of the
1034
- * content. Clicking a button emits a callback/event with the current page
1035
- * metadata and the selected sentiment.
1036
- */
1037
- interface FeedbackConfig {
1038
- /** Show the feedback UI. Defaults to `true` when this object is provided. */
1039
- enabled?: boolean;
1040
- /** Prompt shown above the feedback buttons. @default "How is this guide?" */
1041
- question?: string;
1042
- /** Placeholder shown in the optional free-form feedback field. @default "Leave your feedback..." */
1043
- placeholder?: string;
1044
- /** Label for the positive button. @default "Good" */
1045
- positiveLabel?: string;
1046
- /** Label for the negative button. @default "Bad" */
1047
- negativeLabel?: string;
1048
- /** Label for the submit button. @default "Submit" */
1049
- submitLabel?: string;
1050
- /**
1051
- * Callback fired when the user submits the feedback form.
1052
- *
1053
- * For client-only frameworks this runs directly in the browser. In
1054
- * environments where the config cannot be serialized to the client, the same
1055
- * payload is also emitted through `window.__fdOnFeedback__` and the
1056
- * `fd:feedback` custom event.
1057
- */
1058
- onFeedback?: (data: DocsFeedbackData) => void | Promise<void>;
1059
- }
1060
- interface DocsI18nConfig {
1061
- /** Supported locale identifiers (e.g. ["en", "fr"]). */
1062
- locales: string[];
1063
- /** Default locale when `?lang=` is missing or invalid. Defaults to first locale. */
1064
- defaultLocale?: string;
1065
- }
1066
- interface ApiReferenceConfig {
1067
- /**
1068
- * Whether to enable generated API reference pages.
1069
- * The initial implementation is wired for Next.js route handlers.
1070
- * @default false
1071
- */
1072
- enabled?: boolean;
1073
- /**
1074
- * URL path where the generated API reference lives.
1075
- * Example: `"api-reference"` → `/api-reference`
1076
- * @default "api-reference"
1077
- */
1078
- path?: string;
1079
- /**
1080
- * Absolute URL to a remote OpenAPI JSON document.
1081
- *
1082
- * When provided, the API reference is generated from this hosted spec instead
1083
- * of scanning local framework route files.
1084
- *
1085
- * @example
1086
- * ```ts
1087
- * apiReference: {
1088
- * enabled: true,
1089
- * specUrl: "https://petstore3.swagger.io/api/v3/openapi.json",
1090
- * }
1091
- * ```
1092
- */
1093
- specUrl?: string;
1094
- /**
1095
- * Filesystem route root to scan for API handlers.
1096
- *
1097
- * For Next.js this defaults to the App Router convention:
1098
- * `app/api` or `src/app/api`.
1099
- *
1100
- * You can override it with a project-relative path like `"app/v1"` or
1101
- * `"src/app/internal-api"`. If you pass a bare segment like `"api"` or
1102
- * `"v1"`, it will be resolved inside the detected app directory.
1103
- */
1104
- routeRoot?: string;
1105
- /**
1106
- * Route entries to exclude from the generated API reference.
1107
- *
1108
- * Accepts either URL-style paths like `"/api/hello"` or route-root-relative
1109
- * entries like `"hello"` / `"hello/route.ts"`.
1110
- */
1111
- exclude?: string[];
1112
- }
1113
- interface DocsConfig {
1114
- /** Entry folder for docs (e.g. "docs" → /docs) */
1115
- entry: string;
1116
- /** Path to the content directory. Defaults to `entry` value. */
1117
- contentDir?: string;
1118
- /**
1119
- * Internationalization (i18n) configuration.
1120
- * When set, docs content is expected under `${contentDir}/{locale}` and
1121
- * the active locale is selected by `?lang=<locale>` in the URL.
1122
- */
1123
- i18n?: DocsI18nConfig;
1124
- /**
1125
- * Set to `true` when building for full static export (e.g. Cloudflare Pages).
1126
- * When using `output: 'export'` in Next.js, the `/api/docs` route is not generated.
1127
- * Set `ai.enabled: false` and optionally rely on client-side search or leave search disabled.
1128
- */
1129
- staticExport?: boolean;
1130
- /** Theme configuration - single source of truth for UI */
1131
- theme?: DocsTheme;
1132
- /**
1133
- * GitHub repository URL or config. Enables "Edit on GitHub" links
1134
- * on each docs page footer, pointing to the source `.mdx` file.
1135
- *
1136
- * @example
1137
- * ```ts
1138
- * // Simple — branch defaults to "main"
1139
- * github: "https://github.com/Kinfe123/my-docs"
1140
- *
1141
- * // Monorepo — docs site lives in "website/" subdirectory
1142
- * github: {
1143
- * url: "https://github.com/farming-labs/docs",
1144
- * directory: "website",
1145
- * }
1146
- *
1147
- * // Custom branch
1148
- * github: {
1149
- * url: "https://github.com/Kinfe123/my-docs",
1150
- * branch: "develop",
1151
- * }
1152
- * ```
1153
- */
1154
- github?: string | GithubConfig;
1155
- /**
1156
- * Sidebar navigation header.
1157
- * Customise the title shown at the top of the sidebar.
1158
- */
1159
- nav?: DocsNav;
1160
- /**
1161
- * Theme toggle (light/dark mode switcher) in the sidebar.
1162
- *
1163
- * - `true` or `undefined` → toggle is shown (default)
1164
- * - `false` → toggle is hidden, defaults to system theme
1165
- * - `{ enabled: false, default: "dark" }` → toggle hidden, force dark
1166
- *
1167
- * @example
1168
- * ```ts
1169
- * // Hide toggle, force dark mode
1170
- * themeToggle: { enabled: false, default: "dark" }
1171
- *
1172
- * // Show toggle with system option
1173
- * themeToggle: { mode: "light-dark-system" }
1174
- * ```
1175
- */
1176
- themeToggle?: boolean | ThemeToggleConfig;
1177
- /**
1178
- * Breadcrumb navigation above page content.
1179
- *
1180
- * - `true` or `undefined` → breadcrumb is shown (default)
1181
- * - `false` → breadcrumb is hidden
1182
- * - `{ enabled: false }` → breadcrumb is hidden
1183
- * - `{ component: MyBreadcrumb }` → custom breadcrumb component
1184
- */
1185
- breadcrumb?: boolean | BreadcrumbConfig;
1186
- /**
1187
- * Sidebar customisation.
1188
- *
1189
- * - `true` or `undefined` → default sidebar
1190
- * - `false` → sidebar is hidden
1191
- * - `{ component: MySidebar }` → custom sidebar component
1192
- * - `{ footer: <MyFooter />, banner: <MyBanner /> }` → add footer/banner
1193
- */
1194
- sidebar?: boolean | SidebarConfig;
1195
- /**
1196
- * Custom MDX component overrides.
1197
- *
1198
- * Pass your own React components to replace defaults (e.g. Callout, CodeBlock).
1199
- * Components must match the expected props interface.
1200
- *
1201
- * @example
1202
- * ```ts
1203
- * import { MyCallout } from "./components/my-callout";
1204
- *
1205
- * export default defineDocs({
1206
- * entry: "docs",
1207
- * theme: fumadocs(),
1208
- * components: {
1209
- * Callout: MyCallout,
1210
- * },
1211
- * });
1212
- * ```
1213
- */
1214
- components?: Record<string, unknown>;
1215
- /**
1216
- * Callback fired when the user clicks the copy button on a code block.
1217
- * Called in addition to the default copy-to-clipboard behavior.
1218
- * Use it for analytics, logging, or custom behavior.
1219
- *
1220
- * @example
1221
- * ```ts
1222
- * export default defineDocs({
1223
- * entry: "docs",
1224
- * theme: fumadocs(),
1225
- * onCopyClick(data) {
1226
- * console.log("Code copied", data.title, data.language, data.url);
1227
- * analytics.track("code_block_copy", { title: data.title, url: data.url });
1228
- * },
1229
- * });
1230
- * ```
1231
- */
1232
- onCopyClick?: (data: CodeBlockCopyData) => void;
1233
- /**
1234
- * Built-in page feedback prompt shown at the end of a docs page.
1235
- *
1236
- * - `false` or `undefined` → hidden (default)
1237
- * - `true` → shown with default labels
1238
- * - `{ enabled: true, onFeedback(data) { ... } }` → shown with callback
1239
- *
1240
- * @example
1241
- * ```ts
1242
- * import type { DocsFeedbackData } from "@farming-labs/docs";
1243
- *
1244
- * export default defineDocs({
1245
- * entry: "docs",
1246
- * feedback: {
1247
- * enabled: true,
1248
- * onFeedback(data: DocsFeedbackData) {
1249
- * console.log("Docs feedback", data.value, data.slug, data.url);
1250
- * },
1251
- * },
1252
- * });
1253
- * ```
1254
- */
1255
- feedback?: boolean | FeedbackConfig;
1256
- /**
1257
- * Icon registry for sidebar items.
1258
- *
1259
- * Map string labels to React elements. Reference them in page frontmatter
1260
- * with `icon: "label"` and the matching icon renders in the sidebar.
1261
- *
1262
- * @example
1263
- * ```tsx
1264
- * import { Book, Terminal, Rocket } from "lucide-react";
1265
- *
1266
- * export default defineDocs({
1267
- * entry: "docs",
1268
- * theme: fumadocs(),
1269
- * icons: {
1270
- * book: <Book />,
1271
- * terminal: <Terminal />,
1272
- * rocket: <Rocket />,
1273
- * },
1274
- * });
1275
- * ```
1276
- *
1277
- * Then in `page.mdx` frontmatter:
1278
- * ```yaml
1279
- * ---
1280
- * title: "CLI Reference"
1281
- * icon: "terminal"
1282
- * ---
1283
- * ```
1284
- */
1285
- icons?: Record<string, unknown>;
1286
- /**
1287
- * Page action buttons shown above the content area.
1288
- * Includes "Copy Markdown" and "Open in …" (LLM dropdown).
1289
- *
1290
- * @example
1291
- * ```ts
1292
- * pageActions: {
1293
- * copyMarkdown: { enabled: true },
1294
- * openDocs: {
1295
- * enabled: true,
1296
- * providers: [
1297
- * { name: "ChatGPT", urlTemplate: "https://chatgpt.com/?q={url}" },
1298
- * { name: "Claude", urlTemplate: "https://claude.ai/new?q={url}" },
1299
- * ],
1300
- * },
1301
- * }
1302
- * ```
1303
- */
1304
- pageActions?: PageActionsConfig;
1305
- /**
1306
- * Configuration for the "Last updated" date display.
1307
- *
1308
- * - `true` or `undefined` → shown in footer next to "Edit on GitHub" (default)
1309
- * - `false` → hidden
1310
- * - `{ position: "below-title" }` → shown below the page title
1311
- * - `{ position: "footer" }` → shown next to "Edit on GitHub" (default)
1312
- *
1313
- * @example
1314
- * ```ts
1315
- * // Show below title (Mintlify style)
1316
- * lastUpdated: { position: "below-title" }
1317
- *
1318
- * // Hide entirely
1319
- * lastUpdated: false
1320
- * ```
1321
- */
1322
- lastUpdated?: boolean | LastUpdatedConfig;
1323
- /**
1324
- * AI-powered "Ask AI" chat for documentation.
1325
- *
1326
- * When enabled, the unified API route handler (`/api/docs`) accepts
1327
- * POST requests for AI chat. The handler uses RAG (Retrieval-Augmented
1328
- * Generation) — it searches relevant docs, builds context, and streams
1329
- * a response from an LLM.
1330
- *
1331
- * The API key defaults to `process.env.OPENAI_API_KEY`. For other providers,
1332
- * pass the key via `apiKey: process.env.YOUR_KEY`.
1333
- *
1334
- * @example
1335
- * ```ts
1336
- * // Enable with defaults (gpt-4o-mini, OPENAI_API_KEY)
1337
- * ai: { enabled: true }
1338
- *
1339
- * // Custom model + system prompt
1340
- * ai: {
1341
- * enabled: true,
1342
- * model: "gpt-4o",
1343
- * systemPrompt: "You are an expert on our SDK. Be concise.",
1344
- * }
1345
- *
1346
- * // Use a different provider (e.g. Groq)
1347
- * ai: {
1348
- * enabled: true,
1349
- * baseUrl: "https://api.groq.com/openai/v1",
1350
- * apiKey: process.env.GROQ_API_KEY,
1351
- * model: "llama-3.1-70b-versatile",
1352
- * }
1353
- * ```
1354
- */
1355
- ai?: AIConfig;
1356
- /**
1357
- * Sidebar ordering strategy.
1358
- *
1359
- * - `"alphabetical"` — sort pages alphabetically by folder name (default)
1360
- * - `"numeric"` — sort by frontmatter `order` field (lower first, unset pages last)
1361
- * - `OrderingItem[]` — explicit slug-based ordering with nested children
1362
- *
1363
- * @default "alphabetical"
1364
- *
1365
- * @example
1366
- * ```ts
1367
- * // Alphabetical (default)
1368
- * ordering: "alphabetical",
1369
- *
1370
- * // Use frontmatter `order: 1`, `order: 2`, etc.
1371
- * ordering: "numeric",
1372
- *
1373
- * // Explicit slug-based ordering
1374
- * ordering: [
1375
- * { slug: "installation" },
1376
- * { slug: "cli" },
1377
- * { slug: "configuration" },
1378
- * { slug: "themes", children: [
1379
- * { slug: "default" },
1380
- * { slug: "darksharp" },
1381
- * { slug: "pixel-border" },
1382
- * { slug: "creating-themes" },
1383
- * ]},
1384
- * { slug: "customization" },
1385
- * { slug: "reference" },
1386
- * ]
1387
- * ```
1388
- */
1389
- ordering?: "alphabetical" | "numeric" | OrderingItem[];
1390
- /**
1391
- * Auto-generate `/llms.txt` and `/llms-full.txt` routes for LLM-friendly
1392
- * documentation. These files let AI tools quickly understand your docs.
1393
- *
1394
- * @example
1395
- * ```ts
1396
- * llmsTxt: {
1397
- * enabled: true,
1398
- * baseUrl: "https://docs.example.com",
1399
- * }
1400
- * ```
1401
- *
1402
- * @see https://llmstxt.org
1403
- */
1404
- llmsTxt?: boolean | LlmsTxtConfig;
1405
- /**
1406
- * Generated API reference pages from framework route conventions or a hosted
1407
- * OpenAPI JSON document.
1408
- *
1409
- * @example
1410
- * ```ts
1411
- * apiReference: {
1412
- * enabled: true,
1413
- * path: "api-reference",
1414
- * routeRoot: "api",
1415
- * }
1416
- * ```
1417
- *
1418
- * @example
1419
- * ```ts
1420
- * apiReference: {
1421
- * enabled: true,
1422
- * specUrl: "https://example.com/openapi.json",
1423
- * }
1424
- * ```
1425
- */
1426
- apiReference?: boolean | ApiReferenceConfig;
1427
- /** SEO metadata - separate from theme */
1428
- metadata?: DocsMetadata;
1429
- /** Open Graph image handling */
1430
- og?: OGConfig;
1431
- }
1432
- //#endregion
1433
- export { SidebarNode as A, PageActionsConfig as C, SidebarComponentProps as D, PageTwitter as E, UIConfig as F, SidebarTree as M, ThemeToggleConfig as N, SidebarConfig as O, TypographyConfig as P, OrderingItem as S, PageOpenGraph as T, LlmsTxtConfig as _, CopyMarkdownConfig as a, OpenDocsProvider as b, DocsFeedbackValue as c, DocsNav as d, DocsTheme as f, LastUpdatedConfig as g, GithubConfig as h, CodeBlockCopyData as i, SidebarPageNode as j, SidebarFolderNode as k, DocsI18nConfig as l, FontStyle as m, ApiReferenceConfig as n, DocsConfig as o, FeedbackConfig as p, BreadcrumbConfig as r, DocsFeedbackData as s, AIConfig as t, DocsMetadata as u, OGConfig as v, PageFrontmatter as w, OpenGraphImage as x, OpenDocsConfig as y };