doccupine 0.0.157 → 0.0.159

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 (153) hide show
  1. package/README.md +52 -2
  2. package/dist/generator/app-scaffolder.js +11 -3
  3. package/dist/generator/generated-page-publisher.d.ts +6 -6
  4. package/dist/generator/generated-page-publisher.js +7 -5
  5. package/dist/generator/icon-registry-generator.d.ts +8 -5
  6. package/dist/generator/icon-registry-generator.js +19 -11
  7. package/dist/generator/mdx-pass-builder.d.ts +4 -4
  8. package/dist/generator/mdx-pass-builder.js +8 -1
  9. package/dist/generator/mdx-reconciliation-coordinator.d.ts +23 -9
  10. package/dist/generator/mdx-reconciliation-coordinator.js +63 -9
  11. package/dist/generator/page-catalog.d.ts +2 -4
  12. package/dist/generator/page-catalog.js +7 -2
  13. package/dist/generator/page-renderer.d.ts +15 -5
  14. package/dist/generator/page-renderer.js +38 -11
  15. package/dist/generator/project-config-repository.d.ts +4 -1
  16. package/dist/generator/project-config-repository.js +26 -0
  17. package/dist/generator/public-asset-manager.d.ts +10 -0
  18. package/dist/generator/public-asset-manager.js +63 -3
  19. package/dist/generator/section-index-generator.d.ts +10 -1
  20. package/dist/generator/section-index-generator.js +43 -15
  21. package/dist/generator/section-resolver.d.ts +8 -0
  22. package/dist/generator/site-artifacts.d.ts +4 -3
  23. package/dist/generator/site-artifacts.js +94 -9
  24. package/dist/generator/watch-coordinator.js +6 -1
  25. package/dist/lib/generated-artifacts.d.ts +3 -0
  26. package/dist/lib/generated-artifacts.js +36 -0
  27. package/dist/lib/icon-registry.d.ts +10 -4
  28. package/dist/lib/icon-registry.js +13 -4
  29. package/dist/lib/layout.d.ts +6 -3
  30. package/dist/lib/layout.js +107 -4
  31. package/dist/lib/metadata.d.ts +7 -0
  32. package/dist/lib/metadata.js +33 -10
  33. package/dist/lib/structures.js +20 -0
  34. package/dist/lib/types.d.ts +28 -0
  35. package/dist/lib/ui-strings.d.ts +44 -0
  36. package/dist/lib/ui-strings.js +48 -0
  37. package/dist/lib/variants.d.ts +91 -0
  38. package/dist/lib/variants.js +411 -0
  39. package/dist/mdx-to-nextjs-generator.d.ts +22 -5
  40. package/dist/mdx-to-nextjs-generator.js +92 -12
  41. package/dist/templates/app/api/mcp/route.d.ts +1 -1
  42. package/dist/templates/app/api/mcp/route.js +14 -1
  43. package/dist/templates/app/api/rag/route.d.ts +1 -1
  44. package/dist/templates/app/api/rag/route.js +13 -2
  45. package/dist/templates/app/api/search/route.d.ts +1 -1
  46. package/dist/templates/app/api/search/route.js +16 -1
  47. package/dist/templates/app/sitemap.d.ts +2 -0
  48. package/dist/templates/app/sitemap.js +48 -3
  49. package/dist/templates/components/Chat.d.ts +1 -1
  50. package/dist/templates/components/Chat.js +40 -12
  51. package/dist/templates/components/Docs.d.ts +1 -1
  52. package/dist/templates/components/Docs.js +5 -2
  53. package/dist/templates/components/DocsSideBar.d.ts +1 -1
  54. package/dist/templates/components/DocsSideBar.js +3 -1
  55. package/dist/templates/components/SearchDocs.d.ts +1 -1
  56. package/dist/templates/components/SearchDocs.js +17 -3
  57. package/dist/templates/components/SearchModalContent.d.ts +1 -1
  58. package/dist/templates/components/SearchModalContent.js +22 -14
  59. package/dist/templates/components/SectionNavProvider.d.ts +1 -1
  60. package/dist/templates/components/SectionNavProvider.js +32 -20
  61. package/dist/templates/components/SideBar.d.ts +1 -1
  62. package/dist/templates/components/SideBar.js +26 -12
  63. package/dist/templates/components/layout/ActionBar.d.ts +1 -1
  64. package/dist/templates/components/layout/ActionBar.js +9 -7
  65. package/dist/templates/components/layout/Code.d.ts +1 -1
  66. package/dist/templates/components/layout/Code.js +6 -3
  67. package/dist/templates/components/layout/DocsComponents.d.ts +1 -1
  68. package/dist/templates/components/layout/DocsComponents.js +38 -5
  69. package/dist/templates/components/layout/DocsNavigation.d.ts +1 -1
  70. package/dist/templates/components/layout/DocsNavigation.js +4 -2
  71. package/dist/templates/components/layout/Dropdown.d.ts +1 -0
  72. package/dist/templates/components/layout/Dropdown.js +308 -0
  73. package/dist/templates/components/layout/FocusModeToggle.d.ts +1 -1
  74. package/dist/templates/components/layout/FocusModeToggle.js +7 -4
  75. package/dist/templates/components/layout/Footer.d.ts +1 -1
  76. package/dist/templates/components/layout/Footer.js +4 -2
  77. package/dist/templates/components/layout/Header.d.ts +1 -1
  78. package/dist/templates/components/layout/Header.js +18 -8
  79. package/dist/templates/components/layout/SectionBar.d.ts +1 -1
  80. package/dist/templates/components/layout/SectionBar.js +16 -10
  81. package/dist/templates/components/layout/VariantSwitchers.d.ts +1 -0
  82. package/dist/templates/components/layout/VariantSwitchers.js +313 -0
  83. package/dist/templates/components/useStrings.d.ts +1 -0
  84. package/dist/templates/components/useStrings.js +10 -0
  85. package/dist/templates/components/useVariant.d.ts +1 -0
  86. package/dist/templates/components/useVariant.js +13 -0
  87. package/dist/templates/llms/llmsIndex.d.ts +13 -0
  88. package/dist/templates/llms/llmsIndex.js +18 -3
  89. package/dist/templates/mdx/ai-assistant.mdx.d.ts +1 -1
  90. package/dist/templates/mdx/ai-assistant.mdx.js +2 -0
  91. package/dist/templates/mdx/api-playground.mdx.d.ts +1 -1
  92. package/dist/templates/mdx/api-playground.mdx.js +2 -0
  93. package/dist/templates/mdx/commands.mdx.d.ts +1 -1
  94. package/dist/templates/mdx/commands.mdx.js +1 -1
  95. package/dist/templates/mdx/fonts.mdx.d.ts +1 -1
  96. package/dist/templates/mdx/fonts.mdx.js +1 -1
  97. package/dist/templates/mdx/footer-links.mdx.d.ts +1 -1
  98. package/dist/templates/mdx/footer-links.mdx.js +1 -1
  99. package/dist/templates/mdx/index.mdx.d.ts +1 -1
  100. package/dist/templates/mdx/index.mdx.js +2 -0
  101. package/dist/templates/mdx/languages.mdx.d.ts +1 -0
  102. package/dist/templates/mdx/languages.mdx.js +94 -0
  103. package/dist/templates/mdx/media-and-assets.mdx.d.ts +1 -1
  104. package/dist/templates/mdx/media-and-assets.mdx.js +1 -1
  105. package/dist/templates/mdx/model-context-protocol.mdx.d.ts +1 -1
  106. package/dist/templates/mdx/model-context-protocol.mdx.js +6 -0
  107. package/dist/templates/mdx/navigation.mdx.d.ts +1 -1
  108. package/dist/templates/mdx/navigation.mdx.js +2 -0
  109. package/dist/templates/mdx/platform/ai-assistant.mdx.d.ts +1 -1
  110. package/dist/templates/mdx/platform/ai-assistant.mdx.js +2 -0
  111. package/dist/templates/mdx/platform/api-playground.mdx.d.ts +1 -1
  112. package/dist/templates/mdx/platform/api-playground.mdx.js +2 -0
  113. package/dist/templates/mdx/platform/file-editor.mdx.d.ts +1 -1
  114. package/dist/templates/mdx/platform/file-editor.mdx.js +2 -0
  115. package/dist/templates/mdx/platform/index.mdx.d.ts +1 -1
  116. package/dist/templates/mdx/platform/index.mdx.js +1 -1
  117. package/dist/templates/mdx/platform/languages.mdx.d.ts +1 -0
  118. package/dist/templates/mdx/platform/languages.mdx.js +50 -0
  119. package/dist/templates/mdx/platform/mcp.mdx.d.ts +1 -1
  120. package/dist/templates/mdx/platform/mcp.mdx.js +2 -0
  121. package/dist/templates/mdx/platform/navigation-settings.mdx.d.ts +1 -1
  122. package/dist/templates/mdx/platform/navigation-settings.mdx.js +2 -0
  123. package/dist/templates/mdx/platform/publishing.mdx.d.ts +1 -1
  124. package/dist/templates/mdx/platform/publishing.mdx.js +4 -0
  125. package/dist/templates/mdx/platform/self-updating-docs.mdx.d.ts +1 -1
  126. package/dist/templates/mdx/platform/self-updating-docs.mdx.js +2 -0
  127. package/dist/templates/mdx/platform/versions.mdx.d.ts +1 -0
  128. package/dist/templates/mdx/platform/versions.mdx.js +33 -0
  129. package/dist/templates/mdx/sections.mdx.d.ts +1 -1
  130. package/dist/templates/mdx/sections.mdx.js +1 -1
  131. package/dist/templates/mdx/theme.mdx.d.ts +1 -1
  132. package/dist/templates/mdx/theme.mdx.js +1 -1
  133. package/dist/templates/mdx/versions.mdx.d.ts +1 -0
  134. package/dist/templates/mdx/versions.mdx.js +78 -0
  135. package/dist/templates/mdx/what-is-doccupine.mdx.d.ts +1 -1
  136. package/dist/templates/mdx/what-is-doccupine.mdx.js +1 -1
  137. package/dist/templates/prettierignore.d.ts +1 -1
  138. package/dist/templates/prettierignore.js +2 -0
  139. package/dist/templates/services/mcp/server.d.ts +1 -1
  140. package/dist/templates/services/mcp/server.js +54 -10
  141. package/dist/templates/services/mcp/tools.d.ts +1 -1
  142. package/dist/templates/services/mcp/tools.js +81 -6
  143. package/dist/templates/services/mcp/types.d.ts +1 -1
  144. package/dist/templates/services/mcp/types.js +10 -0
  145. package/dist/templates/services/search.d.ts +1 -1
  146. package/dist/templates/services/search.js +34 -4
  147. package/dist/templates/utils/orderNavItems.d.ts +1 -1
  148. package/dist/templates/utils/orderNavItems.js +2 -0
  149. package/dist/templates/utils/strings.d.ts +1 -0
  150. package/dist/templates/utils/strings.js +27 -0
  151. package/dist/templates/utils/variants.d.ts +1 -0
  152. package/dist/templates/utils/variants.js +170 -0
  153. package/package.json +1 -1
