@heyo-sh/create-heyo-docs 0.3.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/astro/content/api-overview.mdx +20 -0
- package/templates/astro/content/assets/local-architecture.svg +22 -0
- package/templates/astro/content/assets/quick-reference.txt +5 -0
- package/templates/astro/content/changelog.mdx +38 -0
- package/templates/astro/content/configuration.mdx +41 -0
- package/templates/astro/content/essentials/callouts.mdx +16 -18
- package/templates/astro/content/essentials/code-blocks.mdx +7 -15
- package/templates/astro/content/essentials/lists.mdx +9 -13
- package/templates/astro/content/essentials/tables.mdx +7 -14
- package/templates/astro/content/essentials/tabs.mdx +10 -12
- package/templates/astro/content/essentials/text-styling.mdx +14 -21
- package/templates/astro/content/openapi-petstore.json +160 -0
- package/templates/astro/content/openapi.json +278 -0
- package/templates/astro/heyo-docs.config.ts +20 -10
- package/templates/astro/src/components/docs-app.tsx +1 -1
- package/templates/astro/src/layouts/docs-layout.astro +1 -0
- package/templates/astro/src/pages/heyo-docs-internal/ai-chat.ts +20 -0
- package/templates/astro/src/pages/index.astro +13 -0
- package/templates/astro/src/styles/app.css +12 -2
- package/templates/astro/src/virtual.d.ts +7 -0
- package/templates/next/app/[[...slug]]/page.tsx +26 -5
- package/templates/next/app/app.css +12 -2
- package/templates/next/app/components/docs-app.tsx +1 -2
- package/templates/next/app/heyo-docs-internal/ai-chat/route.ts +15 -0
- package/templates/next/app/layout.tsx +1 -0
- package/templates/next/content/api-overview.mdx +20 -0
- package/templates/next/content/assets/local-architecture.svg +22 -0
- package/templates/next/content/assets/quick-reference.txt +5 -0
- package/templates/next/content/changelog.mdx +38 -0
- package/templates/next/content/configuration.mdx +41 -0
- package/templates/next/content/essentials/callouts.mdx +16 -18
- package/templates/next/content/essentials/code-blocks.mdx +7 -15
- package/templates/next/content/essentials/lists.mdx +9 -13
- package/templates/next/content/essentials/tables.mdx +7 -14
- package/templates/next/content/essentials/tabs.mdx +10 -12
- package/templates/next/content/essentials/text-styling.mdx +14 -21
- package/templates/next/content/openapi-petstore.json +160 -0
- package/templates/next/content/openapi.json +278 -0
- package/templates/next/heyo-docs.config.ts +20 -10
- package/templates/react-router/app/app.css +12 -2
- package/templates/react-router/app/root.tsx +2 -1
- package/templates/react-router/app/routes/ai-chat.ts +21 -0
- package/templates/react-router/app/routes/docs.tsx +1 -1
- package/templates/react-router/app/routes/home.tsx +20 -1
- package/templates/react-router/app/routes.ts +1 -0
- package/templates/react-router/app/virtual.d.ts +7 -0
- package/templates/react-router/content/api-overview.mdx +20 -0
- package/templates/react-router/content/assets/local-architecture.svg +22 -0
- package/templates/react-router/content/assets/quick-reference.txt +5 -0
- package/templates/react-router/content/changelog.mdx +38 -0
- package/templates/react-router/content/configuration.mdx +41 -0
- package/templates/react-router/content/essentials/callouts.mdx +16 -18
- package/templates/react-router/content/essentials/code-blocks.mdx +7 -15
- package/templates/react-router/content/essentials/lists.mdx +9 -13
- package/templates/react-router/content/essentials/tables.mdx +7 -14
- package/templates/react-router/content/essentials/tabs.mdx +10 -12
- package/templates/react-router/content/essentials/text-styling.mdx +14 -21
- package/templates/react-router/content/openapi-petstore.json +160 -0
- package/templates/react-router/content/openapi.json +278 -0
- package/templates/react-router/heyo-docs.config.ts +20 -10
- package/templates/astro/content/index.mdx +0 -22
- package/templates/next/content/index.mdx +0 -22
- package/templates/react-router/content/index.mdx +0 -22
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
{
|
|
2
|
+
"openapi": "3.1.0",
|
|
3
|
+
"info": {
|
|
4
|
+
"title": "Planet API",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"description": "An example API used by the Heyo Docs React Router demo."
|
|
7
|
+
},
|
|
8
|
+
"servers": [
|
|
9
|
+
{
|
|
10
|
+
"url": "https://api.example.com/v1",
|
|
11
|
+
"description": "Example production API"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"security": [
|
|
15
|
+
{
|
|
16
|
+
"BearerAuth": []
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"paths": {
|
|
20
|
+
"/organizations/{organizationId}/planets": {
|
|
21
|
+
"parameters": [
|
|
22
|
+
{
|
|
23
|
+
"name": "organizationId",
|
|
24
|
+
"in": "path",
|
|
25
|
+
"required": true,
|
|
26
|
+
"description": "The organization that owns the planets.",
|
|
27
|
+
"schema": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"example": "org_123"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"get": {
|
|
34
|
+
"operationId": "listPlanets",
|
|
35
|
+
"summary": "List planets",
|
|
36
|
+
"description": "Returns the planets that belong to an organization.",
|
|
37
|
+
"tags": ["Planets"],
|
|
38
|
+
"parameters": [
|
|
39
|
+
{
|
|
40
|
+
"name": "limit",
|
|
41
|
+
"in": "query",
|
|
42
|
+
"description": "Maximum number of records to return.",
|
|
43
|
+
"schema": {
|
|
44
|
+
"type": "integer",
|
|
45
|
+
"default": 20
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"responses": {
|
|
50
|
+
"200": {
|
|
51
|
+
"description": "A page of planets.",
|
|
52
|
+
"content": {
|
|
53
|
+
"application/json": {
|
|
54
|
+
"schema": {
|
|
55
|
+
"type": "array",
|
|
56
|
+
"items": {
|
|
57
|
+
"$ref": "#/components/schemas/Planet"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"post": {
|
|
66
|
+
"operationId": "createPlanet",
|
|
67
|
+
"summary": "Create a planet",
|
|
68
|
+
"description": "Creates a planet inside an organization.",
|
|
69
|
+
"tags": ["Planets"],
|
|
70
|
+
"requestBody": {
|
|
71
|
+
"required": true,
|
|
72
|
+
"description": "The planet to create.",
|
|
73
|
+
"content": {
|
|
74
|
+
"application/json": {
|
|
75
|
+
"schema": {
|
|
76
|
+
"$ref": "#/components/schemas/PlanetInput"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"responses": {
|
|
82
|
+
"201": {
|
|
83
|
+
"description": "The newly created planet.",
|
|
84
|
+
"content": {
|
|
85
|
+
"application/json": {
|
|
86
|
+
"schema": {
|
|
87
|
+
"$ref": "#/components/schemas/Planet"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"/organizations/{organizationId}/planets/{planetId}": {
|
|
96
|
+
"parameters": [
|
|
97
|
+
{
|
|
98
|
+
"name": "organizationId",
|
|
99
|
+
"in": "path",
|
|
100
|
+
"required": true,
|
|
101
|
+
"description": "The organization that owns the planet.",
|
|
102
|
+
"schema": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"example": "org_123"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "planetId",
|
|
109
|
+
"in": "path",
|
|
110
|
+
"required": true,
|
|
111
|
+
"description": "The planet identifier.",
|
|
112
|
+
"schema": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"example": "planet_earth"
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
"get": {
|
|
119
|
+
"operationId": "getPlanet",
|
|
120
|
+
"summary": "Get a planet",
|
|
121
|
+
"description": "Returns one planet by ID.",
|
|
122
|
+
"tags": ["Planets"],
|
|
123
|
+
"responses": {
|
|
124
|
+
"200": {
|
|
125
|
+
"description": "The requested planet.",
|
|
126
|
+
"content": {
|
|
127
|
+
"application/json": {
|
|
128
|
+
"schema": {
|
|
129
|
+
"$ref": "#/components/schemas/Planet"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"404": {
|
|
135
|
+
"description": "Planet not found."
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"put": {
|
|
140
|
+
"operationId": "replacePlanet",
|
|
141
|
+
"summary": "Replace a planet",
|
|
142
|
+
"description": "Replaces all editable planet values.",
|
|
143
|
+
"tags": ["Planets"],
|
|
144
|
+
"requestBody": {
|
|
145
|
+
"required": true,
|
|
146
|
+
"content": {
|
|
147
|
+
"application/json": {
|
|
148
|
+
"schema": {
|
|
149
|
+
"$ref": "#/components/schemas/PlanetInput"
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"responses": {
|
|
155
|
+
"200": {
|
|
156
|
+
"description": "The updated planet.",
|
|
157
|
+
"content": {
|
|
158
|
+
"application/json": {
|
|
159
|
+
"schema": {
|
|
160
|
+
"$ref": "#/components/schemas/Planet"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"patch": {
|
|
168
|
+
"operationId": "updatePlanet",
|
|
169
|
+
"summary": "Update a planet",
|
|
170
|
+
"description": "Updates one or more planet fields.",
|
|
171
|
+
"tags": ["Planets"],
|
|
172
|
+
"requestBody": {
|
|
173
|
+
"required": true,
|
|
174
|
+
"content": {
|
|
175
|
+
"application/json": {
|
|
176
|
+
"schema": {
|
|
177
|
+
"$ref": "#/components/schemas/PlanetPatch"
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"responses": {
|
|
183
|
+
"200": {
|
|
184
|
+
"description": "The updated planet.",
|
|
185
|
+
"content": {
|
|
186
|
+
"application/json": {
|
|
187
|
+
"schema": {
|
|
188
|
+
"$ref": "#/components/schemas/Planet"
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"delete": {
|
|
196
|
+
"operationId": "deletePlanet",
|
|
197
|
+
"summary": "Delete a planet",
|
|
198
|
+
"description": "Permanently removes a planet from an organization.",
|
|
199
|
+
"tags": ["Planets"],
|
|
200
|
+
"parameters": [
|
|
201
|
+
{
|
|
202
|
+
"name": "hardDelete",
|
|
203
|
+
"in": "query",
|
|
204
|
+
"description": "Also remove historical records.",
|
|
205
|
+
"schema": {
|
|
206
|
+
"type": "boolean",
|
|
207
|
+
"default": false
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
],
|
|
211
|
+
"responses": {
|
|
212
|
+
"204": {
|
|
213
|
+
"description": "Planet deleted."
|
|
214
|
+
},
|
|
215
|
+
"404": {
|
|
216
|
+
"description": "Planet not found."
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
"components": {
|
|
223
|
+
"securitySchemes": {
|
|
224
|
+
"BearerAuth": {
|
|
225
|
+
"type": "http",
|
|
226
|
+
"scheme": "bearer",
|
|
227
|
+
"bearerFormat": "JWT"
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
"schemas": {
|
|
231
|
+
"Planet": {
|
|
232
|
+
"type": "object",
|
|
233
|
+
"required": ["id", "name", "classification"],
|
|
234
|
+
"properties": {
|
|
235
|
+
"id": {
|
|
236
|
+
"type": "string",
|
|
237
|
+
"example": "planet_earth"
|
|
238
|
+
},
|
|
239
|
+
"name": {
|
|
240
|
+
"type": "string",
|
|
241
|
+
"example": "Earth"
|
|
242
|
+
},
|
|
243
|
+
"classification": {
|
|
244
|
+
"type": "string",
|
|
245
|
+
"enum": ["terrestrial", "gas-giant", "ice-giant"]
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
"PlanetInput": {
|
|
250
|
+
"type": "object",
|
|
251
|
+
"required": ["name", "classification"],
|
|
252
|
+
"properties": {
|
|
253
|
+
"name": {
|
|
254
|
+
"type": "string",
|
|
255
|
+
"example": "Mars"
|
|
256
|
+
},
|
|
257
|
+
"classification": {
|
|
258
|
+
"type": "string",
|
|
259
|
+
"enum": ["terrestrial", "gas-giant", "ice-giant"]
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
"PlanetPatch": {
|
|
264
|
+
"type": "object",
|
|
265
|
+
"properties": {
|
|
266
|
+
"name": {
|
|
267
|
+
"type": "string",
|
|
268
|
+
"example": "New Mars"
|
|
269
|
+
},
|
|
270
|
+
"classification": {
|
|
271
|
+
"type": "string",
|
|
272
|
+
"enum": ["terrestrial", "gas-giant", "ice-giant"]
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
@@ -11,15 +11,6 @@ export default heyoDocs({
|
|
|
11
11
|
group: "Documentation",
|
|
12
12
|
icon: "globe",
|
|
13
13
|
sections: [
|
|
14
|
-
{
|
|
15
|
-
pages: [
|
|
16
|
-
{
|
|
17
|
-
title: "Documentation",
|
|
18
|
-
src: "https://docs.heyo.sh/introduction",
|
|
19
|
-
icon: "book",
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
},
|
|
23
14
|
{
|
|
24
15
|
section: "Get Started",
|
|
25
16
|
icon: "lightbulb",
|
|
@@ -39,8 +30,27 @@ export default heyoDocs({
|
|
|
39
30
|
},
|
|
40
31
|
],
|
|
41
32
|
},
|
|
33
|
+
{
|
|
34
|
+
group: "OpenAPI",
|
|
35
|
+
icon: "code",
|
|
36
|
+
sections: [
|
|
37
|
+
{
|
|
38
|
+
pages: ["api-overview"],
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
schema: "./openapi.json",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
group: "Changelog",
|
|
47
|
+
description: "Mock release notes for the Heyo Docs demo.",
|
|
48
|
+
icon: "changelog",
|
|
49
|
+
type: "changelog",
|
|
50
|
+
updates: ["changelog"],
|
|
51
|
+
},
|
|
42
52
|
],
|
|
43
|
-
branding: { name: "{{PROJECT_NAME}}" },
|
|
53
|
+
branding: { name: "{{PROJECT_NAME}}", logo: "/logo.svg" },
|
|
44
54
|
// Set this before deploying to publish canonical and absolute social URLs.
|
|
45
55
|
// siteUrl: "https://docs.example.com",
|
|
46
56
|
});
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
@import "@fontsource-variable/figtree";
|
|
2
|
-
@import "@heyo-sh/heyo-docs/theme/{{THEME}}.css";
|
|
3
2
|
|
|
4
3
|
:root {
|
|
5
4
|
--heyo-docs-font-family: "Figtree Variable", sans-serif;
|
|
6
5
|
}
|
|
7
6
|
|
|
8
|
-
/* Add project-specific token overrides and theme styles
|
|
7
|
+
/* Add project-specific token overrides and theme styles here. */
|
|
8
|
+
@media (min-width: 1024px) {
|
|
9
|
+
header > a[aria-label] > img[src="/logo.svg"] {
|
|
10
|
+
height: 32px;
|
|
11
|
+
max-height: none;
|
|
12
|
+
width: auto;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.dark header > a[aria-label] > img[src="/logo.svg"] {
|
|
17
|
+
filter: invert(1);
|
|
18
|
+
}
|
|
@@ -71,9 +71,10 @@ import {
|
|
|
71
71
|
import type { Route } from "./+types/root";
|
|
72
72
|
|
|
73
73
|
import "./app.css";
|
|
74
|
+
import "virtual:heyo-docs-theme.css";
|
|
74
75
|
import { ThemeProvider } from "./components/theme-provider";
|
|
75
|
-
import config from "../heyo-docs.config";
|
|
76
76
|
import { getThemeScript, THEME_STORAGE_KEY } from "./lib/theme";
|
|
77
|
+
import { config } from "virtual:heyo-docs-config";
|
|
77
78
|
|
|
78
79
|
export const meta: MetaFunction = () => {
|
|
79
80
|
const canonical = config.siteUrl ? `${config.siteUrl}/` : undefined;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ActionFunctionArgs } from "react-router";
|
|
2
|
+
|
|
3
|
+
import config from "../../heyo-docs.config";
|
|
4
|
+
import { pages } from "virtual:heyo-docs-content";
|
|
5
|
+
import { pages as markdownPages } from "virtual:heyo-docs-content/server";
|
|
6
|
+
|
|
7
|
+
export async function action({ request }: ActionFunctionArgs) {
|
|
8
|
+
if (request.method !== "POST")
|
|
9
|
+
return new Response("Method Not Allowed", {
|
|
10
|
+
headers: { Allow: "POST" },
|
|
11
|
+
status: 405,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const { createAiChatResponse } = await import("@heyo-sh/heyo-docs/ai");
|
|
15
|
+
return createAiChatResponse(request, {
|
|
16
|
+
ai: config.ai,
|
|
17
|
+
markdownPages,
|
|
18
|
+
pages,
|
|
19
|
+
title: config.title,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
@@ -16,9 +16,9 @@ import {
|
|
|
16
16
|
} from "react-router";
|
|
17
17
|
import { forwardRef, type ComponentPropsWithoutRef } from "react";
|
|
18
18
|
|
|
19
|
-
import config from "../../heyo-docs.config";
|
|
20
19
|
import { iconSet } from "../heyo-docs-icons";
|
|
21
20
|
import { useTheme } from "../components/theme-provider";
|
|
21
|
+
import { config } from "virtual:heyo-docs-config";
|
|
22
22
|
import { pages } from "virtual:heyo-docs-content";
|
|
23
23
|
import { openApiDocuments } from "virtual:heyo-docs-openapi";
|
|
24
24
|
import { openApiEndpoints } from "virtual:heyo-docs-openapi/index";
|
|
@@ -1 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
import { createDocsModel, navigationPages } from "@heyo-sh/heyo-docs";
|
|
2
|
+
import { redirect } from "react-router";
|
|
3
|
+
|
|
4
|
+
import { config } from "virtual:heyo-docs-config";
|
|
5
|
+
import { pages } from "virtual:heyo-docs-content";
|
|
6
|
+
|
|
7
|
+
export function loader() {
|
|
8
|
+
const firstPage = createDocsModel(config, pages)
|
|
9
|
+
.navigation.flatMap((group) => navigationPages(group.sections))
|
|
10
|
+
.at(0);
|
|
11
|
+
|
|
12
|
+
if (!firstPage)
|
|
13
|
+
throw new Response("No local documentation page is configured.", {
|
|
14
|
+
status: 404,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
return redirect(firstPage.slug);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { default, ErrorBoundary } from "./docs";
|
|
@@ -9,5 +9,6 @@ export default [
|
|
|
9
9
|
route("llms-full.txt", "routes/llms-full.ts"),
|
|
10
10
|
route("__heyo-docs/markdown/*", "routes/markdown.ts"),
|
|
11
11
|
route("heyo-docs-internal/openapi-request", "routes/openapi-request.ts"),
|
|
12
|
+
route("heyo-docs-internal/ai-chat", "routes/ai-chat.ts"),
|
|
12
13
|
route("*", "routes/page.tsx"),
|
|
13
14
|
] satisfies RouteConfig;
|
|
@@ -3,6 +3,13 @@ declare module "virtual:heyo-docs-content" {
|
|
|
3
3
|
export const pages: DocsPage[];
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
+
declare module "virtual:heyo-docs-config" {
|
|
7
|
+
import type { HeyoDocsConfig } from "@heyo-sh/heyo-docs";
|
|
8
|
+
export const config: HeyoDocsConfig;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare module "virtual:heyo-docs-theme.css";
|
|
12
|
+
|
|
6
13
|
declare module "virtual:heyo-docs-content/server" {
|
|
7
14
|
import type { MarkdownPage } from "@heyo-sh/heyo-docs";
|
|
8
15
|
export const pages: MarkdownPage[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: API overview
|
|
3
|
+
description: Learn how to authenticate and explore the API reference.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# API overview
|
|
7
|
+
|
|
8
|
+
The API reference is generated from `openapi.json`. Use the endpoint pages to
|
|
9
|
+
enter parameters, send a request, and copy a cURL or JavaScript example.
|
|
10
|
+
|
|
11
|
+
## Authentication
|
|
12
|
+
|
|
13
|
+
The example API uses a Bearer token. Enter it once on any protected endpoint;
|
|
14
|
+
Heyo Docs keeps it in this browser while you move between API pages.
|
|
15
|
+
|
|
16
|
+
## Custom pages first
|
|
17
|
+
|
|
18
|
+
This ordinary MDX page belongs to the OpenAPI group. Its section is configured
|
|
19
|
+
before the generated endpoint sections, so it always appears at the top of the
|
|
20
|
+
sidebar.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="960" height="360" viewBox="0 0 960 360" fill="none">
|
|
2
|
+
<rect width="960" height="360" rx="24" fill="#F7F7F8"/>
|
|
3
|
+
<g fill="#FFFFFF" stroke="#D4D4D8" stroke-width="2">
|
|
4
|
+
<rect x="72" y="108" width="220" height="144" rx="18"/>
|
|
5
|
+
<rect x="370" y="108" width="220" height="144" rx="18"/>
|
|
6
|
+
<rect x="668" y="108" width="220" height="144" rx="18"/>
|
|
7
|
+
</g>
|
|
8
|
+
<g fill="#18181B" font-family="Arial, sans-serif" text-anchor="middle">
|
|
9
|
+
<text x="182" y="166" font-size="17" font-weight="700">Content</text>
|
|
10
|
+
<text x="182" y="194" font-size="14" fill="#71717A">MDX and assets</text>
|
|
11
|
+
<text x="480" y="166" font-size="17" font-weight="700">Build</text>
|
|
12
|
+
<text x="480" y="194" font-size="14" fill="#71717A">Vite bundles files</text>
|
|
13
|
+
<text x="778" y="166" font-size="17" font-weight="700">Documentation</text>
|
|
14
|
+
<text x="778" y="194" font-size="14" fill="#71717A">Static output</text>
|
|
15
|
+
</g>
|
|
16
|
+
<g stroke="#71717A" stroke-linecap="round" stroke-width="2">
|
|
17
|
+
<path d="M314 180h34"/>
|
|
18
|
+
<path d="m340 172 8 8-8 8"/>
|
|
19
|
+
<path d="M612 180h34"/>
|
|
20
|
+
<path d="m638 172 8 8-8 8"/>
|
|
21
|
+
</g>
|
|
22
|
+
</svg>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Changelog
|
|
3
|
+
description: Mock release notes for the Heyo Docs example.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Changelog
|
|
7
|
+
|
|
8
|
+
<Update label="April 2026" tags={["New", "Documentation"]}>
|
|
9
|
+
|
|
10
|
+
## Starter documentation
|
|
11
|
+
|
|
12
|
+
New projects and runnable examples now include a structured Quickstart, basic
|
|
13
|
+
configuration guide, deployment overview, and essential writing patterns.
|
|
14
|
+
|
|
15
|
+
## Square API group
|
|
16
|
+
|
|
17
|
+
The example navigation now keeps the pinned Square OpenAPI schema in its own
|
|
18
|
+
group, making large-schema behaviour easy to inspect.
|
|
19
|
+
|
|
20
|
+
</Update>
|
|
21
|
+
|
|
22
|
+
<Update label="March 2026" tags={["Improved", "Developer experience"]}>
|
|
23
|
+
|
|
24
|
+
## Clearer navigation
|
|
25
|
+
|
|
26
|
+
External documentation links can display an icon, and sidebar groups now keep
|
|
27
|
+
onboarding, API reference, and release notes separate.
|
|
28
|
+
|
|
29
|
+
</Update>
|
|
30
|
+
|
|
31
|
+
<Update label="February 2026" tags={["Fixed"]}>
|
|
32
|
+
|
|
33
|
+
## More predictable previews
|
|
34
|
+
|
|
35
|
+
Preview builds now validate configured routes before mock release notes are
|
|
36
|
+
published.
|
|
37
|
+
|
|
38
|
+
</Update>
|
|
@@ -64,6 +64,47 @@ The order is meaningful: it controls the sidebar and the previous/next links at
|
|
|
64
64
|
the end of each article. Use a page object with `title` and `src` when a
|
|
65
65
|
sidebar entry should point to a page outside the local documentation.
|
|
66
66
|
|
|
67
|
+
## AI chat
|
|
68
|
+
|
|
69
|
+
Add `ai.chat` to enable a documentation-aware chat through [Pi](https://github.com/badlogic/pi-mono).
|
|
70
|
+
Use any provider identifier bundled with the installed Pi version, such as
|
|
71
|
+
`openai`, `anthropic`, `google`, `openrouter`, or `xai`. Authentication stays
|
|
72
|
+
server-only and is selected explicitly for the provider.
|
|
73
|
+
|
|
74
|
+
<CodeBlock language="ts" title="heyo-docs.config.ts">
|
|
75
|
+
{`ai: {
|
|
76
|
+
chat: {
|
|
77
|
+
provider: "openai",
|
|
78
|
+
model: "gpt-5-mini",
|
|
79
|
+
auth: { type: "api-key", token: process.env.OPENAI_API_KEY! },
|
|
80
|
+
variant: "right", // "center" shows the compact prompt first
|
|
81
|
+
icon: "chat",
|
|
82
|
+
text: "AI Chat",
|
|
83
|
+
name: "Docs Assistant", // name shown in the drawer and message labels
|
|
84
|
+
placeholder: "Ask AI about the docs", // used in the compact prompt and drawer
|
|
85
|
+
},
|
|
86
|
+
},`}
|
|
87
|
+
</CodeBlock>
|
|
88
|
+
|
|
89
|
+
`provider`, `model`, and `auth` are required. API-key providers use
|
|
90
|
+
`{ type: "api-key", token }`. GitHub Copilot and OpenAI Codex use
|
|
91
|
+
`{ type: "oauth", getAccessToken }`; the resolver runs before each Pi request,
|
|
92
|
+
so it can refresh a short-lived token. Amazon Bedrock uses either
|
|
93
|
+
`{ type: "aws", region?, profile? }` and the AWS credential chain, or
|
|
94
|
+
`{ type: "bedrock-bearer", token, region? }`. The model must be an actual model
|
|
95
|
+
identifier, not the provider name. Amazon Bedrock requires a Node.js chat
|
|
96
|
+
endpoint. `variant` defaults to `right`. `name`
|
|
97
|
+
defaults to `AI`; it is used for the drawer title and the assistant's message
|
|
98
|
+
label. `placeholder` defaults to
|
|
99
|
+
`Ask AI about the docs` and is shared by the compact prompt and drawer input.
|
|
100
|
+
The drawer stays open while
|
|
101
|
+
readers navigate between documentation pages and does not block the rest of the
|
|
102
|
+
page.
|
|
103
|
+
|
|
104
|
+
Its chrome follows the selected documentation theme. For example, `grain` uses
|
|
105
|
+
a full-height right panel with a left border, while the other themes keep a
|
|
106
|
+
floating panel treatment.
|
|
107
|
+
|
|
67
108
|
## Verify the result
|
|
68
109
|
|
|
69
110
|
Run the project's typecheck and build commands after changing configuration.
|
|
@@ -1,36 +1,34 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Callouts
|
|
3
|
-
description:
|
|
3
|
+
description: Draw attention to a tip, warning, prerequisite, or result.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Callouts
|
|
7
7
|
|
|
8
|
-
Use
|
|
9
|
-
prose. It works well for a prerequisite, a preferred approach, a warning, or a
|
|
10
|
-
successful result.
|
|
8
|
+
Use a callout when a reader should not miss a detail.
|
|
11
9
|
|
|
12
|
-
##
|
|
13
|
-
|
|
14
|
-
Use `note` or `info` for context, `tip` for a recommended approach, and
|
|
15
|
-
`check` for a completed outcome. Reserve `warning` and `danger` for cases
|
|
16
|
-
where missing the message has a real consequence.
|
|
10
|
+
## Add a tip
|
|
17
11
|
|
|
18
12
|
<Callout type="tip" title="Keep examples focused">
|
|
19
13
|
Show one idea at a time so readers can apply it quickly.
|
|
20
14
|
</Callout>
|
|
21
15
|
|
|
16
|
+
## Choose a type
|
|
17
|
+
|
|
18
|
+
| Type | Use it for |
|
|
19
|
+
| --------------------- | ---------------------- |
|
|
20
|
+
| `info` or `note` | Helpful context |
|
|
21
|
+
| `tip` | A recommended approach |
|
|
22
|
+
| `check` | A successful result |
|
|
23
|
+
| `warning` or `danger` | A real consequence |
|
|
24
|
+
|
|
22
25
|
<Callout type="warning" title="Preview before publishing">
|
|
23
|
-
Run the production build
|
|
26
|
+
Run the production build after changing navigation or MDX.
|
|
24
27
|
</Callout>
|
|
25
28
|
|
|
26
|
-
##
|
|
27
|
-
|
|
28
|
-
Pass the message as children when it needs Markdown or another MDX component.
|
|
29
|
+
## Keep it short
|
|
29
30
|
|
|
30
31
|
<Callout type="info" title="Configuration and content work together">
|
|
31
|
-
Navigation belongs in <code>heyo-docs.config.ts</code
|
|
32
|
-
descriptions belong in
|
|
32
|
+
Navigation belongs in <code>heyo-docs.config.ts</code>. Titles and
|
|
33
|
+
descriptions belong in page frontmatter.
|
|
33
34
|
</Callout>
|
|
34
|
-
|
|
35
|
-
Keep each callout focused on one decision. A long sequence of status messages is
|
|
36
|
-
usually clearer as regular sections or a numbered procedure.
|
|
@@ -1,29 +1,22 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Code Blocks
|
|
3
|
-
description:
|
|
3
|
+
description: Add clear, copyable commands and configuration examples.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Code Blocks
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
Use inline code for a literal value, then use a fenced block or `CodeBlock`
|
|
10
|
-
when a reader needs more than one line.
|
|
8
|
+
Show one task per example. Add a language so the code is easy to read.
|
|
11
9
|
|
|
12
|
-
## Add a
|
|
13
|
-
|
|
14
|
-
The language label enables syntax highlighting and tells readers what they are
|
|
15
|
-
looking at. Use `bash` for commands, `ts` for configuration, and `json` for
|
|
16
|
-
data.
|
|
10
|
+
## Add a command
|
|
17
11
|
|
|
18
12
|
```bash
|
|
19
13
|
bun run dev
|
|
20
14
|
bun run build
|
|
21
15
|
```
|
|
22
16
|
|
|
23
|
-
##
|
|
17
|
+
## Add a file name
|
|
24
18
|
|
|
25
|
-
Use `CodeBlock` when
|
|
26
|
-
small enough that a reader can understand their effect before copying them.
|
|
19
|
+
Use `CodeBlock` when the file name helps explain where the code belongs.
|
|
27
20
|
|
|
28
21
|
<CodeBlock language="ts" title="heyo-docs.config.ts" showLineNumbers>
|
|
29
22
|
{`export default heyoDocs({
|
|
@@ -33,10 +26,9 @@ small enough that a reader can understand their effect before copying them.
|
|
|
33
26
|
});`}
|
|
34
27
|
</CodeBlock>
|
|
35
28
|
|
|
36
|
-
##
|
|
29
|
+
## Show alternatives
|
|
37
30
|
|
|
38
|
-
|
|
39
|
-
command without scrolling past unrelated options.
|
|
31
|
+
Use `CodeBlockGroup` for equivalent commands, such as package managers.
|
|
40
32
|
|
|
41
33
|
<CodeBlockGroup defaultValue="bun" variant="line">
|
|
42
34
|
<CodeBlock language="bash" title="bun">
|