@@ -1 +1 @@
1
- export declare const apiPlaygroundMdxTemplate = "---\ntitle: \"API Playground\"\ndescription: \"Turn an OpenAPI document into an interactive API reference where readers send real requests and see live responses, right inside your docs.\"\ndate: \"2026-07-25\"\nupdated: \"2026-07-31\"\ncategory: \"Components\"\ncategoryOrder: 1\norder: 20\n---\n# API Playground\n\nPoint Doccupine at an OpenAPI document and it generates a complete, interactive API reference: one page per endpoint, grouped by tag in the sidebar, each with a \"Send request\" panel that makes real calls and shows the live response - plus copy-pasteable code snippets.\n\n<Callout type=\"note\">\nThe playground is driven entirely by your OpenAPI document. There is nothing to wire up by hand - add one line of config and every endpoint becomes a documented, runnable page.\n</Callout>\n\n## Try it\n\nPress **Try it** below to open the playground, tweak the request body, and send a real request to a live API - right from these docs.\n\n<ApiPlaygroundDemo />\n\n## Enabling the playground\n\n<Steps>\n <Step title=\"Add an openapi path to doccupine.json.\">\n Point at a local `.json`, `.yaml`, or `.yml` OpenAPI 3.0 or 3.1 document.\n\n```json\n{\n \"watchDir\": \"docs\",\n \"outputDir\": \"nextjs-app\",\n \"openapi\": \"openapi.yaml\"\n}\n```\n </Step>\n <Step title=\"Run Doccupine.\">\n Doccupine reads the root document and its recursive local `$ref` dependencies as one stable snapshot, then writes an endpoint page for each operation. The root must resolve inside the project, while referenced files must stay beneath the root spec's directory, use `.json`, `.yaml`, or `.yml`, and cannot be dotfiles or live inside dot-directories. Remote references and symlink escapes are rejected.\n </Step>\n <Step title=\"Open the API Reference section.\">\n Endpoints appear in the sidebar grouped by their OpenAPI tag. In watch mode, editing the root spec or any discovered local `$ref` file regenerates the reference automatically. Adding or retargeting a reference updates the watched dependency set after the refresh succeeds.\n </Step>\n</Steps>\n\n<Callout type=\"info\">\n OpenAPI refreshes preserve the last successful reference. A malformed or partially saved spec, a missing reference, or a generation failure does not replace the active pages, request allowlist, navigation, MCP content, or watcher.\n</Callout>\n\n## Example spec\n\nDo not have a document yet? This `openapi.yaml` points at [JSONPlaceholder](https://jsonplaceholder.typicode.com), a free public test API, so it works end to end - save it, set `openapi` to it, and the generated pages can send real requests:\n\n```yaml\nopenapi: 3.1.0\ninfo:\n title: JSONPlaceholder\n version: 1.0.0\nservers:\n - url: https://jsonplaceholder.typicode.com\ntags:\n - name: Todos\n - name: Posts\npaths:\n /todos/{id}:\n get:\n summary: Get a to-do\n tags: [Todos]\n parameters:\n - name: id\n in: path\n required: true\n schema:\n type: integer\n responses:\n \"200\":\n description: Just a demo of a to-do item\n /posts:\n post:\n summary: Create a post\n tags: [Posts]\n requestBody:\n required: true\n content:\n application/json:\n example:\n title: Hello\n body: Sent from the docs\n userId: 1\n responses:\n \"201\":\n description: Just a demo of the created post\n```\n\nEach part maps to something in the playground: `servers` sets the request target - and the only host the proxy will call - `tags` group endpoints in the sidebar, and `parameters` and `requestBody` become the inputs (adding a `securitySchemes` entry would produce authentication fields). Doccupine reads OpenAPI 3.0 and 3.1; see the [OpenAPI specification](https://spec.openapis.org) for the full format.\n\n## What gets generated\n\nThe generated `/api-reference` index lists every operation with a direct link, grouped by API and tag. Each operation also gets its own page under `/api-reference/{tag}/{operation}`, showing:\n\n<Callout type=\"note\">\n A hand-written MDX page takes precedence when it resolves to the same route as a generated OpenAPI page. Moving or deleting that MDX source returns the route to OpenAPI on the next successful refresh.\n</Callout>\n\n<Field value=\"Parameters\" type=\"path, query, header, cookie\">\nEach parameter is rendered with its name, type, and whether it is required, grouped into a collapsible section with an input to fill in.\n</Field>\n\n<Field value=\"Request body\" type=\"editable\">\nA JSON editor prefilled from the schema's example, ready to tweak and send.\n</Field>\n\n<Field value=\"Authentication\" type=\"from securitySchemes\">\nInputs for the endpoint's security schemes - API keys, bearer tokens, or basic auth - generated from the document.\n</Field>\n\n<Field value=\"Response\" type=\"live\">\nThe real status, timing, and body from your API, rendered to match its content type.\n</Field>\n\n## Embedding a single endpoint\n\nTo mix prose and a live endpoint on a hand-written page, reference an operation from the page's frontmatter with `openapi`. Use `METHOD /path` or an `operationId`:\n\n```mdx\n---\ntitle: \"Create a post\"\nopenapi: \"POST /posts\"\n---\n\nPosts are created for a user. The playground above is fully live - fill in the\nbody and send a real request.\n```\n\nDoccupine renders that endpoint's playground above your prose. If the reference does not match any operation in your document, the page still renders its prose and a warning is logged.\n\n## Running requests\n\nRequests run one of two ways, and readers can switch between them:\n\n<Callout type=\"note\">\n**Proxy (default).** The request is forwarded server-side, so it works even when the target API blocks cross-origin browser calls. **Direct.** The browser calls the API itself - useful when the API allows CORS and you want requests to never leave the reader's machine.\n</Callout>\n\nThe proxy is deliberately locked down. It only forwards to servers declared in your OpenAPI document and refuses private, internal, metadata, and reserved network addresses, including IPv4 destinations represented through IPv6 translation ranges. An explicitly declared loopback server such as `http://localhost:4000` is available only outside production for local development and tests; production always blocks loopback and every other private target even when the spec declares one. Request URLs, headers, and bodies are never logged, so API keys a reader enters are not written anywhere. On a [password-protected site](/authentication), the proxy also requires the visitor's unlocked session, so it cannot be called anonymously.\n\nProxy requests are rate limited per trusted client address on recognized hosting platforms. Unknown and self-hosted proxy setups share one fallback bucket rather than trusting spoofable forwarding headers; use your trusted edge or a shared rate-limit store when those deployments need accurate per-client limits.\n\n<Callout type=\"warning\">\nKeys and tokens a reader types are used only to make the request. Turn on \"Show secrets\" to reveal them in the generated code snippets; they are redacted by default.\n</Callout>\n\n## Responses and snippets\n\nResponses render to match their type: images and video play inline, everything else is shown as a formatted, syntax-highlighted body. Alongside the response, the playground generates ready-to-run **cURL**, **JavaScript**, and **Python** snippets for the exact request you built.\n\n## Documenting more than one API\n\nPass an array to document several APIs at once. Each spec becomes its own namespaced section:\n\n```json\n{\n \"openapi\": [\n { \"name\": \"public\", \"file\": \"specs/public.yaml\" },\n { \"name\": \"admin\", \"file\": \"specs/admin.yaml\" }\n ]\n}\n```\n";
1
+ export declare const apiPlaygroundMdxTemplate = "---\ntitle: \"API Playground\"\ndescription: \"Turn an OpenAPI document into an interactive API reference where readers send real requests and see live responses, right inside your docs.\"\ndate: \"2026-07-25\"\nupdated: \"2026-07-31\"\ncategory: \"Components\"\ncategoryOrder: 1\norder: 20\n---\n# API Playground\n\nPoint Doccupine at an OpenAPI document and it generates a complete, interactive API reference: one page per endpoint, grouped by tag in the sidebar, each with a \"Send request\" panel that makes real calls and shows the live response - plus copy-pasteable code snippets.\n\n<Callout type=\"note\">\nThe playground is driven entirely by your OpenAPI document. There is nothing to wire up by hand - add one line of config and every endpoint becomes a documented, runnable page.\n</Callout>\n\n## Try it\n\nPress **Try it** below to open the playground, tweak the request body, and send a real request to a live API - right from these docs.\n\n<ApiPlaygroundDemo />\n\n## Enabling the playground\n\n<Steps>\n <Step title=\"Add an openapi path to doccupine.json.\">\n Point at a local `.json`, `.yaml`, or `.yml` OpenAPI 3.0 or 3.1 document.\n\n```json\n{\n \"watchDir\": \"docs\",\n \"outputDir\": \"nextjs-app\",\n \"openapi\": \"openapi.yaml\"\n}\n```\n </Step>\n <Step title=\"Run Doccupine.\">\n Doccupine reads the root document and its recursive local `$ref` dependencies as one stable snapshot, then writes an endpoint page for each operation. The root must resolve inside the project, while referenced files must stay beneath the root spec's directory, use `.json`, `.yaml`, or `.yml`, and cannot be dotfiles or live inside dot-directories. Remote references and symlink escapes are rejected.\n </Step>\n <Step title=\"Open the API Reference section.\">\n Endpoints appear in the sidebar grouped by their OpenAPI tag. In watch mode, editing the root spec or any discovered local `$ref` file regenerates the reference automatically. Adding or retargeting a reference updates the watched dependency set after the refresh succeeds.\n </Step>\n</Steps>\n\n<Callout type=\"info\">\n OpenAPI refreshes preserve the last successful reference. A malformed or partially saved spec, a missing reference, or a generation failure does not replace the active pages, request allowlist, navigation, MCP content, or watcher.\n</Callout>\n\n## Example spec\n\nDo not have a document yet? This `openapi.yaml` points at [JSONPlaceholder](https://jsonplaceholder.typicode.com), a free public test API, so it works end to end - save it, set `openapi` to it, and the generated pages can send real requests:\n\n```yaml\nopenapi: 3.1.0\ninfo:\n title: JSONPlaceholder\n version: 1.0.0\nservers:\n - url: https://jsonplaceholder.typicode.com\ntags:\n - name: Todos\n - name: Posts\npaths:\n /todos/{id}:\n get:\n summary: Get a to-do\n tags: [Todos]\n parameters:\n - name: id\n in: path\n required: true\n schema:\n type: integer\n responses:\n \"200\":\n description: Just a demo of a to-do item\n /posts:\n post:\n summary: Create a post\n tags: [Posts]\n requestBody:\n required: true\n content:\n application/json:\n example:\n title: Hello\n body: Sent from the docs\n userId: 1\n responses:\n \"201\":\n description: Just a demo of the created post\n```\n\nEach part maps to something in the playground: `servers` sets the request target - and the only host the proxy will call - `tags` group endpoints in the sidebar, and `parameters` and `requestBody` become the inputs (adding a `securitySchemes` entry would produce authentication fields). Doccupine reads OpenAPI 3.0 and 3.1; see the [OpenAPI specification](https://spec.openapis.org) for the full format.\n\n## What gets generated\n\nThe generated `/api-reference` index lists every operation with a direct link, grouped by API and tag. Each operation also gets its own page under `/api-reference/{tag}/{operation}`, showing:\n\nOn a site with [languages](/languages) or [versions](/versions), the API reference is generated for the default language and version only, and its section tab is hidden under every other prefix. Hand-written pages inside a language or version folder are unaffected.\n\n<Callout type=\"note\">\n A hand-written MDX page takes precedence when it resolves to the same route as a generated OpenAPI page. Moving or deleting that MDX source returns the route to OpenAPI on the next successful refresh.\n</Callout>\n\n<Field value=\"Parameters\" type=\"path, query, header, cookie\">\nEach parameter is rendered with its name, type, and whether it is required, grouped into a collapsible section with an input to fill in.\n</Field>\n\n<Field value=\"Request body\" type=\"editable\">\nA JSON editor prefilled from the schema's example, ready to tweak and send.\n</Field>\n\n<Field value=\"Authentication\" type=\"from securitySchemes\">\nInputs for the endpoint's security schemes - API keys, bearer tokens, or basic auth - generated from the document.\n</Field>\n\n<Field value=\"Response\" type=\"live\">\nThe real status, timing, and body from your API, rendered to match its content type.\n</Field>\n\n## Embedding a single endpoint\n\nTo mix prose and a live endpoint on a hand-written page, reference an operation from the page's frontmatter with `openapi`. Use `METHOD /path` or an `operationId`:\n\n```mdx\n---\ntitle: \"Create a post\"\nopenapi: \"POST /posts\"\n---\n\nPosts are created for a user. The playground above is fully live - fill in the\nbody and send a real request.\n```\n\nDoccupine renders that endpoint's playground above your prose. If the reference does not match any operation in your document, the page still renders its prose and a warning is logged.\n\n## Running requests\n\nRequests run one of two ways, and readers can switch between them:\n\n<Callout type=\"note\">\n**Proxy (default).** The request is forwarded server-side, so it works even when the target API blocks cross-origin browser calls. **Direct.** The browser calls the API itself - useful when the API allows CORS and you want requests to never leave the reader's machine.\n</Callout>\n\nThe proxy is deliberately locked down. It only forwards to servers declared in your OpenAPI document and refuses private, internal, metadata, and reserved network addresses, including IPv4 destinations represented through IPv6 translation ranges. An explicitly declared loopback server such as `http://localhost:4000` is available only outside production for local development and tests; production always blocks loopback and every other private target even when the spec declares one. Request URLs, headers, and bodies are never logged, so API keys a reader enters are not written anywhere. On a [password-protected site](/authentication), the proxy also requires the visitor's unlocked session, so it cannot be called anonymously.\n\nProxy requests are rate limited per trusted client address on recognized hosting platforms. Unknown and self-hosted proxy setups share one fallback bucket rather than trusting spoofable forwarding headers; use your trusted edge or a shared rate-limit store when those deployments need accurate per-client limits.\n\n<Callout type=\"warning\">\nKeys and tokens a reader types are used only to make the request. Turn on \"Show secrets\" to reveal them in the generated code snippets; they are redacted by default.\n</Callout>\n\n## Responses and snippets\n\nResponses render to match their type: images and video play inline, everything else is shown as a formatted, syntax-highlighted body. Alongside the response, the playground generates ready-to-run **cURL**, **JavaScript**, and **Python** snippets for the exact request you built.\n\n## Documenting more than one API\n\nPass an array to document several APIs at once. Each spec becomes its own namespaced section:\n\n```json\n{\n \"openapi\": [\n { \"name\": \"public\", \"file\": \"specs/public.yaml\" },\n { \"name\": \"admin\", \"file\": \"specs/admin.yaml\" }\n ]\n}\n```\n";
@@ -98,6 +98,8 @@ Each part maps to something in the playground: \`servers\` sets the request targ
98
98
 
99
99
  The generated \`/api-reference\` index lists every operation with a direct link, grouped by API and tag. Each operation also gets its own page under \`/api-reference/{tag}/{operation}\`, showing:
100
100
 
101
+ On a site with [languages](/languages) or [versions](/versions), the API reference is generated for the default language and version only, and its section tab is hidden under every other prefix. Hand-written pages inside a language or version folder are unaffected.
102
+
101
103
  <Callout type="note">
102
104
  A hand-written MDX page takes precedence when it resolves to the same route as a generated OpenAPI page. Moving or deleting that MDX source returns the route to OpenAPI on the next successful refresh.
103
105
  </Callout>
@@ -1 +1 @@
1
- export declare const commandsMdxTemplate = "---\ntitle: \"Commands\"\ndescription: \"In this page, you can find all the commands available in Doccupine CLI.\"\ndate: \"2026-02-19\"\nupdated: \"2026-08-04\"\ncategory: \"Getting Started\"\ncategoryOrder: 0\norder: 2\n---\n# Commands\n\nIn this page, you can find all the commands available in Doccupine CLI.\n\n## Run Doccupine CLI\n\nCreate a new directory for your project and navigate to it in your terminal. Run the following command to create a new Doccupine project:\n\n```bash\nnpx doccupine\n```\n\nOnce you run the command, Doccupine will ask you to select a directory to store your MDX files. Choose the directory where you want to create your documentation files.\nAfter selecting the directory, Doccupine will ask you to enter the name of the directory for the generated website. Enter the name of the directory where you want to create your website.\nFinally, Doccupine will ask for an optional path to an OpenAPI document. Leave it blank to skip, or point it at a `.yaml`, `.yml`, or `.json` spec to generate an interactive [API Playground](/api-playground) from your API.\n\nThis will start the development server on port 3000. Open your browser and navigate to http://localhost:3000 to view your documentation.\n\n## Options\n\n| Flag | Description |\n| -------------------------- | --------------------------------------------------------------------------- |\n| `--port <port>` | Port for the dev server (default: `3000`). Auto-increments if taken. |\n| `--verbose` | Show all Next.js output including compilation details. |\n| `--reset` | Re-prompt for watch/output directories and the OpenAPI spec path. |\n| `--skip-install` | Always skip dependency installation before starting the development server. |\n| `--package-manager <name>` | Use `pnpm` or `npm` for the generated app instead of auto-detection. |\n\n<Callout type=\"warning\">\n The watch and output directories must not overlap. The output directory must be empty, contain only local metadata such as `.DS_Store` or `.env.local`, or already be owned by Doccupine. This prevents the generator from overwriting another project. If an older `doccupine.json` no longer validates, run `doccupine config --reset`. Generation also reports a validation error, instead of letting one page overwrite another, when two source files resolve to the same route.\n</Callout>\n\nStarter documentation is created only when the selected source directory contains no MDX files. Existing pages are never replaced just because `index.mdx` is missing. Frontmatter must use the normal YAML `---` delimiter; language-tagged executable frontmatter is rejected.\n\nDoccupine marks its output directory with `.doccupine-generated.json` and records generated route, Markdown-mirror, and copied public-file ownership in `.doccupine-artifacts.json`. Treat both files as internal generator state. A fresh run recreates `app`, and later refreshes may rewrite other registered template paths, so keep durable changes in source MDX, project-root JSON files, and `public`.\n\n## Watch mode\n\nThe default command watches MDX files, supported project-root JSON configuration, `fonts.json`, `analytics.json`, `doccupine.json`, public assets, and configured OpenAPI documents with their discovered local `$ref` files. Changes are processed serially. Once every watcher is ready, Doccupine compares the current sources with the versions used during initial generation and reconciles edits made while startup was still running.\n\n## Route collisions and recovery\n\nTwo MDX sources cannot generate the same route. For example, `guide.mdx` and `guide/index.mdx` both resolve to `/guide`. A one-time build stops before either source can overwrite the other.\n\nDuring watch mode, a collision keeps the last successfully generated page and site metadata in place. After you move, rename, or delete one of the colliding sources, Doccupine retries the blocked sources and any other MDX changes that could not be applied while the collision existed. A restart or manual resave is not required.\n\n<Callout type=\"info\">\n Failed watch refreshes keep or restore the last successful pages, route ownership, inferred sections, sitemap, and LLMS/MCP content. A new page with no successful version stays absent until it can be generated safely.\n</Callout>\n\n## Reloading doccupine.json\n\nChanging the `openapi` field is applied live after the complete candidate reference validates and generates successfully. Invalid JSON, invalid configuration, a missing spec, or a failed generation keeps the current OpenAPI reference and watcher active. Changes to `watchDir`, `outputDir`, `port`, or `packageManager` require restarting Doccupine.\n\n## File-system safety\n\nDoccupine does not follow symlinked MDX files or nested directories beneath `watchDir`. Project-root configuration and public assets must also use real files and directories, and the `public` root cannot be a symlink. A stable symlink used as the `watchDir` root is supported, but links inside it are rejected.\n\nThe output directory must be a real directory, and generated paths cannot contain symlinks. OpenAPI root specs must resolve inside the project, while local references must remain inside the root spec's directory. These checks prevent generated reads, writes, and removals from being redirected elsewhere.\n\n## Dependency installation\n\nThe first run installs the generated app's dependencies. After that, Doccupine records a fingerprint of the generated `package.json` and the package manager in `.doccupine-install` and reinstalls only when that fingerprint changes or `node_modules` is missing - later runs start the dev server straight away. Pass `--skip-install` to skip the check entirely, for example when you manage dependencies yourself.\n\n## Browsing from another device\n\nThe dev server is reachable from other devices on your network, but Next.js only serves development resources such as the hot-reload socket to hosts it recognizes. Opened over a LAN IP or a Tailscale/VPN hostname, the page renders but never becomes interactive.\n\nTo allow additional hostnames, set `ALLOWED_DEV_ORIGINS` in the generated app's `.env` file and restart the dev server. Comma-separate multiple hostnames:\n\n```env\nALLOWED_DEV_ORIGINS=my-machine.tailnet-name.ts.net\n```\n\n<Callout type=\"note\">\n This only affects the development server. Production builds ignore the\n variable, and leaving it unset keeps Next's DNS-rebinding protection fully\n enabled.\n</Callout>\n\n## Verbose mode\n\n```bash\nnpx doccupine --verbose\n```\n\n<Callout type=\"note\">\n This will show Next.js output in the terminal, providing detailed logs useful for debugging during development.\n</Callout>\n\n## Generate the website\n\n```bash\nnpx doccupine build\n```\n\nYou can also use the equivalent `npx doccupine generate` command. These commands scaffold the Next.js app from your MDX files without installing dependencies or starting the development server. To produce a production build, install dependencies and run the generated app's `build` script.\n\n## Show current configuration\n\n```bash\nnpx doccupine config --show\n```\n\nThis will show the current configuration for Doccupine.\n\n## Reset configuration\n\n```bash\nnpx doccupine config --reset\n```\n\nThis will reset the current configuration for Doccupine.";
1
+ export declare const commandsMdxTemplate = "---\ntitle: \"Commands\"\ndescription: \"In this page, you can find all the commands available in Doccupine CLI.\"\ndate: \"2026-02-19\"\nupdated: \"2026-08-04\"\ncategory: \"Getting Started\"\ncategoryOrder: 0\norder: 2\n---\n# Commands\n\nIn this page, you can find all the commands available in Doccupine CLI.\n\n## Run Doccupine CLI\n\nCreate a new directory for your project and navigate to it in your terminal. Run the following command to create a new Doccupine project:\n\n```bash\nnpx doccupine\n```\n\nOnce you run the command, Doccupine will ask you to select a directory to store your MDX files. Choose the directory where you want to create your documentation files.\nAfter selecting the directory, Doccupine will ask you to enter the name of the directory for the generated website. Enter the name of the directory where you want to create your website.\nFinally, Doccupine will ask for an optional path to an OpenAPI document. Leave it blank to skip, or point it at a `.yaml`, `.yml`, or `.json` spec to generate an interactive [API Playground](/api-playground) from your API.\n\nThis will start the development server on port 3000. Open your browser and navigate to http://localhost:3000 to view your documentation.\n\n## Options\n\n| Flag | Description |\n| -------------------------- | --------------------------------------------------------------------------- |\n| `--port <port>` | Port for the dev server (default: `3000`). Auto-increments if taken. |\n| `--verbose` | Show all Next.js output including compilation details. |\n| `--reset` | Re-prompt for watch/output directories and the OpenAPI spec path. |\n| `--skip-install` | Always skip dependency installation before starting the development server. |\n| `--package-manager <name>` | Use `pnpm` or `npm` for the generated app instead of auto-detection. |\n\n<Callout type=\"warning\">\n The watch and output directories must not overlap. The output directory must be empty, contain only local metadata such as `.DS_Store` or `.env.local`, or already be owned by Doccupine. This prevents the generator from overwriting another project. If an older `doccupine.json` no longer validates, run `doccupine config --reset`. Generation also reports a validation error, instead of letting one page overwrite another, when two source files resolve to the same route.\n</Callout>\n\nStarter documentation is created only when the selected source directory contains no MDX files. Existing pages are never replaced just because `index.mdx` is missing. Frontmatter must use the normal YAML `---` delimiter; language-tagged executable frontmatter is rejected.\n\nDoccupine marks its output directory with `.doccupine-generated.json` and records generated route, Markdown-mirror, and copied public-file ownership in `.doccupine-artifacts.json`. Treat both files as internal generator state. A fresh run recreates `app`, and later refreshes may rewrite other registered template paths, so keep durable changes in source MDX, project-root JSON files, and `public`.\n\n## Watch mode\n\nThe default command watches MDX files, supported project-root JSON configuration (including `languages.json` and `versions.json`, which regenerate the whole site when they change and keep the previous configuration while the file is invalid), `fonts.json`, `analytics.json`, `doccupine.json`, public assets, and configured OpenAPI documents with their discovered local `$ref` files. Changes are processed serially. Once every watcher is ready, Doccupine compares the current sources with the versions used during initial generation and reconciles edits made while startup was still running.\n\n## Route collisions and recovery\n\nTwo MDX sources cannot generate the same route. For example, `guide.mdx` and `guide/index.mdx` both resolve to `/guide`. A one-time build stops before either source can overwrite the other.\n\nDuring watch mode, a collision keeps the last successfully generated page and site metadata in place. After you move, rename, or delete one of the colliding sources, Doccupine retries the blocked sources and any other MDX changes that could not be applied while the collision existed. A restart or manual resave is not required.\n\n<Callout type=\"info\">\n Failed watch refreshes keep or restore the last successful pages, route ownership, inferred sections, sitemap, and LLMS/MCP content. A new page with no successful version stays absent until it can be generated safely.\n</Callout>\n\n## Reloading doccupine.json\n\nChanging the `openapi` field is applied live after the complete candidate reference validates and generates successfully. Invalid JSON, invalid configuration, a missing spec, or a failed generation keeps the current OpenAPI reference and watcher active. Changes to `watchDir`, `outputDir`, `port`, or `packageManager` require restarting Doccupine.\n\n## File-system safety\n\nDoccupine does not follow symlinked MDX files or nested directories beneath `watchDir`. Project-root configuration and public assets must also use real files and directories, and the `public` root cannot be a symlink. A stable symlink used as the `watchDir` root is supported, but links inside it are rejected.\n\nThe output directory must be a real directory, and generated paths cannot contain symlinks. OpenAPI root specs must resolve inside the project, while local references must remain inside the root spec's directory. These checks prevent generated reads, writes, and removals from being redirected elsewhere.\n\n## Dependency installation\n\nThe first run installs the generated app's dependencies. After that, Doccupine records a fingerprint of the generated `package.json` and the package manager in `.doccupine-install` and reinstalls only when that fingerprint changes or `node_modules` is missing - later runs start the dev server straight away. Pass `--skip-install` to skip the check entirely, for example when you manage dependencies yourself.\n\n## Browsing from another device\n\nThe dev server is reachable from other devices on your network, but Next.js only serves development resources such as the hot-reload socket to hosts it recognizes. Opened over a LAN IP or a Tailscale/VPN hostname, the page renders but never becomes interactive.\n\nTo allow additional hostnames, set `ALLOWED_DEV_ORIGINS` in the generated app's `.env` file and restart the dev server. Comma-separate multiple hostnames:\n\n```env\nALLOWED_DEV_ORIGINS=my-machine.tailnet-name.ts.net\n```\n\n<Callout type=\"note\">\n This only affects the development server. Production builds ignore the\n variable, and leaving it unset keeps Next's DNS-rebinding protection fully\n enabled.\n</Callout>\n\n## Verbose mode\n\n```bash\nnpx doccupine --verbose\n```\n\n<Callout type=\"note\">\n This will show Next.js output in the terminal, providing detailed logs useful for debugging during development.\n</Callout>\n\n## Generate the website\n\n```bash\nnpx doccupine build\n```\n\nYou can also use the equivalent `npx doccupine generate` command. These commands scaffold the Next.js app from your MDX files without installing dependencies or starting the development server. To produce a production build, install dependencies and run the generated app's `build` script.\n\n## Show current configuration\n\n```bash\nnpx doccupine config --show\n```\n\nThis will show the current configuration for Doccupine.\n\n## Reset configuration\n\n```bash\nnpx doccupine config --reset\n```\n\nThis will reset the current configuration for Doccupine.";
@@ -45,7 +45,7 @@ Doccupine marks its output directory with \`.doccupine-generated.json\` and reco
45
45
 
46
46
  ## Watch mode
47
47
 
48
- The default command watches MDX files, supported project-root JSON configuration, \`fonts.json\`, \`analytics.json\`, \`doccupine.json\`, public assets, and configured OpenAPI documents with their discovered local \`$ref\` files. Changes are processed serially. Once every watcher is ready, Doccupine compares the current sources with the versions used during initial generation and reconciles edits made while startup was still running.
48
+ The default command watches MDX files, supported project-root JSON configuration (including \`languages.json\` and \`versions.json\`, which regenerate the whole site when they change and keep the previous configuration while the file is invalid), \`fonts.json\`, \`analytics.json\`, \`doccupine.json\`, public assets, and configured OpenAPI documents with their discovered local \`$ref\` files. Changes are processed serially. Once every watcher is ready, Doccupine compares the current sources with the versions used during initial generation and reconciles edits made while startup was still running.
49
49
 
50
50
  ## Route collisions and recovery
51
51
 
@@ -1 +1 @@
1
- export declare const fontsMdxTemplate = "---\ntitle: \"Fonts\"\ndescription: \"Customize the documentation typography with a fonts.json file (Google Fonts or local custom fonts).\"\ndate: \"2026-02-19\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder: 6\n---\n# Fonts\n\nDefine your site\u2019s typography with a `fonts.json` file. You can load fonts from Google Fonts or from local font files bundled with your project.\n\n## fonts.json\n\nPlace a `fonts.json` at your project root (the same directory where you execute `npx doccupine`). Choose one of the following configurations depending on the source of your fonts.\n\n## Google Fonts\n\nUse this when your font is hosted by Google Fonts.\n\n```json\n{\n \"googleFont\": {\n \"fontName\": \"Work_Sans\",\n \"subsets\": [\"latin\"],\n \"weight\": \"400\"\n }\n}\n```\n\n### Rules\n\n- **fontName**: Capitalize each word. If the name contains spaces, replace them with `_`.\n - Example: \"Work Sans\" \u2192 `Work_Sans`\n- **subsets**: Pick the subsets you need (for example, `latin`).\n- **weight**: The font weight to load - a single string (for example, `\"400\"`) or an array of strings (for example, `[\"400\", \"500\", \"700\"]`).\n\n<Callout type=\"warning\">\n The `fontName` must match the Google Fonts name exactly - capitalize each word and replace spaces with underscores.\n</Callout>\n\n### Tips\n\n- **One primary family**: Start with a single family and weight, then add more if needed.\n- **Readability**: Choose readable body fonts; reserve display fonts for headings.\n\n## Local custom fonts\n\nUse this when you want to ship your own font files. Upload your font files to the Next.js `public` directory, then reference them with relative paths.\n\n```json\n{\n \"localFonts\": {\n \"src\": [\n {\n \"path\": \"../public/font.woff\",\n \"weight\": \"400\",\n \"style\": \"normal\"\n },\n {\n \"path\": \"../public/font.woff\",\n \"weight\": \"400\",\n \"style\": \"italic\"\n },\n {\n \"path\": \"../public/font.woff\",\n \"weight\": \"700\",\n \"style\": \"normal\"\n },\n {\n \"path\": \"../public/font.woff\",\n \"weight\": \"700\",\n \"style\": \"italic\"\n }\n ]\n }\n}\n```\n\n### Single file shorthand\n\nIf you have only one file, you can use:\n\n```json\n{\n \"localFonts\": \"../public/font.woff\"\n}\n```\n\n### Rules\n\n- **Upload files**: Place `font.woff` (and any additional weights/styles) in your Next.js `public` directory.\n- **path**: Use a relative path to the file from where it is consumed by your build tooling; the example above uses `../public/font.woff`.\n- **weight**: String value of the font weight (for example, `\"400\"`, `\"700\"`).\n- **style**: `\"normal\"` or `\"italic\"`.\n\n### Tips\n\n- **Provide only what you need**: Include the minimal set of weights/styles to keep bundle size small.\n- **File formats**: `.woff` is broadly supported and recommended for the web.\n\n## Behavior\n\n- **Placement**: Put `fonts.json` in the project root alongside `config.json` and (optionally) `theme.json`.\n- **Validation**: Follow the naming rule for `googleFont.fontName` (capitalize, replace spaces with `_`).\n\n<Callout type=\"note\">\n When using local fonts, ensure the referenced files exist under the Next.js `public` directory. The paths in `fonts.json` are relative to where they are consumed by the build tooling.\n</Callout>\n\n## Examples\n\n- **Google Fonts (single weight)**\n\n```json\n{\n \"googleFont\": {\n \"fontName\": \"Work_Sans\",\n \"subsets\": [\"latin\"],\n \"weight\": \"400\"\n }\n}\n```\n\n- **Google Fonts (multiple weights)**\n\n```json\n{\n \"googleFont\": {\n \"fontName\": \"Work_Sans\",\n \"subsets\": [\"latin\"],\n \"weight\": [\"400\", \"500\", \"600\", \"700\"]\n }\n}\n```\n\n- **Local fonts (multiple weights/styles)**\n\n```json\n{\n \"localFonts\": {\n \"src\": [\n { \"path\": \"../public/font.woff\", \"weight\": \"400\", \"style\": \"normal\" },\n { \"path\": \"../public/font.woff\", \"weight\": \"400\", \"style\": \"italic\" },\n { \"path\": \"../public/font.woff\", \"weight\": \"700\", \"style\": \"normal\" },\n { \"path\": \"../public/font.woff\", \"weight\": \"700\", \"style\": \"italic\" }\n ]\n }\n}\n```";
1
+ export declare const fontsMdxTemplate = "---\ntitle: \"Fonts\"\ndescription: \"Customize the documentation typography with a fonts.json file (Google Fonts or local custom fonts).\"\ndate: \"2026-02-19\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder: 8\n---\n# Fonts\n\nDefine your site\u2019s typography with a `fonts.json` file. You can load fonts from Google Fonts or from local font files bundled with your project.\n\n## fonts.json\n\nPlace a `fonts.json` at your project root (the same directory where you execute `npx doccupine`). Choose one of the following configurations depending on the source of your fonts.\n\n## Google Fonts\n\nUse this when your font is hosted by Google Fonts.\n\n```json\n{\n \"googleFont\": {\n \"fontName\": \"Work_Sans\",\n \"subsets\": [\"latin\"],\n \"weight\": \"400\"\n }\n}\n```\n\n### Rules\n\n- **fontName**: Capitalize each word. If the name contains spaces, replace them with `_`.\n - Example: \"Work Sans\" \u2192 `Work_Sans`\n- **subsets**: Pick the subsets you need (for example, `latin`).\n- **weight**: The font weight to load - a single string (for example, `\"400\"`) or an array of strings (for example, `[\"400\", \"500\", \"700\"]`).\n\n<Callout type=\"warning\">\n The `fontName` must match the Google Fonts name exactly - capitalize each word and replace spaces with underscores.\n</Callout>\n\n### Tips\n\n- **One primary family**: Start with a single family and weight, then add more if needed.\n- **Readability**: Choose readable body fonts; reserve display fonts for headings.\n\n## Local custom fonts\n\nUse this when you want to ship your own font files. Upload your font files to the Next.js `public` directory, then reference them with relative paths.\n\n```json\n{\n \"localFonts\": {\n \"src\": [\n {\n \"path\": \"../public/font.woff\",\n \"weight\": \"400\",\n \"style\": \"normal\"\n },\n {\n \"path\": \"../public/font.woff\",\n \"weight\": \"400\",\n \"style\": \"italic\"\n },\n {\n \"path\": \"../public/font.woff\",\n \"weight\": \"700\",\n \"style\": \"normal\"\n },\n {\n \"path\": \"../public/font.woff\",\n \"weight\": \"700\",\n \"style\": \"italic\"\n }\n ]\n }\n}\n```\n\n### Single file shorthand\n\nIf you have only one file, you can use:\n\n```json\n{\n \"localFonts\": \"../public/font.woff\"\n}\n```\n\n### Rules\n\n- **Upload files**: Place `font.woff` (and any additional weights/styles) in your Next.js `public` directory.\n- **path**: Use a relative path to the file from where it is consumed by your build tooling; the example above uses `../public/font.woff`.\n- **weight**: String value of the font weight (for example, `\"400\"`, `\"700\"`).\n- **style**: `\"normal\"` or `\"italic\"`.\n\n### Tips\n\n- **Provide only what you need**: Include the minimal set of weights/styles to keep bundle size small.\n- **File formats**: `.woff` is broadly supported and recommended for the web.\n\n## Behavior\n\n- **Placement**: Put `fonts.json` in the project root alongside `config.json` and (optionally) `theme.json`.\n- **Validation**: Follow the naming rule for `googleFont.fontName` (capitalize, replace spaces with `_`).\n\n<Callout type=\"note\">\n When using local fonts, ensure the referenced files exist under the Next.js `public` directory. The paths in `fonts.json` are relative to where they are consumed by the build tooling.\n</Callout>\n\n## Examples\n\n- **Google Fonts (single weight)**\n\n```json\n{\n \"googleFont\": {\n \"fontName\": \"Work_Sans\",\n \"subsets\": [\"latin\"],\n \"weight\": \"400\"\n }\n}\n```\n\n- **Google Fonts (multiple weights)**\n\n```json\n{\n \"googleFont\": {\n \"fontName\": \"Work_Sans\",\n \"subsets\": [\"latin\"],\n \"weight\": [\"400\", \"500\", \"600\", \"700\"]\n }\n}\n```\n\n- **Local fonts (multiple weights/styles)**\n\n```json\n{\n \"localFonts\": {\n \"src\": [\n { \"path\": \"../public/font.woff\", \"weight\": \"400\", \"style\": \"normal\" },\n { \"path\": \"../public/font.woff\", \"weight\": \"400\", \"style\": \"italic\" },\n { \"path\": \"../public/font.woff\", \"weight\": \"700\", \"style\": \"normal\" },\n { \"path\": \"../public/font.woff\", \"weight\": \"700\", \"style\": \"italic\" }\n ]\n }\n}\n```";
@@ -4,7 +4,7 @@ description: "Customize the documentation typography with a fonts.json file (Goo
4
4
  date: "2026-02-19"
5
5
  category: "Configuration"
6
6
  categoryOrder: 2
7
- order: 6
7
+ order: 8
8
8
  ---
9
9
  # Fonts
10
10
 
@@ -1 +1 @@
1
- export declare const footerLinksMdxTemplate = "---\ntitle: \"Footer Links\"\ndescription: \"Add static links at the bottom of the documentation pages.\"\ndate: \"2026-02-19\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder: 4\n---\n# Footer Links\n\nAdd a row of static links at the bottom of your documentation pages, just above the footer. Links open in a new tab and are useful for pointing users to related resources, repositories, or external docs.\n\n## links.json\n\nPlace a `links.json` at your project root (the same directory where you execute `npx doccupine`). When present, Doccupine displays the links at the bottom of each page. You can add as many links as you need.\n\n### Example links.json\n\n```json\n[\n {\n \"title\": \"Back to Home\",\n \"url\": \"https://doccupine.com\",\n \"icon\": \"arrow-left\"\n },\n {\n \"title\": \"GitHub\",\n \"url\": \"https://github.com/doccupine\",\n \"icon\": \"git-branch\"\n },\n {\n \"title\": \"Discord\",\n \"url\": \"https://discord.gg/E9BufYGPhG\",\n \"icon\": \"message-circle\"\n }\n]\n```\n\n### Fields\n\n- **title**: The label shown for the link.\n- **url**: The destination URL. Links open in a new tab with `target=\"_blank\"` and `rel=\"noopener noreferrer\"`.\n- **icon**: The icon to display next to the label. Icons are from [Lucide](https://lucide.dev/).\n\n## Behavior\n\n- **Empty or missing file**: If `links.json` is empty or not present, the footer links are hidden.\n- **Order**: Links appear in the same order as in the array.\n- **No limit**: Add as many links as you want; they wrap automatically on smaller screens.";
1
+ export declare const footerLinksMdxTemplate = "---\ntitle: \"Footer Links\"\ndescription: \"Add static links at the bottom of the documentation pages.\"\ndate: \"2026-02-19\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder: 6\n---\n# Footer Links\n\nAdd a row of static links at the bottom of your documentation pages, just above the footer. Links open in a new tab and are useful for pointing users to related resources, repositories, or external docs.\n\n## links.json\n\nPlace a `links.json` at your project root (the same directory where you execute `npx doccupine`). When present, Doccupine displays the links at the bottom of each page. You can add as many links as you need.\n\n### Example links.json\n\n```json\n[\n {\n \"title\": \"Back to Home\",\n \"url\": \"https://doccupine.com\",\n \"icon\": \"arrow-left\"\n },\n {\n \"title\": \"GitHub\",\n \"url\": \"https://github.com/doccupine\",\n \"icon\": \"git-branch\"\n },\n {\n \"title\": \"Discord\",\n \"url\": \"https://discord.gg/E9BufYGPhG\",\n \"icon\": \"message-circle\"\n }\n]\n```\n\n### Fields\n\n- **title**: The label shown for the link.\n- **url**: The destination URL. Links open in a new tab with `target=\"_blank\"` and `rel=\"noopener noreferrer\"`.\n- **icon**: The icon to display next to the label. Icons are from [Lucide](https://lucide.dev/).\n\n## Behavior\n\n- **Empty or missing file**: If `links.json` is empty or not present, the footer links are hidden.\n- **Order**: Links appear in the same order as in the array.\n- **No limit**: Add as many links as you want; they wrap automatically on smaller screens.";
@@ -4,7 +4,7 @@ description: "Add static links at the bottom of the documentation pages."
4
4
  date: "2026-02-19"
5
5
  category: "Configuration"
6
6
  categoryOrder: 2
7
- order: 4
7
+ order: 6
8
8
  ---
9
9
  # Footer Links
10
10
 
@@ -1 +1 @@
1
- export declare const indexMdxTemplate = "---\ntitle: \"Introduction\"\ndescription: \"Doccupine is a free and open-source documentation platform. Write MDX, get a production-ready site with AI chat, built-in components, and an MCP server - in one command.\"\ndate: \"2026-02-19\"\ncategory: \"Getting Started\"\ncategoryOrder: 0\ncategoryIcon: \"rocket\"\norder: 0\n---\n# Welcome to Doccupine\n\nDoccupine turns a directory of MDX files into a beautiful, production-ready documentation website. Write in standard Markdown, use any of the built-in components, and get a fully themed site with AI-powered search and automatic navigation - all from one command.\n\n```bash\nnpx doccupine\n```\n\nThat's it. Doccupine prompts you for a source directory, generates your site, and starts a dev server at `http://localhost:3000`. Every edit rebuilds instantly.\n\n<Callout type=\"info\">\n Want a managed experience instead? The [Doccupine Platform](/platform) gives you a browser-based editor, one-click publishing, custom domains, and team collaboration - no local setup needed.\n</Callout>\n\n## How it works\n\nYou write `.mdx` files using Markdown and built-in components like this one. Doccupine watches your files, generates pages, builds the sidebar from your frontmatter, and handles theming, AI chat, and deployment config for you.\n\nEverything on this page - the callout above, the cards below, the code block - is a live example of what your docs can look like out of the box.\n\n<Columns cols={2}>\n <Card title=\"Start writing\" icon=\"pencil\" href=\"/components\">\n Rich docs from day one. 14+ components work out of the box - no imports needed.\n </Card>\n <Card title=\"Ship it\" icon=\"rocket\" href=\"/deployment-and-hosting\">\n Deploy to the Doccupine Platform or self-host on any platform that supports Next.js.\n </Card>\n</Columns>\n\n## Configure your site\n\nDoccupine works with no configuration, but when you're ready to customize, everything is controlled through simple JSON files in your project root.\n\n- [Global settings](/globals) - Site name, description, favicon, and preview image via `config.json`\n- [Navigation](/navigation) - Override the auto-generated sidebar with `navigation.json`\n- [Theme](/theme) - Colors, logos, and dark mode palette via `theme.json`\n- [Fonts](/fonts) - Google Fonts or local font files via `fonts.json`\n- [AI Assistant](/ai-assistant) - Enable the built-in chat with your own API key\n- [MCP Server](/model-context-protocol) - Let AI tools search your docs through `/api/mcp`";
1
+ export declare const indexMdxTemplate = "---\ntitle: \"Introduction\"\ndescription: \"Doccupine is a free and open-source documentation platform. Write MDX, get a production-ready site with AI chat, built-in components, and an MCP server - in one command.\"\ndate: \"2026-02-19\"\ncategory: \"Getting Started\"\ncategoryOrder: 0\ncategoryIcon: \"rocket\"\norder: 0\n---\n# Welcome to Doccupine\n\nDoccupine turns a directory of MDX files into a beautiful, production-ready documentation website. Write in standard Markdown, use any of the built-in components, and get a fully themed site with AI-powered search and automatic navigation - all from one command.\n\n```bash\nnpx doccupine\n```\n\nThat's it. Doccupine prompts you for a source directory, generates your site, and starts a dev server at `http://localhost:3000`. Every edit rebuilds instantly.\n\n<Callout type=\"info\">\n Want a managed experience instead? The [Doccupine Platform](/platform) gives you a browser-based editor, one-click publishing, custom domains, and team collaboration - no local setup needed.\n</Callout>\n\n## How it works\n\nYou write `.mdx` files using Markdown and built-in components like this one. Doccupine watches your files, generates pages, builds the sidebar from your frontmatter, and handles theming, AI chat, and deployment config for you.\n\nEverything on this page - the callout above, the cards below, the code block - is a live example of what your docs can look like out of the box.\n\n<Columns cols={2}>\n <Card title=\"Start writing\" icon=\"pencil\" href=\"/components\">\n Rich docs from day one. 14+ components work out of the box - no imports needed.\n </Card>\n <Card title=\"Ship it\" icon=\"rocket\" href=\"/deployment-and-hosting\">\n Deploy to the Doccupine Platform or self-host on any platform that supports Next.js.\n </Card>\n</Columns>\n\n## Configure your site\n\nDoccupine works with no configuration, but when you're ready to customize, everything is controlled through simple JSON files in your project root.\n\n- [Global settings](/globals) - Site name, description, favicon, and preview image via `config.json`\n- [Navigation](/navigation) - Override the auto-generated sidebar with `navigation.json`\n- [Theme](/theme) - Colors, logos, and dark mode palette via `theme.json`\n- [Fonts](/fonts) - Google Fonts or local font files via `fonts.json`\n- [Languages](/languages) - Translate your docs, one folder per language, via `languages.json`\n- [Versions](/versions) - Keep older releases online, one folder per version, via `versions.json`\n- [AI Assistant](/ai-assistant) - Enable the built-in chat with your own API key\n- [MCP Server](/model-context-protocol) - Let AI tools search your docs through `/api/mcp`";
@@ -45,5 +45,7 @@ Doccupine works with no configuration, but when you're ready to customize, every
45
45
  - [Navigation](/navigation) - Override the auto-generated sidebar with \`navigation.json\`
46
46
  - [Theme](/theme) - Colors, logos, and dark mode palette via \`theme.json\`
47
47
  - [Fonts](/fonts) - Google Fonts or local font files via \`fonts.json\`
48
+ - [Languages](/languages) - Translate your docs, one folder per language, via \`languages.json\`
49
+ - [Versions](/versions) - Keep older releases online, one folder per version, via \`versions.json\`
48
50
  - [AI Assistant](/ai-assistant) - Enable the built-in chat with your own API key
49
51
  - [MCP Server](/model-context-protocol) - Let AI tools search your docs through \`/api/mcp\``;
@@ -0,0 +1 @@
1
+ export declare const languagesMdxTemplate = "---\ntitle: \"Languages\"\ndescription: \"Publish your documentation in several languages from one project, with a language switcher, hreflang tags, and scoped search.\"\ndate: \"2026-09-08\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder: 4\n---\n# Languages\n\nTranslate your documentation by adding a `languages.json` file and one folder per language. Each language gets its own URL prefix, its own sidebar, a switcher in the sidebar, `hreflang` tags for search engines, and search and AI chat that stay inside the language the reader is looking at.\n\n<Callout type=\"note\">\n Languages are entirely opt-in. Without a `languages.json` file nothing changes: your docs live at the root of the docs folder and publish exactly as before.\n</Callout>\n\n## Configuration\n\nCreate `languages.json` in your project root, next to `doccupine.json`:\n\n```json\n[\n { \"code\": \"en\", \"label\": \"English\", \"default\": true },\n { \"code\": \"de\", \"label\": \"Deutsch\" }\n]\n```\n\n- **code**: a lowercase URL segment (letters, digits, and hyphens, such as `en`, `de`, or `pt-br`). It is the folder name, the URL prefix, and the value of the page's `lang` and `hreflang` attributes.\n- **label**: the name shown in the language switcher.\n- **default**: exactly one entry must be the default. Its pages live at the docs root and keep unprefixed URLs.\n- **strings** (optional): overrides for the site's own interface text in that language. See [Interface strings](#interface-strings).\n\nThe order of the entries is the order of the switcher.\n\n## Folder layout\n\nThe default language lives at the root of the docs folder. Every other language lives in a folder named after its code, mirroring the default layout:\n\n```text\ndocs/\n index.mdx -> /\n guides/\n intro.mdx -> /guides/intro\n de/\n index.mdx -> /de\n guides/\n intro.mdx -> /de/guides/intro\n```\n\nA page is the translation of another when it sits at the same path inside its language folder. Only translated pages exist in a language: a page you have not translated yet returns a 404 under that language's prefix, and the switcher takes readers to that language's home page instead.\n\nA language folder without an `index.mdx` gets a generated home page that redirects to its first page.\n\n## What the generated site does\n\n- **Switcher**: the sidebar footer row, between the focus-mode and theme toggles, shows a language dropdown when at least two languages are configured: a 30px pill carrying the current language that opens a menu of every language above it (the same dropdown the Doccupine platform uses), with the arrow keys, Escape, and a click outside to close it. When a version switcher shares the row, the two pills grow from their labels' widths to fill the sidebar's free width, and on the narrow desktop rail each shows its short form: the language's code and the version's own label. Switching goes to the same page in the chosen language when it exists, otherwise to that language's home.\n- **Sidebar and sections**: the sidebar lists only the pages of the current language. [Sections](/sections) work inside every language; a section tab is hidden in a language that has no pages in it.\n- **Search and AI chat**: results and answers come from the current language only. The MCP server's `search_docs` and `list_docs` tools accept a `language` parameter and default to the default language.\n- **SEO**: every translated page carries `alternates.languages` (`hreflang`) links to its other languages, an `x-default` pointing at the default language, and an Open Graph locale. The sitemap lists the same alternates. The `<main>` element carries the page's `lang` attribute; the `<html lang>` attribute is the default language server-side and is corrected from the URL before the first paint.\n- **Agents**: each language has its own `llms.txt` and `llms-full.txt` under its prefix (`/de/llms.txt`), and the root files link to them.\n\n## Navigation\n\nFrontmatter navigation is built per language automatically. To define a language's sidebar by hand, key `navigation.json` by URL prefix: `\"de\"` for the German root, `\"de/api\"` for the German API section. See [Navigation](/navigation).\n\n## Interface strings\n\nThe generated site's own labels (the search box, \"On this page\", the previous and next links, the action bar, the footer) are English by default. Override any of them per language with a `strings` object:\n\n```json\n[\n { \"code\": \"en\", \"label\": \"English\", \"default\": true },\n {\n \"code\": \"de\",\n \"label\": \"Deutsch\",\n \"strings\": {\n \"searchPlaceholder\": \"Dokumentation durchsuchen...\",\n \"onThisPage\": \"Auf dieser Seite\",\n \"previous\": \"Zur\u00FCck\",\n \"next\": \"Weiter\"\n }\n }\n]\n```\n\nKeys you leave out keep their default. The known keys are `searchButton`, `searchDialog`, `searchPlaceholder`, `searchResults`, `searching`, `noResults`, `resultsAvailable` (with a `{count}` placeholder), `resultAvailable`, `askAi`, `askAiAssistant`, `closeSearch`, `onThisPage`, `previous`, `next`, `openNavigation`, `closeNavigation`, `expandGroup` and `collapseGroup` (both with a `{title}` placeholder), `enterFocusMode`, `exitFocusMode`, `focusMode`, `copyContent`, `copied`, `copyCode`, `codeVariants`, `rss`, `rssFeed`, `viewAsMarkdown`, `toggleView`, `poweredBy`, `githubLink`, `aiAssistant`, `resetChat`, `chatGreeting`, `chatPlaceholder`, `chatInputLabel`, `chatAnswering`, `chatError`, `language`, and `version`. An unknown key is reported when the site is generated and ignored.\n\n## Rules\n\n- A language code must not be the slug of a [section](/sections), the first folder of a section's `directory`, a [version](/versions) slug, or one of the reserved segments `api`, `gate`, `mcp`, and `ingest`. The build stops with a message naming the file when it is.\n- The default language has no folder: a `docs/en/` folder on a site whose default is `en` stops the build.\n- When [versions](/versions) are configured too, the language folder comes first: `docs/de/v1/`.\n- The API reference generated from an OpenAPI spec is published in the default language only.\n";
@@ -0,0 +1,94 @@
1
+ export const languagesMdxTemplate = `---
2
+ title: "Languages"
3
+ description: "Publish your documentation in several languages from one project, with a language switcher, hreflang tags, and scoped search."
4
+ date: "2026-09-08"
5
+ category: "Configuration"
6
+ categoryOrder: 2
7
+ order: 4
8
+ ---
9
+ # Languages
10
+
11
+ Translate your documentation by adding a \`languages.json\` file and one folder per language. Each language gets its own URL prefix, its own sidebar, a switcher in the sidebar, \`hreflang\` tags for search engines, and search and AI chat that stay inside the language the reader is looking at.
12
+
13
+ <Callout type="note">
14
+ Languages are entirely opt-in. Without a \`languages.json\` file nothing changes: your docs live at the root of the docs folder and publish exactly as before.
15
+ </Callout>
16
+
17
+ ## Configuration
18
+
19
+ Create \`languages.json\` in your project root, next to \`doccupine.json\`:
20
+
21
+ \`\`\`json
22
+ [
23
+ { "code": "en", "label": "English", "default": true },
24
+ { "code": "de", "label": "Deutsch" }
25
+ ]
26
+ \`\`\`
27
+
28
+ - **code**: a lowercase URL segment (letters, digits, and hyphens, such as \`en\`, \`de\`, or \`pt-br\`). It is the folder name, the URL prefix, and the value of the page's \`lang\` and \`hreflang\` attributes.
29
+ - **label**: the name shown in the language switcher.
30
+ - **default**: exactly one entry must be the default. Its pages live at the docs root and keep unprefixed URLs.
31
+ - **strings** (optional): overrides for the site's own interface text in that language. See [Interface strings](#interface-strings).
32
+
33
+ The order of the entries is the order of the switcher.
34
+
35
+ ## Folder layout
36
+
37
+ The default language lives at the root of the docs folder. Every other language lives in a folder named after its code, mirroring the default layout:
38
+
39
+ \`\`\`text
40
+ docs/
41
+ index.mdx -> /
42
+ guides/
43
+ intro.mdx -> /guides/intro
44
+ de/
45
+ index.mdx -> /de
46
+ guides/
47
+ intro.mdx -> /de/guides/intro
48
+ \`\`\`
49
+
50
+ A page is the translation of another when it sits at the same path inside its language folder. Only translated pages exist in a language: a page you have not translated yet returns a 404 under that language's prefix, and the switcher takes readers to that language's home page instead.
51
+
52
+ A language folder without an \`index.mdx\` gets a generated home page that redirects to its first page.
53
+
54
+ ## What the generated site does
55
+
56
+ - **Switcher**: the sidebar footer row, between the focus-mode and theme toggles, shows a language dropdown when at least two languages are configured: a 30px pill carrying the current language that opens a menu of every language above it (the same dropdown the Doccupine platform uses), with the arrow keys, Escape, and a click outside to close it. When a version switcher shares the row, the two pills grow from their labels' widths to fill the sidebar's free width, and on the narrow desktop rail each shows its short form: the language's code and the version's own label. Switching goes to the same page in the chosen language when it exists, otherwise to that language's home.
57
+ - **Sidebar and sections**: the sidebar lists only the pages of the current language. [Sections](/sections) work inside every language; a section tab is hidden in a language that has no pages in it.
58
+ - **Search and AI chat**: results and answers come from the current language only. The MCP server's \`search_docs\` and \`list_docs\` tools accept a \`language\` parameter and default to the default language.
59
+ - **SEO**: every translated page carries \`alternates.languages\` (\`hreflang\`) links to its other languages, an \`x-default\` pointing at the default language, and an Open Graph locale. The sitemap lists the same alternates. The \`<main>\` element carries the page's \`lang\` attribute; the \`<html lang>\` attribute is the default language server-side and is corrected from the URL before the first paint.
60
+ - **Agents**: each language has its own \`llms.txt\` and \`llms-full.txt\` under its prefix (\`/de/llms.txt\`), and the root files link to them.
61
+
62
+ ## Navigation
63
+
64
+ Frontmatter navigation is built per language automatically. To define a language's sidebar by hand, key \`navigation.json\` by URL prefix: \`"de"\` for the German root, \`"de/api"\` for the German API section. See [Navigation](/navigation).
65
+
66
+ ## Interface strings
67
+
68
+ The generated site's own labels (the search box, "On this page", the previous and next links, the action bar, the footer) are English by default. Override any of them per language with a \`strings\` object:
69
+
70
+ \`\`\`json
71
+ [
72
+ { "code": "en", "label": "English", "default": true },
73
+ {
74
+ "code": "de",
75
+ "label": "Deutsch",
76
+ "strings": {
77
+ "searchPlaceholder": "Dokumentation durchsuchen...",
78
+ "onThisPage": "Auf dieser Seite",
79
+ "previous": "Zurück",
80
+ "next": "Weiter"
81
+ }
82
+ }
83
+ ]
84
+ \`\`\`
85
+
86
+ Keys you leave out keep their default. The known keys are \`searchButton\`, \`searchDialog\`, \`searchPlaceholder\`, \`searchResults\`, \`searching\`, \`noResults\`, \`resultsAvailable\` (with a \`{count}\` placeholder), \`resultAvailable\`, \`askAi\`, \`askAiAssistant\`, \`closeSearch\`, \`onThisPage\`, \`previous\`, \`next\`, \`openNavigation\`, \`closeNavigation\`, \`expandGroup\` and \`collapseGroup\` (both with a \`{title}\` placeholder), \`enterFocusMode\`, \`exitFocusMode\`, \`focusMode\`, \`copyContent\`, \`copied\`, \`copyCode\`, \`codeVariants\`, \`rss\`, \`rssFeed\`, \`viewAsMarkdown\`, \`toggleView\`, \`poweredBy\`, \`githubLink\`, \`aiAssistant\`, \`resetChat\`, \`chatGreeting\`, \`chatPlaceholder\`, \`chatInputLabel\`, \`chatAnswering\`, \`chatError\`, \`language\`, and \`version\`. An unknown key is reported when the site is generated and ignored.
87
+
88
+ ## Rules
89
+
90
+ - A language code must not be the slug of a [section](/sections), the first folder of a section's \`directory\`, a [version](/versions) slug, or one of the reserved segments \`api\`, \`gate\`, \`mcp\`, and \`ingest\`. The build stops with a message naming the file when it is.
91
+ - The default language has no folder: a \`docs/en/\` folder on a site whose default is \`en\` stops the build.
92
+ - When [versions](/versions) are configured too, the language folder comes first: \`docs/de/v1/\`.
93
+ - The API reference generated from an OpenAPI spec is published in the default language only.
94
+ `;
@@ -1 +1 @@
1
- export declare const mediaAndAssetsMdxTemplate = "---\ntitle: \"Media and assets\"\ndescription: \"Serve static files like images, favicons, fonts, and Open Graph previews from the public directory.\"\ndate: \"2026-02-19\"\nupdated: \"2026-08-04\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder: 7\n---\n# Media and assets\n\nDoccupine watches a `public` directory in your project root (the same directory where you execute `npx doccupine`) and copies its contents into the generated Next.js `public` directory. Use it to serve static files such as favicons, Open Graph preview images, custom fonts, or any other media your documentation needs.\n\n## The public directory\n\nCreate a `public` directory at your project root. Any file you place inside is automatically synced to the generated site and served from the root URL path.\n\n```text\nmy-docs/\n\u251C\u2500\u2500 public/\n\u2502 \u251C\u2500\u2500 og-image.png\n\u2502 \u251C\u2500\u2500 logo.svg\n\u2502 \u2514\u2500\u2500 fonts/\n\u2502 \u2514\u2500\u2500 custom-font.woff2\n\u251C\u2500\u2500 docs/\n\u2502 \u2514\u2500\u2500 index.mdx\n\u251C\u2500\u2500 config.json\n\u2514\u2500\u2500 theme.json\n```\n\n## How assets are served\n\nFiles in the `public` directory are available at the root of your deployed domain. The path inside `public` maps directly to the URL path.\n\n| File | URL |\n| -------------------------------- | ------------------------------------------------- |\n| `public/og-image.png` | `https://your-domain.com/og-image.png` |\n| `public/logo.svg` | `https://your-domain.com/logo.svg` |\n| `public/fonts/custom-font.woff2` | `https://your-domain.com/fonts/custom-font.woff2` |\n\n## Common use cases\n\n### Favicon\n\nPrefer the icon file convention: drop an `icon.png` (and optionally `icon-dark.png` and `apple-icon.png`) at your project root, next to `config.json`, and Doccupine wires it into every page's metadata with cache-busting URLs. See [Icon files](/globals#icon-files).\n\nIf a legacy tool needs the bare `/favicon.ico` path, drop a `favicon.ico` into the `public` directory and it is served from the root path as-is.\n\n### Open Graph preview image\n\nAdd an image for link previews on social media. Reference it in your `config.json` so Doccupine sets the correct meta tags.\n\n```text\npublic/og-image.png \u2192 https://your-domain.com/og-image.png\n```\n\n### Custom fonts\n\nPlace font files in `public` and reference them from your `fonts.json`. See the **Fonts** page for full configuration details.\n\n```text\npublic/fonts/custom-font.woff2 \u2192 https://your-domain.com/fonts/custom-font.woff2\n```\n\n### Images and other media\n\nAny image or file you want to reference in your MDX pages can live in `public`. Use a root-relative path in your content:\n\n```mdx\n![Architecture diagram](/architecture.png)\n```\n\n## Live syncing\n\n<Callout type=\"info\">\n Doccupine watches the `public` directory for changes while running. When you add, update, or remove a file, the generated site is updated automatically.\n</Callout>\n\n<Callout type=\"warning\">\n The `public` directory and everything beneath it must use real files and directories. Doccupine rejects symlinks instead of following or copying them, including links whose targets are inside the project.\n</Callout>\n\n## Tips\n\n- **Keep it flat**: For a small number of files, placing them directly in `public` keeps paths short and simple.\n- **Use subdirectories for organization**: For larger projects, group assets into directories like `public/fonts`, `public/images`, or `public/icons`.\n- **Mind file size**: Optimize images before adding them to keep deployment size and load times low.\n- **Consistent naming**: Use lowercase, hyphen-separated filenames (e.g., `og-image.png`) for predictable URLs.";
1
+ export declare const mediaAndAssetsMdxTemplate = "---\ntitle: \"Media and assets\"\ndescription: \"Serve static files like images, favicons, fonts, and Open Graph previews from the public directory.\"\ndate: \"2026-02-19\"\nupdated: \"2026-08-04\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder: 9\n---\n# Media and assets\n\nDoccupine watches a `public` directory in your project root (the same directory where you execute `npx doccupine`) and copies its contents into the generated Next.js `public` directory. Use it to serve static files such as favicons, Open Graph preview images, custom fonts, or any other media your documentation needs.\n\n## The public directory\n\nCreate a `public` directory at your project root. Any file you place inside is automatically synced to the generated site and served from the root URL path.\n\n```text\nmy-docs/\n\u251C\u2500\u2500 public/\n\u2502 \u251C\u2500\u2500 og-image.png\n\u2502 \u251C\u2500\u2500 logo.svg\n\u2502 \u2514\u2500\u2500 fonts/\n\u2502 \u2514\u2500\u2500 custom-font.woff2\n\u251C\u2500\u2500 docs/\n\u2502 \u2514\u2500\u2500 index.mdx\n\u251C\u2500\u2500 config.json\n\u2514\u2500\u2500 theme.json\n```\n\n## How assets are served\n\nFiles in the `public` directory are available at the root of your deployed domain. The path inside `public` maps directly to the URL path.\n\n| File | URL |\n| -------------------------------- | ------------------------------------------------- |\n| `public/og-image.png` | `https://your-domain.com/og-image.png` |\n| `public/logo.svg` | `https://your-domain.com/logo.svg` |\n| `public/fonts/custom-font.woff2` | `https://your-domain.com/fonts/custom-font.woff2` |\n\n## Common use cases\n\n### Favicon\n\nPrefer the icon file convention: drop an `icon.png` (and optionally `icon-dark.png` and `apple-icon.png`) at your project root, next to `config.json`, and Doccupine wires it into every page's metadata with cache-busting URLs. See [Icon files](/globals#icon-files).\n\nIf a legacy tool needs the bare `/favicon.ico` path, drop a `favicon.ico` into the `public` directory and it is served from the root path as-is.\n\n### Open Graph preview image\n\nAdd an image for link previews on social media. Reference it in your `config.json` so Doccupine sets the correct meta tags.\n\n```text\npublic/og-image.png \u2192 https://your-domain.com/og-image.png\n```\n\n### Custom fonts\n\nPlace font files in `public` and reference them from your `fonts.json`. See the **Fonts** page for full configuration details.\n\n```text\npublic/fonts/custom-font.woff2 \u2192 https://your-domain.com/fonts/custom-font.woff2\n```\n\n### Images and other media\n\nAny image or file you want to reference in your MDX pages can live in `public`. Use a root-relative path in your content:\n\n```mdx\n![Architecture diagram](/architecture.png)\n```\n\n## Live syncing\n\n<Callout type=\"info\">\n Doccupine watches the `public` directory for changes while running. When you add, update, or remove a file, the generated site is updated automatically.\n</Callout>\n\n<Callout type=\"warning\">\n The `public` directory and everything beneath it must use real files and directories. Doccupine rejects symlinks instead of following or copying them, including links whose targets are inside the project.\n</Callout>\n\n## Tips\n\n- **Keep it flat**: For a small number of files, placing them directly in `public` keeps paths short and simple.\n- **Use subdirectories for organization**: For larger projects, group assets into directories like `public/fonts`, `public/images`, or `public/icons`.\n- **Mind file size**: Optimize images before adding them to keep deployment size and load times low.\n- **Consistent naming**: Use lowercase, hyphen-separated filenames (e.g., `og-image.png`) for predictable URLs.";
@@ -5,7 +5,7 @@ date: "2026-02-19"
5
5
  updated: "2026-08-04"
6
6
  category: "Configuration"
7
7
  categoryOrder: 2
8
- order: 7
8
+ order: 9
9
9
  ---
10
10
  # Media and assets
11
11
 
@@ -1 +1 @@
1
- export declare const mcpMdxTemplate = "---\ntitle: \"Model Context Protocol\"\ndescription: \"Connect your Doccupine documentation to AI tools with an MCP server for enhanced AI-powered documentation search.\"\ndate: \"2026-02-19\"\nupdated: \"2026-07-31\"\ncategory: \"AI & Integrations\"\ncategoryOrder: 3\norder: 2\n---\n# Model Context Protocol\n\nConnect your documentation to AI tools with a hosted MCP server.\n\nDoccupine automatically generates a Model Context Protocol (MCP) server from your documentation, making your content accessible to AI applications like Claude, Cursor, VS Code, and other MCP-compatible tools. Your MCP server exposes semantic search capabilities, allowing AI tools to query your documentation directly and provide accurate, context-aware answers.\n\n<Callout type=\"warning\">\n Semantic `search_docs` requires the [AI Assistant](/ai-assistant) embedding\n provider to be configured. `get_doc` and `list_docs` can retrieve the generated\n content manifest without an embedding provider.\n</Callout>\n\n## About MCP servers\n\nThe Model Context Protocol (MCP) is an open protocol that creates standardized connections between AI applications and external services, like documentation. Doccupine generates an MCP server from your documentation, preparing your content for the broader AI ecosystem where any MCP client can connect to your documentation.\n\nYour MCP server exposes search and retrieval tools for AI applications to query your documentation. Your users must connect your MCP server to their preferred AI tools to access your documentation.\n\n### How MCP servers work\n\nWhen an AI tool has your documentation MCP server connected, the AI tool can search your documentation directly instead of making a generic web search in response to a user's prompt. Your MCP server provides access to all indexed content from your documentation site.\n\n- The LLM can proactively search your documentation while generating a response, not just when explicitly asked.\n- The LLM determines when to use the search tool based on the context of the conversation and the relevance of your documentation.\n- Each tool call happens during the generation process, so the LLM searches up-to-date information from your documentation to generate its response.\n\n### MCP compared to web search\n\nAI tools can search the web, but MCP provides distinct advantages for documentation.\n\n- **Direct source access**: Web search depends on what search engines have indexed, which may be stale or incomplete. MCP searches your current indexed documentation directly.\n- **Integrated workflow**: MCP allows the AI to search during response generation rather than performing a separate web search.\n- **Semantic search**: MCP uses vector embeddings for semantic similarity search, providing more relevant results than keyword-based web search.\n- **No search noise**: SEO and ranking algorithms influence web search results. MCP goes straight to your documentation content.\n\n## Access your MCP server\n\nDoccupine automatically generates an MCP server for your documentation and hosts it at your documentation URL with the `/api/mcp` path. For example, if your documentation is hosted at `https://example.com`, your MCP server is available at `https://example.com/api/mcp`.\n\nThe MCP server provides both a GET endpoint to discover available tools and a POST endpoint to execute tool calls.\n\n### Authentication\n\nYou can optionally protect your MCP server with an API key by setting the `DOCS_API_KEY` environment variable in your `.env` file:\n\n```bash\nDOCS_API_KEY=your-secret-key\n```\n\nWhen `DOCS_API_KEY` is set, all requests to `/api/mcp` must include an `Authorization` header with a Bearer token:\n\n```text\nAuthorization: Bearer your-secret-key\n```\n\nRequests without a valid token receive a `401 Unauthorized` response. When `DOCS_API_KEY` is not set, the MCP server follows the site's access mode: it is public on a public site and requires the normal gate session when `SITE_PASSWORD` is configured.\n\n<Callout type=\"note\">\n `DOCS_API_KEY` applies to `/api/mcp` and its `/mcp` discovery alias; it does not grant access to the chat, search, or playground APIs. To gate the entire site behind a shared password, see the [Authentication](/authentication) documentation.\n</Callout>\n\n### Rate limiting\n\nTool calls to `POST /api/mcp` are rate limited per client IP when the generated app runs on a recognized platform that supplies a trusted client-address header. Unknown or self-hosted proxy setups use one conservative shared bucket instead of trusting spoofable forwarding headers. When the limit is exceeded, the server responds with `429 Too Many Requests` and a `Retry-After` header indicating how many seconds to wait before retrying.\n\nThe included limiter is intentionally lightweight and scoped to each running server instance. For a globally consistent limit across multiple serverless instances or regions, or accurate per-client limits behind a custom reverse proxy, configure rate limiting at your trusted hosting edge or use a shared external rate-limit store.\n\nRequests are bounded before tool execution: request bodies, protocol batches, tool arguments, search result counts, and serialized responses all have fixed limits. A protocol body may contain at most one `tools/call` message, so one rate-limited request cannot execute multiple paid tools; batches containing only non-tool protocol messages remain compatible. Internal provider errors are logged on the server and returned to clients as generic failures so deployment details are not exposed.\n\n### API Endpoints\n\n#### GET /api/mcp\n\nReturns information about available tools and the current index status.\n\n**Response:**\n\n```json\n{\n \"tools\": [\n {\n \"name\": \"search_docs\",\n \"description\": \"Search through the documentation content using semantic search...\",\n \"inputSchema\": { ... }\n },\n ...\n ],\n \"index\": {\n \"ready\": true,\n \"chunkCount\": 150\n }\n}\n```\n\n#### POST /api/mcp\n\nExecutes an MCP tool call.\n\n**Request Body:**\n\n```json\n{\n \"tool\": \"search_docs\",\n \"params\": {\n \"query\": \"how to deploy\",\n \"limit\": 6\n }\n}\n```\n\n**Response:**\n\n```json\n{\n \"content\": [\n {\n \"path\": \"app/deployment-and-hosting/page.tsx\",\n \"uri\": \"docs://deployment-and-hosting\",\n \"score\": \"0.892\",\n \"text\": \"Deploy your Doccupine site as a Next.js application...\"\n },\n ...\n ]\n}\n```\n\n## Available Tools\n\nYour MCP server exposes three tools for interacting with your documentation:\n\n### search_docs\n\nSearch through the documentation content using semantic search. Returns relevant chunks of documentation based on the query using vector embeddings and cosine similarity.\n\n**Parameters:**\n\n- `query` (required): The search query to find relevant documentation\n- `limit` (optional): Maximum number of results to return (default: 6)\n\n**Example:**\n\n```json\n{\n \"tool\": \"search_docs\",\n \"params\": {\n \"query\": \"how to configure AI assistant\",\n \"limit\": 5\n }\n}\n```\n\n### get_doc\n\nGet the full content of a specific documentation page by its path.\n\n**Parameters:**\n\n- `path` (required): The file path to the documentation page (e.g., `app/getting-started/page.tsx`)\n\n**Example:**\n\n```json\n{\n \"tool\": \"get_doc\",\n \"params\": {\n \"path\": \"app/deployment-and-hosting/page.tsx\"\n }\n}\n```\n\n### list_docs\n\nList all available documentation pages, optionally filtered by directory.\n\n**Parameters:**\n\n- `directory` (optional): Optional directory to filter results (e.g., `components`)\n\n**Example:**\n\n```json\n{\n \"tool\": \"list_docs\",\n \"params\": {\n \"directory\": \"configuration\"\n }\n}\n```\n\n## How it works\n\nDoccupine's MCP server uses semantic search powered by vector embeddings to provide accurate, context-aware search results.\n\n### Indexing Process\n\nDoccupine runs this pipeline at build time and ships the resulting vectors with your site, so the server loads a ready-made index instead of re-embedding your docs on every cold start.\n\n1. **Content Manifest**: During generation, Doccupine writes the source MDX and generated API-reference content to `services/mcp/docs-content.json`.\n2. **Runtime Loading**: The build traces that manifest into the MCP and RAG functions, which read it from one fixed path without inlining the corpus into their JavaScript bundles.\n3. **Chunking**: Large documents are split into chunks of approximately 800 characters with 100 character overlap for better context preservation.\n4. **Embedding Generation**: Each chunk is converted to a vector embedding using your configured LLM provider's embedding model.\n5. **Compaction**: Each vector is truncated to `LLM_EMBEDDING_DIMS` dimensions (default 512) and quantized to int8, keeping the index roughly 20x smaller than raw floats so large doc sets don't stall the chat on cold start.\n6. **Index Building**: The compact embeddings are written to `services/mcp/docs-index.json`, traced into your serverless functions as a data file, and loaded into memory at runtime for fast similarity search.\n\n### Search Process\n\n1. **Query Embedding**: The search query is converted to a vector embedding using the same embedding model.\n2. **Similarity Calculation**: Cosine similarity is calculated between the query embedding and all document chunk embeddings.\n3. **Ranking**: Results are sorted by similarity score (highest first).\n4. **Response**: The top N results (based on the limit parameter) are returned with their paths, URIs, scores, and text content.\n\n<Callout type=\"note\">\n Embeddings are precomputed at build time and shipped as a traced data file, so the server loads the ready-made index into memory on startup instead of re-embedding your docs on every cold start. It only embeds at runtime when the precomputed index is missing or was built with a different provider or model. When you update your documentation, regenerate and rebuild or redeploy your site to refresh both the content manifest and index.\n</Callout>\n\n## Use your MCP server\n\nYour users must connect your MCP server to their preferred AI tools.\n\n1. Make your MCP server URL publicly available.\n2. Users copy your MCP server URL and add it to their tools.\n3. Users access your documentation through their tools.\n\nThese are some of the ways you can help your users connect to your MCP server:\n\n<Tabs>\n <TabContent title=\"Claude\">\n <Steps>\n <Step title=\"Get your MCP server URL.\">\n Your MCP server URL is available at `https://your-domain.com/api/mcp`.\n </Step>\n <Step title=\"Publish your MCP server URL for your users.\">\n Create a guide for your users that includes your MCP server URL and the steps to connect it to Claude.\n 1. Navigate to the [Connectors](https://claude.ai/settings/connectors) page in the Claude settings.\n 2. Select **Add custom connector**.\n 3. Add your MCP server name and URL.\n 4. Select **Add**.\n 5. When using Claude, select the attachments button (the plus icon).\n 6. Select your MCP server.\n </Step>\n </Steps>\n See the [Model Context Protocol documentation](https://modelcontextprotocol.io/docs/tutorials/use-remote-mcp-server#connecting-to-a-remote-mcp-server) for more details.\n </TabContent>\n <TabContent title=\"Claude Code\">\n <Steps>\n <Step title=\"Get your MCP server URL.\">\n Your MCP server URL is available at `https://your-domain.com/api/mcp`.\n </Step>\n <Step title=\"Publish your MCP server URL for your users.\">\n Create a guide for your users that includes your MCP server URL and the command to connect it to Claude Code.\n ```bash\n claude mcp add --transport http <name> <url>\n ```\n </Step>\n </Steps>\n See the [Claude Code documentation](https://docs.anthropic.com/en/docs/claude-code/mcp#installing-mcp-servers) for more details.\n </TabContent>\n <TabContent title=\"Cursor\">\n <Steps>\n <Step title=\"Get your MCP server URL.\">\n Your MCP server URL is available at `https://your-domain.com/api/mcp`.\n </Step>\n <Step title=\"Publish your MCP server URL for your users.\">\n Create a guide for your users that includes your MCP server URL and the steps to connect it to Cursor.\n 1. Use <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> on Windows) to open the command palette.\n 2. Search for \"Open MCP settings\".\n 3. Select **Add custom MCP**. This opens the `mcp.json` file.\n 4. In `mcp.json`, configure your server:\n ```json\n {\n \"mcpServers\": {\n \"<your-mcp-server-name>\": {\n \"url\": \"<your-mcp-server-url>\"\n }\n }\n }\n ```\n </Step>\n </Steps>\n See the [Cursor documentation](https://docs.cursor.com/en/context/mcp#installing-mcp-servers) for more details.\n </TabContent>\n <TabContent title=\"VS Code\">\n <Steps>\n <Step title=\"Get your MCP server URL.\">\n Your MCP server URL is available at `https://your-domain.com/api/mcp`.\n </Step>\n <Step title=\"Publish your MCP server URL for your users.\">\n Create a guide for your users that includes your MCP server URL and the steps to connect it to VS Code.\n 1. Create a `.vscode/mcp.json` file.\n 2. In `mcp.json`, configure your server:\n ```json\n {\n \"servers\": {\n \"<your-mcp-server-name>\": {\n \"type\": \"http\",\n \"url\": \"<your-mcp-server-url>\"\n }\n }\n }\n ```\n </Step>\n </Steps>\n See the [VS Code documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) for more details.\n </TabContent>\n</Tabs>\n\n## Requirements\n\nTo use the MCP server, you need to have the AI Assistant configured. The MCP server uses the same LLM configuration for generating embeddings.\n\n| Variable | Required | Description |\n| -------------- | -------- | ------------------------------------------------------------ |\n| `LLM_PROVIDER` | Yes | Your LLM provider (`openai`, `anthropic`, or `google`) |\n| `DOCS_API_KEY` | No | When set, requires Bearer token authentication on `/api/mcp` |\n\n<Callout type=\"warning\">\n The `search_docs` tool requires an LLM provider for query embeddings. Configure\n the AI Assistant with a valid API key before using semantic search.\n</Callout>\n\nSee the [AI Assistant documentation](/ai-assistant) for configuration details.\n\n## Content indexing\n\nDoccupine builds a `services/mcp/docs-content.json` manifest from your source MDX and generated API-reference pages. The deployed MCP and RAG routes load that traced data file at runtime, so the documentation corpus is not inlined into the server function's JavaScript bundle and the server never scans user-controlled paths.\n\nThe manifest is refreshed after each successful generation. In watch mode, successful MDX and OpenAPI refreshes, including changes to watched local `$ref` files, become available to MCP automatically. If a refresh fails, the manifest continues to contain the last successfully generated corpus. For a one-time workflow, run `doccupine build` or `doccupine generate` before building and deploying the generated Next.js app.\n\n## Troubleshooting\n\n### Index not building\n\nIf the index is not building, check:\n\n- Your LLM provider is configured correctly in your `.env` file\n- You have a valid API key set\n- `services/mcp/docs-content.json` exists in the generated app\n- The latest Doccupine generation completed successfully before deployment\n\n### No search results\n\nIf searches return no results:\n\n- Verify that your source MDX files are inside the configured `watchDir`\n- Regenerate the app so `docs-content.json` contains the latest pages\n- Ensure the index has been built (check the `index.ready` status via GET `/api/mcp`)\n\n### Slow search performance\n\nSearches use the precomputed in-memory index and are fast. The first search is only slow when the app has to embed your docs at runtime, which happens when the precomputed index is missing or was built with a different provider or model. If performance is consistently slow:\n\n- Confirm the build ran the doc-index precompute step (the `build` script runs it before `next build`) with a valid API key\n- Check your embedding API response times\n- Consider reducing the number of documentation pages\n- Verify your server has sufficient memory\n\n### Cloudflare blocking MCP requests\n\nIf you use Cloudflare as a proxy in front of your documentation site, Cloudflare's bot protection may block server-to-server requests from AI tools like Claude.ai. This can cause MCP connections to fail silently or return errors.\n\nThere are two ways to resolve this:\n\n**Option 1: Disable the Cloudflare proxy (simplest)**\n\nIn your Cloudflare DNS settings, click the orange cloud icon next to your domain record to switch it to \"DNS only\" (grey cloud). This disables Cloudflare's proxy and bot protection for your domain, allowing MCP requests to reach your server directly.\n\n**Option 2: Add a Cloudflare WAF exception (keeps your custom domain proxied)**\n\nIn Cloudflare dashboard:\n\n1. Go to **Security > WAF**.\n2. Click **Create rule**.\n3. Set it up as:\n - **Rule name**: Allow MCP API\n - **Field**: URI Path\n - **Operator**: starts with\n - **Value**: `/api/mcp`\n - **Action**: Skip -- then check all remaining custom rules, Rate limiting rules, and Bot Fight Mode / Super Bot Fight Mode.\n4. Deploy the rule and make sure it is ordered first (above other rules).\n\n<Callout type=\"warning\">\n Also check **Security > Bots** in your Cloudflare dashboard. If \"Bot Fight Mode\" or \"Super Bot Fight Mode\" is enabled, that is very likely what is blocking server-to-server requests from AI tools.\n</Callout>\n\n## Best practices\n\n- **Keep content up-to-date**: Rebuild or redeploy your site after updating documentation to regenerate the index with fresh content.\n- **Use descriptive queries**: More specific queries yield better semantic search results.\n- **Monitor index status**: Use the GET endpoint to check if your index is ready before performing searches.\n- **Optimize content structure**: Well-structured markdown with clear headings improves search relevance.";
1
+ export declare const mcpMdxTemplate = "---\ntitle: \"Model Context Protocol\"\ndescription: \"Connect your Doccupine documentation to AI tools with an MCP server for enhanced AI-powered documentation search.\"\ndate: \"2026-02-19\"\nupdated: \"2026-07-31\"\ncategory: \"AI & Integrations\"\ncategoryOrder: 3\norder: 2\n---\n# Model Context Protocol\n\nConnect your documentation to AI tools with a hosted MCP server.\n\nDoccupine automatically generates a Model Context Protocol (MCP) server from your documentation, making your content accessible to AI applications like Claude, Cursor, VS Code, and other MCP-compatible tools. Your MCP server exposes semantic search capabilities, allowing AI tools to query your documentation directly and provide accurate, context-aware answers.\n\n<Callout type=\"warning\">\n Semantic `search_docs` requires the [AI Assistant](/ai-assistant) embedding\n provider to be configured. `get_doc` and `list_docs` can retrieve the generated\n content manifest without an embedding provider.\n</Callout>\n\n## About MCP servers\n\nThe Model Context Protocol (MCP) is an open protocol that creates standardized connections between AI applications and external services, like documentation. Doccupine generates an MCP server from your documentation, preparing your content for the broader AI ecosystem where any MCP client can connect to your documentation.\n\nYour MCP server exposes search and retrieval tools for AI applications to query your documentation. Your users must connect your MCP server to their preferred AI tools to access your documentation.\n\n### How MCP servers work\n\nWhen an AI tool has your documentation MCP server connected, the AI tool can search your documentation directly instead of making a generic web search in response to a user's prompt. Your MCP server provides access to all indexed content from your documentation site.\n\n- The LLM can proactively search your documentation while generating a response, not just when explicitly asked.\n- The LLM determines when to use the search tool based on the context of the conversation and the relevance of your documentation.\n- Each tool call happens during the generation process, so the LLM searches up-to-date information from your documentation to generate its response.\n\n### MCP compared to web search\n\nAI tools can search the web, but MCP provides distinct advantages for documentation.\n\n- **Direct source access**: Web search depends on what search engines have indexed, which may be stale or incomplete. MCP searches your current indexed documentation directly.\n- **Integrated workflow**: MCP allows the AI to search during response generation rather than performing a separate web search.\n- **Semantic search**: MCP uses vector embeddings for semantic similarity search, providing more relevant results than keyword-based web search.\n- **No search noise**: SEO and ranking algorithms influence web search results. MCP goes straight to your documentation content.\n\n## Access your MCP server\n\nDoccupine automatically generates an MCP server for your documentation and hosts it at your documentation URL with the `/api/mcp` path. For example, if your documentation is hosted at `https://example.com`, your MCP server is available at `https://example.com/api/mcp`.\n\nThe MCP server provides both a GET endpoint to discover available tools and a POST endpoint to execute tool calls.\n\n### Authentication\n\nYou can optionally protect your MCP server with an API key by setting the `DOCS_API_KEY` environment variable in your `.env` file:\n\n```bash\nDOCS_API_KEY=your-secret-key\n```\n\nWhen `DOCS_API_KEY` is set, all requests to `/api/mcp` must include an `Authorization` header with a Bearer token:\n\n```text\nAuthorization: Bearer your-secret-key\n```\n\nRequests without a valid token receive a `401 Unauthorized` response. When `DOCS_API_KEY` is not set, the MCP server follows the site's access mode: it is public on a public site and requires the normal gate session when `SITE_PASSWORD` is configured.\n\n<Callout type=\"note\">\n `DOCS_API_KEY` applies to `/api/mcp` and its `/mcp` discovery alias; it does not grant access to the chat, search, or playground APIs. To gate the entire site behind a shared password, see the [Authentication](/authentication) documentation.\n</Callout>\n\n### Rate limiting\n\nTool calls to `POST /api/mcp` are rate limited per client IP when the generated app runs on a recognized platform that supplies a trusted client-address header. Unknown or self-hosted proxy setups use one conservative shared bucket instead of trusting spoofable forwarding headers. When the limit is exceeded, the server responds with `429 Too Many Requests` and a `Retry-After` header indicating how many seconds to wait before retrying.\n\nThe included limiter is intentionally lightweight and scoped to each running server instance. For a globally consistent limit across multiple serverless instances or regions, or accurate per-client limits behind a custom reverse proxy, configure rate limiting at your trusted hosting edge or use a shared external rate-limit store.\n\nRequests are bounded before tool execution: request bodies, protocol batches, tool arguments, search result counts, and serialized responses all have fixed limits. A protocol body may contain at most one `tools/call` message, so one rate-limited request cannot execute multiple paid tools; batches containing only non-tool protocol messages remain compatible. Internal provider errors are logged on the server and returned to clients as generic failures so deployment details are not exposed.\n\n### API Endpoints\n\n#### GET /api/mcp\n\nReturns information about available tools and the current index status.\n\n**Response:**\n\n```json\n{\n \"tools\": [\n {\n \"name\": \"search_docs\",\n \"description\": \"Search through the documentation content using semantic search...\",\n \"inputSchema\": { ... }\n },\n ...\n ],\n \"index\": {\n \"ready\": true,\n \"chunkCount\": 150\n }\n}\n```\n\n#### POST /api/mcp\n\nExecutes an MCP tool call.\n\n**Request Body:**\n\n```json\n{\n \"tool\": \"search_docs\",\n \"params\": {\n \"query\": \"how to deploy\",\n \"limit\": 6\n }\n}\n```\n\n**Response:**\n\n```json\n{\n \"content\": [\n {\n \"path\": \"app/deployment-and-hosting/page.tsx\",\n \"uri\": \"docs://deployment-and-hosting\",\n \"score\": \"0.892\",\n \"text\": \"Deploy your Doccupine site as a Next.js application...\"\n },\n ...\n ]\n}\n```\n\n## Available Tools\n\nYour MCP server exposes three tools for interacting with your documentation:\n\n### search_docs\n\nSearch through the documentation content using semantic search. Returns relevant chunks of documentation based on the query using vector embeddings and cosine similarity.\n\n**Parameters:**\n\n- `query` (required): The search query to find relevant documentation\n- `limit` (optional): Maximum number of results to return (default: 6)\n- `language` (optional): Language code to search on a site with [languages](/languages); defaults to the site's default language\n- `version` (optional): Version slug to search on a site with [versions](/versions); defaults to the current version\n\n**Example:**\n\n```json\n{\n \"tool\": \"search_docs\",\n \"params\": {\n \"query\": \"how to configure AI assistant\",\n \"limit\": 5\n }\n}\n```\n\n### get_doc\n\nGet the full content of a specific documentation page by its path.\n\n**Parameters:**\n\n- `path` (required): The file path to the documentation page (e.g., `app/getting-started/page.tsx`)\n\n**Example:**\n\n```json\n{\n \"tool\": \"get_doc\",\n \"params\": {\n \"path\": \"app/deployment-and-hosting/page.tsx\"\n }\n}\n```\n\n### list_docs\n\nList all available documentation pages, optionally filtered by directory.\n\n**Parameters:**\n\n- `directory` (optional): Optional directory to filter results (e.g., `components`)\n- `language` (optional): Language code to list on a site with [languages](/languages); defaults to the site's default language\n- `version` (optional): Version slug to list on a site with [versions](/versions); defaults to the current version\n\nResults carry the page's `language` and `version` on such a site, and the `docs://list` resource lists every language and version at once.\n\n**Example:**\n\n```json\n{\n \"tool\": \"list_docs\",\n \"params\": {\n \"directory\": \"configuration\"\n }\n}\n```\n\n## How it works\n\nDoccupine's MCP server uses semantic search powered by vector embeddings to provide accurate, context-aware search results.\n\n### Indexing Process\n\nDoccupine runs this pipeline at build time and ships the resulting vectors with your site, so the server loads a ready-made index instead of re-embedding your docs on every cold start.\n\n1. **Content Manifest**: During generation, Doccupine writes the source MDX and generated API-reference content to `services/mcp/docs-content.json`.\n2. **Runtime Loading**: The build traces that manifest into the MCP and RAG functions, which read it from one fixed path without inlining the corpus into their JavaScript bundles.\n3. **Chunking**: Large documents are split into chunks of approximately 800 characters with 100 character overlap for better context preservation.\n4. **Embedding Generation**: Each chunk is converted to a vector embedding using your configured LLM provider's embedding model.\n5. **Compaction**: Each vector is truncated to `LLM_EMBEDDING_DIMS` dimensions (default 512) and quantized to int8, keeping the index roughly 20x smaller than raw floats so large doc sets don't stall the chat on cold start.\n6. **Index Building**: The compact embeddings are written to `services/mcp/docs-index.json`, traced into your serverless functions as a data file, and loaded into memory at runtime for fast similarity search.\n\n### Search Process\n\n1. **Query Embedding**: The search query is converted to a vector embedding using the same embedding model.\n2. **Similarity Calculation**: Cosine similarity is calculated between the query embedding and all document chunk embeddings.\n3. **Ranking**: Results are sorted by similarity score (highest first).\n4. **Response**: The top N results (based on the limit parameter) are returned with their paths, URIs, scores, and text content.\n\n<Callout type=\"note\">\n Embeddings are precomputed at build time and shipped as a traced data file, so the server loads the ready-made index into memory on startup instead of re-embedding your docs on every cold start. It only embeds at runtime when the precomputed index is missing or was built with a different provider or model. When you update your documentation, regenerate and rebuild or redeploy your site to refresh both the content manifest and index.\n</Callout>\n\n## Use your MCP server\n\nYour users must connect your MCP server to their preferred AI tools.\n\n1. Make your MCP server URL publicly available.\n2. Users copy your MCP server URL and add it to their tools.\n3. Users access your documentation through their tools.\n\nThese are some of the ways you can help your users connect to your MCP server:\n\n<Tabs>\n <TabContent title=\"Claude\">\n <Steps>\n <Step title=\"Get your MCP server URL.\">\n Your MCP server URL is available at `https://your-domain.com/api/mcp`.\n </Step>\n <Step title=\"Publish your MCP server URL for your users.\">\n Create a guide for your users that includes your MCP server URL and the steps to connect it to Claude.\n 1. Navigate to the [Connectors](https://claude.ai/settings/connectors) page in the Claude settings.\n 2. Select **Add custom connector**.\n 3. Add your MCP server name and URL.\n 4. Select **Add**.\n 5. When using Claude, select the attachments button (the plus icon).\n 6. Select your MCP server.\n </Step>\n </Steps>\n See the [Model Context Protocol documentation](https://modelcontextprotocol.io/docs/tutorials/use-remote-mcp-server#connecting-to-a-remote-mcp-server) for more details.\n </TabContent>\n <TabContent title=\"Claude Code\">\n <Steps>\n <Step title=\"Get your MCP server URL.\">\n Your MCP server URL is available at `https://your-domain.com/api/mcp`.\n </Step>\n <Step title=\"Publish your MCP server URL for your users.\">\n Create a guide for your users that includes your MCP server URL and the command to connect it to Claude Code.\n ```bash\n claude mcp add --transport http <name> <url>\n ```\n </Step>\n </Steps>\n See the [Claude Code documentation](https://docs.anthropic.com/en/docs/claude-code/mcp#installing-mcp-servers) for more details.\n </TabContent>\n <TabContent title=\"Cursor\">\n <Steps>\n <Step title=\"Get your MCP server URL.\">\n Your MCP server URL is available at `https://your-domain.com/api/mcp`.\n </Step>\n <Step title=\"Publish your MCP server URL for your users.\">\n Create a guide for your users that includes your MCP server URL and the steps to connect it to Cursor.\n 1. Use <kbd>Command</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> on Windows) to open the command palette.\n 2. Search for \"Open MCP settings\".\n 3. Select **Add custom MCP**. This opens the `mcp.json` file.\n 4. In `mcp.json`, configure your server:\n ```json\n {\n \"mcpServers\": {\n \"<your-mcp-server-name>\": {\n \"url\": \"<your-mcp-server-url>\"\n }\n }\n }\n ```\n </Step>\n </Steps>\n See the [Cursor documentation](https://docs.cursor.com/en/context/mcp#installing-mcp-servers) for more details.\n </TabContent>\n <TabContent title=\"VS Code\">\n <Steps>\n <Step title=\"Get your MCP server URL.\">\n Your MCP server URL is available at `https://your-domain.com/api/mcp`.\n </Step>\n <Step title=\"Publish your MCP server URL for your users.\">\n Create a guide for your users that includes your MCP server URL and the steps to connect it to VS Code.\n 1. Create a `.vscode/mcp.json` file.\n 2. In `mcp.json`, configure your server:\n ```json\n {\n \"servers\": {\n \"<your-mcp-server-name>\": {\n \"type\": \"http\",\n \"url\": \"<your-mcp-server-url>\"\n }\n }\n }\n ```\n </Step>\n </Steps>\n See the [VS Code documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) for more details.\n </TabContent>\n</Tabs>\n\n## Requirements\n\nTo use the MCP server, you need to have the AI Assistant configured. The MCP server uses the same LLM configuration for generating embeddings.\n\n| Variable | Required | Description |\n| -------------- | -------- | ------------------------------------------------------------ |\n| `LLM_PROVIDER` | Yes | Your LLM provider (`openai`, `anthropic`, or `google`) |\n| `DOCS_API_KEY` | No | When set, requires Bearer token authentication on `/api/mcp` |\n\n<Callout type=\"warning\">\n The `search_docs` tool requires an LLM provider for query embeddings. Configure\n the AI Assistant with a valid API key before using semantic search.\n</Callout>\n\nSee the [AI Assistant documentation](/ai-assistant) for configuration details.\n\n## Content indexing\n\nDoccupine builds a `services/mcp/docs-content.json` manifest from your source MDX and generated API-reference pages. The deployed MCP and RAG routes load that traced data file at runtime, so the documentation corpus is not inlined into the server function's JavaScript bundle and the server never scans user-controlled paths.\n\nThe manifest is refreshed after each successful generation. In watch mode, successful MDX and OpenAPI refreshes, including changes to watched local `$ref` files, become available to MCP automatically. If a refresh fails, the manifest continues to contain the last successfully generated corpus. For a one-time workflow, run `doccupine build` or `doccupine generate` before building and deploying the generated Next.js app.\n\n## Troubleshooting\n\n### Index not building\n\nIf the index is not building, check:\n\n- Your LLM provider is configured correctly in your `.env` file\n- You have a valid API key set\n- `services/mcp/docs-content.json` exists in the generated app\n- The latest Doccupine generation completed successfully before deployment\n\n### No search results\n\nIf searches return no results:\n\n- Verify that your source MDX files are inside the configured `watchDir`\n- Regenerate the app so `docs-content.json` contains the latest pages\n- Ensure the index has been built (check the `index.ready` status via GET `/api/mcp`)\n\n### Slow search performance\n\nSearches use the precomputed in-memory index and are fast. The first search is only slow when the app has to embed your docs at runtime, which happens when the precomputed index is missing or was built with a different provider or model. If performance is consistently slow:\n\n- Confirm the build ran the doc-index precompute step (the `build` script runs it before `next build`) with a valid API key\n- Check your embedding API response times\n- Consider reducing the number of documentation pages\n- Verify your server has sufficient memory\n\n### Cloudflare blocking MCP requests\n\nIf you use Cloudflare as a proxy in front of your documentation site, Cloudflare's bot protection may block server-to-server requests from AI tools like Claude.ai. This can cause MCP connections to fail silently or return errors.\n\nThere are two ways to resolve this:\n\n**Option 1: Disable the Cloudflare proxy (simplest)**\n\nIn your Cloudflare DNS settings, click the orange cloud icon next to your domain record to switch it to \"DNS only\" (grey cloud). This disables Cloudflare's proxy and bot protection for your domain, allowing MCP requests to reach your server directly.\n\n**Option 2: Add a Cloudflare WAF exception (keeps your custom domain proxied)**\n\nIn Cloudflare dashboard:\n\n1. Go to **Security > WAF**.\n2. Click **Create rule**.\n3. Set it up as:\n - **Rule name**: Allow MCP API\n - **Field**: URI Path\n - **Operator**: starts with\n - **Value**: `/api/mcp`\n - **Action**: Skip -- then check all remaining custom rules, Rate limiting rules, and Bot Fight Mode / Super Bot Fight Mode.\n4. Deploy the rule and make sure it is ordered first (above other rules).\n\n<Callout type=\"warning\">\n Also check **Security > Bots** in your Cloudflare dashboard. If \"Bot Fight Mode\" or \"Super Bot Fight Mode\" is enabled, that is very likely what is blocking server-to-server requests from AI tools.\n</Callout>\n\n## Best practices\n\n- **Keep content up-to-date**: Rebuild or redeploy your site after updating documentation to regenerate the index with fresh content.\n- **Use descriptive queries**: More specific queries yield better semantic search results.\n- **Monitor index status**: Use the GET endpoint to check if your index is ready before performing searches.\n- **Optimize content structure**: Well-structured markdown with clear headings improves search relevance.";
@@ -145,6 +145,8 @@ Search through the documentation content using semantic search. Returns relevant
145
145
 
146
146
  - \`query\` (required): The search query to find relevant documentation
147
147
  - \`limit\` (optional): Maximum number of results to return (default: 6)
148
+ - \`language\` (optional): Language code to search on a site with [languages](/languages); defaults to the site's default language
149
+ - \`version\` (optional): Version slug to search on a site with [versions](/versions); defaults to the current version
148
150
 
149
151
  **Example:**
150
152
 
@@ -184,6 +186,10 @@ List all available documentation pages, optionally filtered by directory.
184
186
  **Parameters:**
185
187
 
186
188
  - \`directory\` (optional): Optional directory to filter results (e.g., \`components\`)
189
+ - \`language\` (optional): Language code to list on a site with [languages](/languages); defaults to the site's default language
190
+ - \`version\` (optional): Version slug to list on a site with [versions](/versions); defaults to the current version
191
+
192
+ Results carry the page's \`language\` and \`version\` on such a site, and the \`docs://list\` resource lists every language and version at once.
187
193
 
188
194
  **Example:**
189
195
 
@@ -1 +1 @@
1
- export declare const navigationMdxTemplate = "---\ntitle: \"Navigation\"\ndescription: \"Organize and structure your navigation.\"\ndate: \"2026-02-19\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder: 2\n---\n# Navigation\n\nDoccupine builds your sidebar automatically from your MDX pages. By default, it reads the page frontmatter and groups pages into categories in the order you define. For larger docs, you can take full control with a `navigation.json` file.\n\n## Automatic navigation (default)\n\nWhen no custom navigation is provided, Doccupine generates a structure based on each page's frontmatter.\n\n### Frontmatter fields\n\n- **category**: The category name that groups the page in the sidebar.\n- **categoryOrder**: The position of the category within the sidebar. Lower numbers appear first.\n- **order**: The position of the page within its category. Lower numbers appear first.\n- **navIcon**: Optional [Lucide](https://lucide.dev/icons) icon name shown next to the page's sidebar link.\n- **categoryIcon**: Optional Lucide icon name for the page's category header. The first page in a category that sets it wins.\n\n### Example frontmatter\n\n```text\n---\ntitle: \"Navigation\"\ndescription: \"Organize and structure your navigation.\"\ndate: \"2025-01-15\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder: 2\n---\n```\n\nThis approach is great for small sets of documents. For larger projects, setting these fields on every page can become repetitive.\n\n## Custom navigation with navigation.json\n\nTo centrally define the entire sidebar, create a `navigation.json` at your project root (the same directory where you execute `npx doccupine`). When present, it takes priority over page frontmatter and fully controls the navigation structure.\n\n### Array format\n\nThe simplest format is an array of categories. When using [sections](/sections), this applies to the root section only.\n\n```json\n[\n {\n \"label\": \"Getting Started\",\n \"links\": [\n { \"slug\": \"\", \"title\": \"Introduction\" },\n { \"slug\": \"what-is-doccupine\", \"title\": \"What is Doccupine\" },\n { \"slug\": \"commands\", \"title\": \"Commands\" }\n ]\n },\n {\n \"label\": \"Components\",\n \"links\": [\n { \"slug\": \"components\", \"title\": \"Components\" },\n { \"slug\": \"headers-and-text\", \"title\": \"Headers and Text\" },\n { \"slug\": \"lists-and-tables\", \"title\": \"Lists and tables\" },\n { \"slug\": \"code\", \"title\": \"Code\" },\n { \"slug\": \"prompt\", \"title\": \"Prompt\" },\n { \"slug\": \"callouts\", \"title\": \"Callouts\" },\n { \"slug\": \"accordion\", \"title\": \"Accordion\" },\n { \"slug\": \"tabs\", \"title\": \"Tabs\" },\n { \"slug\": \"steps\", \"title\": \"Steps\" },\n { \"slug\": \"tree\", \"title\": \"Tree\" },\n { \"slug\": \"cards\", \"title\": \"Cards\" },\n { \"slug\": \"buttons\", \"title\": \"Buttons\" },\n { \"slug\": \"badges\", \"title\": \"Badges\" },\n { \"slug\": \"tooltips\", \"title\": \"Tooltips\" },\n { \"slug\": \"images-and-embeds\", \"title\": \"Images and embeds\" },\n { \"slug\": \"frames\", \"title\": \"Frames\" },\n { \"slug\": \"icons\", \"title\": \"Icons\" },\n { \"slug\": \"columns\", \"title\": \"Columns\" },\n { \"slug\": \"side-panel\", \"title\": \"Side Panel\" },\n { \"slug\": \"fields\", \"title\": \"Fields\" },\n { \"slug\": \"api-playground\", \"title\": \"API Playground\" },\n { \"slug\": \"update\", \"title\": \"Update\" },\n { \"slug\": \"color-swatches\", \"title\": \"Color Swatches\" },\n { \"slug\": \"mermaid\", \"title\": \"Mermaid\" }\n ]\n },\n {\n \"label\": \"Configuration\",\n \"links\": [\n { \"slug\": \"globals\", \"title\": \"Globals\" },\n { \"slug\": \"navigation\", \"title\": \"Navigation\" },\n { \"slug\": \"sections\", \"title\": \"Sections\" },\n { \"slug\": \"footer-links\", \"title\": \"Footer Links\" },\n { \"slug\": \"theme\", \"title\": \"Theme\" },\n { \"slug\": \"fonts\", \"title\": \"Fonts\" },\n { \"slug\": \"media-and-assets\", \"title\": \"Media and assets\" }\n ]\n },\n {\n \"label\": \"AI & Integrations\",\n \"links\": [\n { \"slug\": \"ai-assistant\", \"title\": \"AI Assistant\" },\n { \"slug\": \"model-context-protocol\", \"title\": \"Model Context Protocol\" },\n { \"slug\": \"analytics\", \"title\": \"Analytics\" }\n ]\n },\n {\n \"label\": \"Deployment\",\n \"links\": [\n { \"slug\": \"deployment-and-hosting\", \"title\": \"Deployment & Hosting\" },\n { \"slug\": \"authentication\", \"title\": \"Authentication\" }\n ]\n }\n]\n```\n\n### Object format (per-section)\n\nWhen using [sections](/sections), you can define navigation for each section by using an object keyed by section slug. Sections without a key fall back to auto-generated navigation from frontmatter.\n\n```json\n{\n \"\": [\n {\n \"label\": \"General\",\n \"links\": [\n { \"slug\": \"\", \"title\": \"Getting Started\" },\n { \"slug\": \"commands\", \"title\": \"Commands\" }\n ]\n }\n ],\n \"platform\": [\n {\n \"label\": \"Overview\",\n \"links\": [\n { \"slug\": \"platform/auth\", \"title\": \"Authentication\" },\n { \"slug\": \"platform/users\", \"title\": \"Users\" }\n ]\n }\n ]\n}\n```\n\nThe key `\"\"` controls the root section. Other keys match section slugs defined in `sections.json` or derived from frontmatter. See [Sections](/sections) for details on configuring sections.\n\n### Fields\n\n- **label**: The section header shown in the sidebar.\n- **icon**: Optional [Lucide](https://lucide.dev/icons) icon name shown next to the category header.\n- **links**: An array of page entries for that section.\n - **slug**: The MDX file slug (filename without extension). Use an empty string `\"\"` for `index.mdx`.\n - **title**: The display title in the navigation. This can differ from the page's `title` frontmatter.\n - **icon**: Optional Lucide icon name shown next to the link.\n - **links**: Optional array of nested child links. See [Nested navigation](#nested-navigation).\n\n## Icons\n\nAdd icons to categories and links to make the sidebar easier to scan. Icons use [Lucide](https://lucide.dev/icons) names in kebab-case (e.g. `rocket`, `book-open`, `settings`). Unknown names render nothing, so a typo never breaks the build.\n\nWith frontmatter, set `navIcon` on a page for its sidebar link and `categoryIcon` for its category:\n\n```text\n---\ntitle: \"Introduction\"\ncategory: \"Getting Started\"\ncategoryOrder: 1\norder: 1\nnavIcon: \"rocket\"\ncategoryIcon: \"book-open\"\n---\n```\n\nWith `navigation.json`, add an `icon` to any category or link:\n\n```json\n[\n {\n \"label\": \"Getting Started\",\n \"icon\": \"book-open\",\n \"links\": [\n { \"slug\": \"\", \"title\": \"Introduction\", \"icon\": \"rocket\" },\n { \"slug\": \"commands\", \"title\": \"Commands\", \"icon\": \"terminal\" }\n ]\n }\n]\n```\n\n## Nested navigation\n\nA link in `navigation.json` can hold its own `links` array to create a collapsible group. Groups expand and collapse on click and open automatically when one of their pages is active. Nesting can go as deep as you need.\n\n```json\n[\n {\n \"label\": \"Guides\",\n \"icon\": \"book-open\",\n \"links\": [\n { \"slug\": \"guides\", \"title\": \"Overview\", \"icon\": \"compass\" },\n {\n \"title\": \"Advanced\",\n \"icon\": \"settings\",\n \"links\": [\n { \"slug\": \"guides/caching\", \"title\": \"Caching\" },\n { \"slug\": \"guides/streaming\", \"title\": \"Streaming\" }\n ]\n }\n ]\n }\n]\n```\n\nA group can be a plain label - omit `slug` and it acts only as a collapsible header - or a real page, by adding a `slug` so the group title is also a link.\n\n<Callout type=\"note\">\n Nested groups are only available through `navigation.json`. Frontmatter navigation is always two levels: category and pages.\n</Callout>\n\n## Precedence and behavior\n\n<Callout type=\"note\">\n `navigation.json` takes priority over frontmatter. If present, it fully controls the sidebar structure for the sections it covers.\n</Callout>\n\n- Without `navigation.json`, the sidebar is built from page frontmatter: `category` -> grouped; `categoryOrder` -> category position; `order` -> page position.\n- When using the object format, sections not listed in `navigation.json` fall back to frontmatter-based navigation.\n- Pages without a `category` appear at the top level.\n\n## Tips\n\n- **Start simple**: Use frontmatter for small docs. Switch to `navigation.json` as the structure grows.\n- **Keep slugs consistent**: `slug` must match the MDX filename (e.g., `text.mdx` -> `text`).\n- **Control titles**: Use `title` in `navigation.json` to customize sidebar labels without changing page frontmatter.\n- **Per-section navigation**: Use the object format to define different sidebars for each section. Mix and match - define some sections explicitly and let others auto-generate.";
1
+ export declare const navigationMdxTemplate = "---\ntitle: \"Navigation\"\ndescription: \"Organize and structure your navigation.\"\ndate: \"2026-02-19\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder: 2\n---\n# Navigation\n\nDoccupine builds your sidebar automatically from your MDX pages. By default, it reads the page frontmatter and groups pages into categories in the order you define. For larger docs, you can take full control with a `navigation.json` file.\n\n## Automatic navigation (default)\n\nWhen no custom navigation is provided, Doccupine generates a structure based on each page's frontmatter.\n\n### Frontmatter fields\n\n- **category**: The category name that groups the page in the sidebar.\n- **categoryOrder**: The position of the category within the sidebar. Lower numbers appear first.\n- **order**: The position of the page within its category. Lower numbers appear first.\n- **navIcon**: Optional [Lucide](https://lucide.dev/icons) icon name shown next to the page's sidebar link.\n- **categoryIcon**: Optional Lucide icon name for the page's category header. The first page in a category that sets it wins.\n\n### Example frontmatter\n\n```text\n---\ntitle: \"Navigation\"\ndescription: \"Organize and structure your navigation.\"\ndate: \"2025-01-15\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder: 2\n---\n```\n\nThis approach is great for small sets of documents. For larger projects, setting these fields on every page can become repetitive.\n\n## Custom navigation with navigation.json\n\nTo centrally define the entire sidebar, create a `navigation.json` at your project root (the same directory where you execute `npx doccupine`). When present, it takes priority over page frontmatter and fully controls the navigation structure.\n\n### Array format\n\nThe simplest format is an array of categories. When using [sections](/sections), this applies to the root section only.\n\n```json\n[\n {\n \"label\": \"Getting Started\",\n \"links\": [\n { \"slug\": \"\", \"title\": \"Introduction\" },\n { \"slug\": \"what-is-doccupine\", \"title\": \"What is Doccupine\" },\n { \"slug\": \"commands\", \"title\": \"Commands\" }\n ]\n },\n {\n \"label\": \"Components\",\n \"links\": [\n { \"slug\": \"components\", \"title\": \"Components\" },\n { \"slug\": \"headers-and-text\", \"title\": \"Headers and Text\" },\n { \"slug\": \"lists-and-tables\", \"title\": \"Lists and tables\" },\n { \"slug\": \"code\", \"title\": \"Code\" },\n { \"slug\": \"prompt\", \"title\": \"Prompt\" },\n { \"slug\": \"callouts\", \"title\": \"Callouts\" },\n { \"slug\": \"accordion\", \"title\": \"Accordion\" },\n { \"slug\": \"tabs\", \"title\": \"Tabs\" },\n { \"slug\": \"steps\", \"title\": \"Steps\" },\n { \"slug\": \"tree\", \"title\": \"Tree\" },\n { \"slug\": \"cards\", \"title\": \"Cards\" },\n { \"slug\": \"buttons\", \"title\": \"Buttons\" },\n { \"slug\": \"badges\", \"title\": \"Badges\" },\n { \"slug\": \"tooltips\", \"title\": \"Tooltips\" },\n { \"slug\": \"images-and-embeds\", \"title\": \"Images and embeds\" },\n { \"slug\": \"frames\", \"title\": \"Frames\" },\n { \"slug\": \"icons\", \"title\": \"Icons\" },\n { \"slug\": \"columns\", \"title\": \"Columns\" },\n { \"slug\": \"side-panel\", \"title\": \"Side Panel\" },\n { \"slug\": \"fields\", \"title\": \"Fields\" },\n { \"slug\": \"api-playground\", \"title\": \"API Playground\" },\n { \"slug\": \"update\", \"title\": \"Update\" },\n { \"slug\": \"color-swatches\", \"title\": \"Color Swatches\" },\n { \"slug\": \"mermaid\", \"title\": \"Mermaid\" }\n ]\n },\n {\n \"label\": \"Configuration\",\n \"links\": [\n { \"slug\": \"globals\", \"title\": \"Globals\" },\n { \"slug\": \"navigation\", \"title\": \"Navigation\" },\n { \"slug\": \"sections\", \"title\": \"Sections\" },\n { \"slug\": \"footer-links\", \"title\": \"Footer Links\" },\n { \"slug\": \"theme\", \"title\": \"Theme\" },\n { \"slug\": \"fonts\", \"title\": \"Fonts\" },\n { \"slug\": \"media-and-assets\", \"title\": \"Media and assets\" }\n ]\n },\n {\n \"label\": \"AI & Integrations\",\n \"links\": [\n { \"slug\": \"ai-assistant\", \"title\": \"AI Assistant\" },\n { \"slug\": \"model-context-protocol\", \"title\": \"Model Context Protocol\" },\n { \"slug\": \"analytics\", \"title\": \"Analytics\" }\n ]\n },\n {\n \"label\": \"Deployment\",\n \"links\": [\n { \"slug\": \"deployment-and-hosting\", \"title\": \"Deployment & Hosting\" },\n { \"slug\": \"authentication\", \"title\": \"Authentication\" }\n ]\n }\n]\n```\n\n### Object format (per-section)\n\nWhen using [sections](/sections), you can define navigation for each section by using an object keyed by section slug. Sections without a key fall back to auto-generated navigation from frontmatter.\n\n```json\n{\n \"\": [\n {\n \"label\": \"General\",\n \"links\": [\n { \"slug\": \"\", \"title\": \"Getting Started\" },\n { \"slug\": \"commands\", \"title\": \"Commands\" }\n ]\n }\n ],\n \"platform\": [\n {\n \"label\": \"Overview\",\n \"links\": [\n { \"slug\": \"platform/auth\", \"title\": \"Authentication\" },\n { \"slug\": \"platform/users\", \"title\": \"Users\" }\n ]\n }\n ]\n}\n```\n\nThe key `\"\"` controls the root section. Other keys match section slugs defined in `sections.json` or derived from frontmatter. See [Sections](/sections) for details on configuring sections.\n\nKeys are URL prefixes, so on a site with [languages](/languages) or [versions](/versions) they can also name a variant: `\"de\"` for the German root, `\"de/platform\"` for the German Platform section, `\"v1\"` for the root of version v1. A scope without a key builds its sidebar from frontmatter, so you only have to define the scopes you want to control by hand.\n\n### Fields\n\n- **label**: The section header shown in the sidebar.\n- **icon**: Optional [Lucide](https://lucide.dev/icons) icon name shown next to the category header.\n- **links**: An array of page entries for that section.\n - **slug**: The MDX file slug (filename without extension). Use an empty string `\"\"` for `index.mdx`.\n - **title**: The display title in the navigation. This can differ from the page's `title` frontmatter.\n - **icon**: Optional Lucide icon name shown next to the link.\n - **links**: Optional array of nested child links. See [Nested navigation](#nested-navigation).\n\n## Icons\n\nAdd icons to categories and links to make the sidebar easier to scan. Icons use [Lucide](https://lucide.dev/icons) names in kebab-case (e.g. `rocket`, `book-open`, `settings`). Unknown names render nothing, so a typo never breaks the build.\n\nWith frontmatter, set `navIcon` on a page for its sidebar link and `categoryIcon` for its category:\n\n```text\n---\ntitle: \"Introduction\"\ncategory: \"Getting Started\"\ncategoryOrder: 1\norder: 1\nnavIcon: \"rocket\"\ncategoryIcon: \"book-open\"\n---\n```\n\nWith `navigation.json`, add an `icon` to any category or link:\n\n```json\n[\n {\n \"label\": \"Getting Started\",\n \"icon\": \"book-open\",\n \"links\": [\n { \"slug\": \"\", \"title\": \"Introduction\", \"icon\": \"rocket\" },\n { \"slug\": \"commands\", \"title\": \"Commands\", \"icon\": \"terminal\" }\n ]\n }\n]\n```\n\n## Nested navigation\n\nA link in `navigation.json` can hold its own `links` array to create a collapsible group. Groups expand and collapse on click and open automatically when one of their pages is active. Nesting can go as deep as you need.\n\n```json\n[\n {\n \"label\": \"Guides\",\n \"icon\": \"book-open\",\n \"links\": [\n { \"slug\": \"guides\", \"title\": \"Overview\", \"icon\": \"compass\" },\n {\n \"title\": \"Advanced\",\n \"icon\": \"settings\",\n \"links\": [\n { \"slug\": \"guides/caching\", \"title\": \"Caching\" },\n { \"slug\": \"guides/streaming\", \"title\": \"Streaming\" }\n ]\n }\n ]\n }\n]\n```\n\nA group can be a plain label - omit `slug` and it acts only as a collapsible header - or a real page, by adding a `slug` so the group title is also a link.\n\n<Callout type=\"note\">\n Nested groups are only available through `navigation.json`. Frontmatter navigation is always two levels: category and pages.\n</Callout>\n\n## Precedence and behavior\n\n<Callout type=\"note\">\n `navigation.json` takes priority over frontmatter. If present, it fully controls the sidebar structure for the sections it covers.\n</Callout>\n\n- Without `navigation.json`, the sidebar is built from page frontmatter: `category` -> grouped; `categoryOrder` -> category position; `order` -> page position.\n- When using the object format, sections not listed in `navigation.json` fall back to frontmatter-based navigation.\n- Pages without a `category` appear at the top level.\n\n## Tips\n\n- **Start simple**: Use frontmatter for small docs. Switch to `navigation.json` as the structure grows.\n- **Keep slugs consistent**: `slug` must match the MDX filename (e.g., `text.mdx` -> `text`).\n- **Control titles**: Use `title` in `navigation.json` to customize sidebar labels without changing page frontmatter.\n- **Per-section navigation**: Use the object format to define different sidebars for each section. Mix and match - define some sections explicitly and let others auto-generate.";
@@ -143,6 +143,8 @@ When using [sections](/sections), you can define navigation for each section by
143
143
 
144
144
  The key \`""\` controls the root section. Other keys match section slugs defined in \`sections.json\` or derived from frontmatter. See [Sections](/sections) for details on configuring sections.
145
145
 
146
+ Keys are URL prefixes, so on a site with [languages](/languages) or [versions](/versions) they can also name a variant: \`"de"\` for the German root, \`"de/platform"\` for the German Platform section, \`"v1"\` for the root of version v1. A scope without a key builds its sidebar from frontmatter, so you only have to define the scopes you want to control by hand.
147
+
146
148
  ### Fields
147
149
 
148
150
  - **label**: The section header shown in the sidebar.
@@ -1 +1 @@
1
- export declare const platformAiAssistantMdxTemplate = "---\ntitle: \"AI Assistant\"\ndescription: \"One setting per project decides what powers every AI feature - Agent Sync, the editor assistant, repository imports, and the assistant on your published site.\"\ndate: \"2026-02-19\"\nupdated: \"2026-08-17\"\ncategory: \"AI & Integrations\"\ncategoryOrder: 3\ncategoryIcon: \"sparkles\"\norder: 0\nsection: \"Platform\"\n---\n# AI Assistant\n\nOne setting decides what every AI feature in your project spends. It covers both sides of Doccupine:\n\n| Where | What it powers |\n| ----- | -------------- |\n| **In Doccupine** | [Agent Sync](/platform/self-updating-docs) runs, the [editor's](/platform/file-editor) writing assistant, Auto-link's AI selection, and [Import from GitHub](/platform/import-from-github) |\n| **On your site** | The assistant readers use to ask questions about your documentation |\n\nYou'll find it under **Settings \u2192 AI** in the project sidebar.\n\n## Modes\n\n### Enable AI Assistant (default)\n\nUses the AI credit included with your plan. Nothing to configure - no API keys, no provider account.\n\n| Plan | Monthly Budget |\n| ---------- | -------------- |\n| Trial | $5 |\n| Pro | $20 |\n| Enterprise | $50 |\n\nThe settings page shows a usage meter with your current spending and what's left. Usage resets with your billing cycle.\n\nBecause this credit is shared across everything you do, Doccupine keeps single runs bounded: an agent run and a repository import each stop at a spend ceiling and ship whatever they finished, rather than quietly draining a month's budget in one go.\n\n#### AI credit top-ups\n\nIf you run out before your billing cycle resets, you can buy a one-time top-up:\n\n- **$5**\n- **$10**\n- **$20**\n\nTop-ups apply to the current cycle immediately and reset when it renews. You can buy more than one in the same cycle.\n\n### Custom AI Models\n\nBring your own API key. It is used for everything above - writing documentation as well as answering readers - and the spend goes to your provider rather than your Doccupine credit. Supported providers:\n\n- **OpenAI**\n- **Anthropic**\n- **Google**\n\n<Callout type=\"note\">\n Once saved, a key is never shown again - the settings page displays only its last four characters. To change it, select **Replace key** and enter a new one.\n</Callout>\n\n#### Documentation model\n\nWhich model Agent Sync, the editor assistant, and imports write with. This is deliberately separate from the chat model below: one writes whole documentation pages that have to build, the other writes a paragraph into a chat bubble, and the right model for each is rarely the same. Doccupine defaults to a capable model for your provider.\n\n#### Spend limit\n\nYour own key has no ceiling unless you give it one. Turn on **Limit spend per run** to cap a single agent run or import in dollars; Doccupine stops at the limit and keeps whatever it wrote. The limit is per run, not per month.\n\n#### Site assistant options\n\nThese only affect the assistant on your published site:\n\n- **Chat model** - the model that answers readers\n- **Embedding model** - the model used to index your documentation content\n- **Temperature** - response creativity (0.0 for focused answers, up to 1.0 for more varied ones)\n\nFor the full list of available models, see your provider's own documentation.\n\n### Off\n\nTurns AI off for the whole project. The assistant disappears from your published site, and Agent Sync, the editor's writing assistant, and repository imports all stop - nothing can spend on this project until you turn it back on.\n\nYour source links and drift history are untouched, so turning AI back on picks up where you left off.\n\n<Callout type=\"note\">\n AI settings are stored with your project and take effect in Doccupine immediately. Your published site receives them on its next deploy, so Doccupine offers to redeploy after you save.\n</Callout>\n\n<Callout type=\"warning\">\n Only the project **owner** can change these settings or see which key is configured. Team members can see whether AI is on, since it decides whether the agent and the editor assistant are available to them.\n</Callout>\n\n## AI endpoint authentication\n\nYour site's chat endpoint (`/api/rag`) is public by default, in the same way your documentation is. That means anyone who finds the endpoint can send it questions, and every question spends from your AI budget - or your own provider account. On a site you expect to be found, it is worth deciding deliberately whether that is what you want.\n\nTo require a key:\n\n1. Enable **Require API key for AI chat** in the Authentication card.\n2. Enter an API key.\n3. Save.\n\nClients must then send the key as a Bearer token in the `Authorization` header of every request to `/api/rag`.\n\n<Callout type=\"note\">\n Like your provider key, this one is write-only: leave the field empty to keep the key you already saved, and enter a new value only when you want to replace it. Keep your own copy - Doccupine cannot show it to you again.\n</Callout>\n\n<Callout type=\"warning\">\n On a public site, turning this on also stops the chat widget on your own documentation from answering visitors. A browser cannot safely hold a server secret, so there is nowhere for the page to keep the key - only API clients that send the Bearer token get answers.\n</Callout>\n\nIf you want readers to keep using the assistant while still closing the endpoint to strangers, protect the whole site with a password instead - see [Authentication](/platform/authentication). Readers who have unlocked the site keep chatting as normal, and the API key becomes a second way in for programmatic clients rather than a replacement for the first.\n\n<Callout type=\"note\">\n The key is stored as an environment variable (`RAG_API_KEY`) on your deployment. After saving, a redeploy is triggered automatically to apply the change. See [Authentication](/authentication) for how the site gate, `RAG_API_KEY`, and `DOCS_API_KEY` interact.\n</Callout>\n\n<Callout type=\"note\">\n Connecting external AI tools (Claude, Cursor, and others) to your site is configured on the dedicated [MCP](/platform/mcp) page, which also covers MCP server authentication.\n</Callout>";
1
+ export declare const platformAiAssistantMdxTemplate = "---\ntitle: \"AI Assistant\"\ndescription: \"One setting per project decides what powers every AI feature - Agent Sync, the editor assistant, repository imports, and the assistant on your published site.\"\ndate: \"2026-02-19\"\nupdated: \"2026-08-17\"\ncategory: \"AI & Integrations\"\ncategoryOrder: 3\ncategoryIcon: \"sparkles\"\norder: 0\nsection: \"Platform\"\n---\n# AI Assistant\n\nOne setting decides what every AI feature in your project spends. It covers both sides of Doccupine:\n\n| Where | What it powers |\n| ----- | -------------- |\n| **In Doccupine** | [Agent Sync](/platform/self-updating-docs) runs, the [editor's](/platform/file-editor) writing assistant, Auto-link's AI selection, and [Import from GitHub](/platform/import-from-github) |\n| **On your site** | The assistant readers use to ask questions about your documentation |\n\nYou'll find it under **Settings \u2192 AI** in the project sidebar.\n\n## Modes\n\n### Enable AI Assistant (default)\n\nUses the AI credit included with your plan. Nothing to configure - no API keys, no provider account.\n\nPage translation from the [Languages](/platform/languages) page uses the project's AI configuration like every other AI feature: this credit here, your own keys with custom models.\n\n| Plan | Monthly Budget |\n| ---------- | -------------- |\n| Trial | $5 |\n| Pro | $20 |\n| Enterprise | $50 |\n\nThe settings page shows a usage meter with your current spending and what's left. Usage resets with your billing cycle.\n\nBecause this credit is shared across everything you do, Doccupine keeps single runs bounded: an agent run and a repository import each stop at a spend ceiling and ship whatever they finished, rather than quietly draining a month's budget in one go.\n\n#### AI credit top-ups\n\nIf you run out before your billing cycle resets, you can buy a one-time top-up:\n\n- **$5**\n- **$10**\n- **$20**\n\nTop-ups apply to the current cycle immediately and reset when it renews. You can buy more than one in the same cycle.\n\n### Custom AI Models\n\nBring your own API key. It is used for everything above - writing documentation as well as answering readers - and the spend goes to your provider rather than your Doccupine credit. Supported providers:\n\n- **OpenAI**\n- **Anthropic**\n- **Google**\n\n<Callout type=\"note\">\n Once saved, a key is never shown again - the settings page displays only its last four characters. To change it, select **Replace key** and enter a new one.\n</Callout>\n\n#### Documentation model\n\nWhich model Agent Sync, the editor assistant, and imports write with. This is deliberately separate from the chat model below: one writes whole documentation pages that have to build, the other writes a paragraph into a chat bubble, and the right model for each is rarely the same. Doccupine defaults to a capable model for your provider.\n\n#### Spend limit\n\nYour own key has no ceiling unless you give it one. Turn on **Limit spend per run** to cap a single agent run or import in dollars; Doccupine stops at the limit and keeps whatever it wrote. The limit is per run, not per month.\n\n#### Site assistant options\n\nThese only affect the assistant on your published site:\n\n- **Chat model** - the model that answers readers\n- **Embedding model** - the model used to index your documentation content\n- **Temperature** - response creativity (0.0 for focused answers, up to 1.0 for more varied ones)\n\nFor the full list of available models, see your provider's own documentation.\n\n### Off\n\nTurns AI off for the whole project. The assistant disappears from your published site, and Agent Sync, the editor's writing assistant, and repository imports all stop - nothing can spend on this project until you turn it back on.\n\nYour source links and drift history are untouched, so turning AI back on picks up where you left off.\n\n<Callout type=\"note\">\n AI settings are stored with your project and take effect in Doccupine immediately. Your published site receives them on its next deploy, so Doccupine offers to redeploy after you save.\n</Callout>\n\n<Callout type=\"warning\">\n Only the project **owner** can change these settings or see which key is configured. Team members can see whether AI is on, since it decides whether the agent and the editor assistant are available to them.\n</Callout>\n\n## AI endpoint authentication\n\nYour site's chat endpoint (`/api/rag`) is public by default, in the same way your documentation is. That means anyone who finds the endpoint can send it questions, and every question spends from your AI budget - or your own provider account. On a site you expect to be found, it is worth deciding deliberately whether that is what you want.\n\nTo require a key:\n\n1. Enable **Require API key for AI chat** in the Authentication card.\n2. Enter an API key.\n3. Save.\n\nClients must then send the key as a Bearer token in the `Authorization` header of every request to `/api/rag`.\n\n<Callout type=\"note\">\n Like your provider key, this one is write-only: leave the field empty to keep the key you already saved, and enter a new value only when you want to replace it. Keep your own copy - Doccupine cannot show it to you again.\n</Callout>\n\n<Callout type=\"warning\">\n On a public site, turning this on also stops the chat widget on your own documentation from answering visitors. A browser cannot safely hold a server secret, so there is nowhere for the page to keep the key - only API clients that send the Bearer token get answers.\n</Callout>\n\nIf you want readers to keep using the assistant while still closing the endpoint to strangers, protect the whole site with a password instead - see [Authentication](/platform/authentication). Readers who have unlocked the site keep chatting as normal, and the API key becomes a second way in for programmatic clients rather than a replacement for the first.\n\n<Callout type=\"note\">\n The key is stored as an environment variable (`RAG_API_KEY`) on your deployment. After saving, a redeploy is triggered automatically to apply the change. See [Authentication](/authentication) for how the site gate, `RAG_API_KEY`, and `DOCS_API_KEY` interact.\n</Callout>\n\n<Callout type=\"note\">\n Connecting external AI tools (Claude, Cursor, and others) to your site is configured on the dedicated [MCP](/platform/mcp) page, which also covers MCP server authentication.\n</Callout>";
@@ -26,6 +26,8 @@ You'll find it under **Settings → AI** in the project sidebar.
26
26
 
27
27
  Uses the AI credit included with your plan. Nothing to configure - no API keys, no provider account.
28
28
 
29
+ Page translation from the [Languages](/platform/languages) page uses the project's AI configuration like every other AI feature: this credit here, your own keys with custom models.
30
+
29
31
  | Plan | Monthly Budget |
30
32
  | ---------- | -------------- |
31
33
  | Trial | $5 |
@@ -1 +1 @@
1
- export declare const platformApiPlaygroundMdxTemplate = "---\ntitle: \"API Playground\"\ndescription: \"Register an OpenAPI spec and turn it into an interactive API reference with a live request playground.\"\ndate: \"2026-07-26\"\nupdated: \"2026-07-31\"\ncategory: \"AI & Integrations\"\ncategoryOrder: 3\norder: 2\nsection: \"Platform\"\n---\n# API Playground\n\nThe API Playground settings page turns an OpenAPI spec in your repository into an interactive API reference. Any page can embed a live \"try it\" playground for a single endpoint, and you can generate a full reference with one page per operation.\n\n## Registering a spec\n\nOpen the **API Playground** settings page and choose your OpenAPI file with the **OpenAPI spec file** picker. It searches your repository for YAML and JSON files - start typing to filter, or type a path to use one that is not listed yet. The path is stored, relative to `doccupine.json`, as the `openapi` field:\n\n```json\n{\n \"openapi\": \"openapi.yaml\"\n}\n```\n\nPress **Save Configuration**, then commit the change. Both YAML and JSON specs (OpenAPI 3.0 and 3.1) are supported.\n\n> For multiple specs, edit the `openapi` array in `doccupine.json` directly - the settings page manages a single spec.\n\n<Callout type=\"warning\">\n The root spec and every local `$ref` dependency must exist in the repository after publishing. References must stay beneath the directory containing the root spec, use `.json`, `.yaml`, or `.yml`, and cannot target remote URLs, dotfiles, or dot-directories. Publish the configuration, root spec, and all referenced files together. Doccupine [checks this before publishing](/platform/publishing) rather than letting the deploy fail.\n</Callout>\n\n## Embedding a playground on a page\n\nAdd an `openapi` field to any page's frontmatter to render the interactive playground for that operation above the page content. The value is either `\"METHOD /path\"` or an `operationId`:\n\n```mdx\n---\ntitle: \"Create a post\"\nopenapi: \"POST /posts\"\n---\n\nPosts are created for a user. The playground above is live - fill in the fields and press **Send**.\n```\n\nThe playground resolves the operation from your configured spec, so its parameters, request body, and responses always match the source of truth.\n\n## Generating an API reference\n\nPress **Generate API pages** to create one page per operation from your spec. Each generated page:\n\n- carries an `openapi:` frontmatter reference, so it renders the live playground,\n- is placed under an **API Reference** section, grouped by tag,\n- documents every parameter, the request body, and each response,\n- is staged as a pending change for you to review and commit.\n\nAlongside them you get an **API Reference** landing page at the section root, listing every endpoint as a card with its method and path. It is a normal page like any other, so you can edit it, add an introduction, or delete it if you would rather write your own.\n\nGeneration reads the committed spec, so save and commit your configuration first. Endpoints are shown with a colored HTTP-method badge so they are easy to scan in the file list.\n\n## Sending requests\n\nInside the playground, **Try it** opens the request editor. Fill in parameters, authentication, and the body, then press **Send**:\n\n- **Proxy** mode runs the request from the server, so endpoints that block cross-origin browser calls still work. Requests are restricted to the servers declared in your spec.\n- **Direct** mode calls the API straight from the browser.\n\nSecrets you enter are never logged, and appear as `<YOUR_CREDENTIALS>` in the generated code snippets unless you choose to reveal them.\n";
1
+ export declare const platformApiPlaygroundMdxTemplate = "---\ntitle: \"API Playground\"\ndescription: \"Register an OpenAPI spec and turn it into an interactive API reference with a live request playground.\"\ndate: \"2026-07-26\"\nupdated: \"2026-07-31\"\ncategory: \"AI & Integrations\"\ncategoryOrder: 3\norder: 2\nsection: \"Platform\"\n---\n# API Playground\n\nThe API Playground settings page turns an OpenAPI spec in your repository into an interactive API reference. Any page can embed a live \"try it\" playground for a single endpoint, and you can generate a full reference with one page per operation.\n\n## Registering a spec\n\nOpen the **API Playground** settings page and choose your OpenAPI file with the **OpenAPI spec file** picker. It searches your repository for YAML and JSON files - start typing to filter, or type a path to use one that is not listed yet. The path is stored, relative to `doccupine.json`, as the `openapi` field:\n\n```json\n{\n \"openapi\": \"openapi.yaml\"\n}\n```\n\nPress **Save Configuration**, then commit the change. Both YAML and JSON specs (OpenAPI 3.0 and 3.1) are supported.\n\n> For multiple specs, edit the `openapi` array in `doccupine.json` directly - the settings page manages a single spec.\n\n<Callout type=\"warning\">\n The root spec and every local `$ref` dependency must exist in the repository after publishing. References must stay beneath the directory containing the root spec, use `.json`, `.yaml`, or `.yml`, and cannot target remote URLs, dotfiles, or dot-directories. Publish the configuration, root spec, and all referenced files together. Doccupine [checks this before publishing](/platform/publishing) rather than letting the deploy fail.\n</Callout>\n\n## Embedding a playground on a page\n\nAdd an `openapi` field to any page's frontmatter to render the interactive playground for that operation above the page content. The value is either `\"METHOD /path\"` or an `operationId`:\n\n```mdx\n---\ntitle: \"Create a post\"\nopenapi: \"POST /posts\"\n---\n\nPosts are created for a user. The playground above is live - fill in the fields and press **Send**.\n```\n\nThe playground resolves the operation from your configured spec, so its parameters, request body, and responses always match the source of truth.\n\n## Generating an API reference\n\nPress **Generate API pages** to create one page per operation from your spec. Each generated page:\n\n- carries an `openapi:` frontmatter reference, so it renders the live playground,\n- is placed under an **API Reference** section, grouped by tag,\n- documents every parameter, the request body, and each response,\n- is staged as a pending change for you to review and commit.\n\nAlongside them you get an **API Reference** landing page at the section root, listing every endpoint as a card with its method and path. It is a normal page like any other, so you can edit it, add an introduction, or delete it if you would rather write your own.\n\nThe generated pages always land in the default language and version; the reference is neither translated nor versioned.\n\nGeneration reads the committed spec, so save and commit your configuration first. Endpoints are shown with a colored HTTP-method badge so they are easy to scan in the file list.\n\n## Sending requests\n\nInside the playground, **Try it** opens the request editor. Fill in parameters, authentication, and the body, then press **Send**:\n\n- **Proxy** mode runs the request from the server, so endpoints that block cross-origin browser calls still work. Requests are restricted to the servers declared in your spec.\n- **Direct** mode calls the API straight from the browser.\n\nSecrets you enter are never logged, and appear as `<YOUR_CREDENTIALS>` in the generated code snippets unless you choose to reveal them.\n";