@blaaiz/docs-core 0.1.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.
Files changed (71) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +103 -0
  3. package/dist/chunk-3ZX4WIE3.js +2984 -0
  4. package/dist/chunk-3ZX4WIE3.js.map +1 -0
  5. package/dist/chunk-JCYR6RPE.js +31 -0
  6. package/dist/chunk-JCYR6RPE.js.map +1 -0
  7. package/dist/chunk-ZKOOKLZ3.js +124 -0
  8. package/dist/chunk-ZKOOKLZ3.js.map +1 -0
  9. package/dist/cli.js +534 -0
  10. package/dist/cli.js.map +1 -0
  11. package/dist/generator.cjs +508 -0
  12. package/dist/generator.cjs.map +1 -0
  13. package/dist/generator.d.cts +122 -0
  14. package/dist/generator.d.ts +122 -0
  15. package/dist/generator.js +177 -0
  16. package/dist/generator.js.map +1 -0
  17. package/dist/index.cjs +3024 -0
  18. package/dist/index.cjs.map +1 -0
  19. package/dist/index.d.cts +1182 -0
  20. package/dist/index.d.ts +1182 -0
  21. package/dist/index.js +3 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/navigation-CGqFIPlP.d.cts +498 -0
  24. package/dist/navigation-CGqFIPlP.d.ts +498 -0
  25. package/dist/openapi-types-CJ6p5Cux.d.cts +78 -0
  26. package/dist/openapi-types-CJ6p5Cux.d.ts +78 -0
  27. package/dist/ui/api-try-it.cjs +654 -0
  28. package/dist/ui/api-try-it.cjs.map +1 -0
  29. package/dist/ui/api-try-it.d.cts +78 -0
  30. package/dist/ui/api-try-it.d.ts +78 -0
  31. package/dist/ui/api-try-it.js +509 -0
  32. package/dist/ui/api-try-it.js.map +1 -0
  33. package/dist/ui/ask-ai.cjs +810 -0
  34. package/dist/ui/ask-ai.cjs.map +1 -0
  35. package/dist/ui/ask-ai.d.cts +57 -0
  36. package/dist/ui/ask-ai.d.ts +57 -0
  37. package/dist/ui/ask-ai.js +808 -0
  38. package/dist/ui/ask-ai.js.map +1 -0
  39. package/dist/ui/copy-page.cjs +312 -0
  40. package/dist/ui/copy-page.cjs.map +1 -0
  41. package/dist/ui/copy-page.d.cts +33 -0
  42. package/dist/ui/copy-page.d.ts +33 -0
  43. package/dist/ui/copy-page.js +183 -0
  44. package/dist/ui/copy-page.js.map +1 -0
  45. package/dist/ui/mermaid.cjs +363 -0
  46. package/dist/ui/mermaid.cjs.map +1 -0
  47. package/dist/ui/mermaid.d.cts +13 -0
  48. package/dist/ui/mermaid.d.ts +13 -0
  49. package/dist/ui/mermaid.js +361 -0
  50. package/dist/ui/mermaid.js.map +1 -0
  51. package/dist/ui.cjs +661 -0
  52. package/dist/ui.cjs.map +1 -0
  53. package/dist/ui.d.cts +428 -0
  54. package/dist/ui.d.ts +428 -0
  55. package/dist/ui.js +537 -0
  56. package/dist/ui.js.map +1 -0
  57. package/package.json +145 -0
  58. package/patches/fumadocs-openapi.patch +173 -0
  59. package/skills/AGENTS-section.md +36 -0
  60. package/skills/SKILL.md +363 -0
  61. package/styles/api-reference.css +1417 -0
  62. package/styles/ask-ai.css +563 -0
  63. package/styles/auth.css +462 -0
  64. package/styles/docs.css +247 -0
  65. package/styles/home.css +376 -0
  66. package/templates/init/content/docs/index.mdx.tmpl +52 -0
  67. package/templates/init/content/docs/meta.json.tmpl +3 -0
  68. package/templates/init/content/docs.json.tmpl +12 -0
  69. package/templates/init/content/nav.json.tmpl +7 -0
  70. package/templates/init/docs.config.ts.tmpl +36 -0
  71. package/templates/init/env.example.tmpl +15 -0
@@ -0,0 +1,376 @@
1
+ /*
2
+ * @blaaiz/docs-core — the landing-page layout.
3
+ *
4
+ * Import after docs.css, on a site that has a home page:
5
+ * @import '@blaaiz/docs-core/styles/home.css';
6
+ *
7
+ * A landing page is one MDX file of plain elements carrying these classes — no
8
+ * component to import, nothing to configure:
9
+ *
10
+ * <div className="home-page">
11
+ * <div className="home-hero">
12
+ * <div className="home-hero__content">
13
+ * <span className="home-hero__eyebrow"><b>@example/docs</b> · v1</span>
14
+ * <h1 className="home-hero__title">Everything the API can do.</h1>
15
+ * <p className="home-hero__body">One sentence about the product.</p>
16
+ * <div className="home-hero__actions">
17
+ * <a className="home-hero__cta" href="/docs/quickstart">Start here</a>
18
+ * <a className="home-hero__ghost" href="/docs/reference">Reference</a>
19
+ * </div>
20
+ * </div>
21
+ * </div>
22
+ * <div className="home-section"> … </div>
23
+ * </div>
24
+ *
25
+ * Blocks: `home-hero`, `home-section` (with `__label`, `__title`, `__body`),
26
+ * `home-grid` of `home-card`s, `home-split` with a `home-panel` code frame, and
27
+ * `home-owners` of `home-owner` columns.
28
+ *
29
+ * Every colour is a `--color-fd-*` theme token, so the page follows the site's
30
+ * palette and both themes. Nothing here hardcodes a brand. Type follows
31
+ * `--font-code` where a monospace face is wanted, and falls back to the system
32
+ * monospace stack on a site that declares none.
33
+ *
34
+ * Keep each text-bearing element's tag, text, and closing tag on ONE line in
35
+ * MDX. A child that starts on its own line is parsed as Markdown and wrapped in
36
+ * a `<p>`, which nests a `<p>` inside a `<p>` and breaks hydration.
37
+ */
38
+
39
+ .home-page {
40
+ --home-gutter: clamp(1.25rem, 4vw, 3.5rem);
41
+ --home-mono: var(--font-code, var(--font-mono, ui-monospace, 'SF Mono', Menlo, monospace));
42
+ width: 100%;
43
+ padding-bottom: 5rem;
44
+ }
45
+
46
+ /* --- Hero ---------------------------------------------------------------- */
47
+
48
+ .home-hero {
49
+ position: relative;
50
+ padding: clamp(3rem, 8vw, 6.5rem) var(--home-gutter) clamp(2.5rem, 5vw, 4rem);
51
+ overflow: hidden;
52
+ border-bottom: 1px solid var(--color-fd-border);
53
+ }
54
+
55
+ /* A soft wash of the site's accent behind the headline. */
56
+ .home-hero::before {
57
+ content: '';
58
+ position: absolute;
59
+ top: -40%;
60
+ left: 50%;
61
+ width: min(900px, 120%);
62
+ aspect-ratio: 1;
63
+ transform: translateX(-50%);
64
+ background: radial-gradient(
65
+ circle,
66
+ color-mix(in oklab, var(--color-fd-primary) 16%, transparent) 0%,
67
+ transparent 62%
68
+ );
69
+ pointer-events: none;
70
+ }
71
+
72
+ .home-hero__content {
73
+ position: relative;
74
+ max-width: 44rem;
75
+ }
76
+
77
+ .home-hero__eyebrow {
78
+ display: inline-flex;
79
+ align-items: center;
80
+ gap: 0.5rem;
81
+ padding: 0.3rem 0.7rem 0.3rem 0.55rem;
82
+ margin-bottom: 1.4rem;
83
+ border: 1px solid var(--color-fd-border);
84
+ border-radius: 999px;
85
+ background: var(--color-fd-card);
86
+ font-family: var(--home-mono);
87
+ font-size: 12px;
88
+ letter-spacing: 0.01em;
89
+ color: var(--color-fd-muted-foreground);
90
+ }
91
+
92
+ .home-hero__eyebrow b {
93
+ color: var(--color-fd-primary);
94
+ font-weight: 600;
95
+ }
96
+
97
+ .home-hero__title {
98
+ margin: 0;
99
+ font-size: clamp(2.1rem, 5.2vw, 3.5rem);
100
+ font-weight: 640;
101
+ line-height: 1.06;
102
+ letter-spacing: -0.035em;
103
+ }
104
+
105
+ /* `<em>` in the headline is an accent, not an italic. */
106
+ .home-hero__title em {
107
+ font-style: normal;
108
+ color: var(--color-fd-primary);
109
+ }
110
+
111
+ .home-hero__body {
112
+ margin: 1.35rem 0 0;
113
+ max-width: 38rem;
114
+ font-size: clamp(1rem, 1.4vw, 1.125rem);
115
+ line-height: 1.68;
116
+ color: var(--color-fd-muted-foreground);
117
+ }
118
+
119
+ .home-hero__actions {
120
+ display: flex;
121
+ flex-wrap: wrap;
122
+ gap: 0.75rem;
123
+ margin-top: 2.1rem;
124
+ }
125
+
126
+ .home-hero__cta,
127
+ .home-hero__ghost {
128
+ display: inline-flex;
129
+ align-items: center;
130
+ gap: 0.4rem;
131
+ padding: 0.7rem 1.25rem;
132
+ border-radius: 10px;
133
+ font-size: 14.5px;
134
+ font-weight: 550;
135
+ text-decoration: none;
136
+ transition:
137
+ background 0.15s ease,
138
+ border-color 0.15s ease,
139
+ transform 0.15s ease;
140
+ }
141
+
142
+ .home-hero__cta {
143
+ background: var(--color-fd-primary);
144
+ color: var(--color-fd-primary-foreground, #fff);
145
+ border: 1px solid var(--color-fd-primary);
146
+ }
147
+
148
+ .home-hero__cta:hover {
149
+ transform: translateY(-1px);
150
+ background: color-mix(in oklab, var(--color-fd-primary) 88%, black);
151
+ }
152
+
153
+ .home-hero__ghost {
154
+ border: 1px solid var(--color-fd-border);
155
+ background: var(--color-fd-card);
156
+ color: var(--color-fd-foreground);
157
+ }
158
+
159
+ .home-hero__ghost:hover {
160
+ border-color: var(--color-fd-primary);
161
+ background: color-mix(in oklab, var(--color-fd-primary) 7%, transparent);
162
+ }
163
+
164
+ /* --- Section shell, reused by every band below the hero ------------------ */
165
+
166
+ .home-section {
167
+ padding: clamp(2.5rem, 5vw, 4rem) var(--home-gutter) 0;
168
+ }
169
+
170
+ .home-section__label {
171
+ margin: 0 0 0.4rem;
172
+ font-family: var(--home-mono);
173
+ font-size: 11.5px;
174
+ font-weight: 600;
175
+ letter-spacing: 0.09em;
176
+ text-transform: uppercase;
177
+ color: var(--color-fd-primary);
178
+ }
179
+
180
+ .home-section__title {
181
+ margin: 0 0 0.6rem;
182
+ font-size: clamp(1.4rem, 2.4vw, 1.85rem);
183
+ font-weight: 620;
184
+ letter-spacing: -0.025em;
185
+ }
186
+
187
+ .home-section__body {
188
+ margin: 0 0 1.8rem;
189
+ max-width: 40rem;
190
+ font-size: 15.5px;
191
+ line-height: 1.7;
192
+ color: var(--color-fd-muted-foreground);
193
+ }
194
+
195
+ /* --- Card grid ----------------------------------------------------------- */
196
+
197
+ .home-grid {
198
+ display: grid;
199
+ gap: 0.9rem;
200
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
201
+ }
202
+
203
+ .home-card {
204
+ display: flex;
205
+ flex-direction: column;
206
+ gap: 0.4rem;
207
+ padding: 1.15rem 1.3rem 1.25rem;
208
+ border: 1px solid var(--color-fd-border);
209
+ border-radius: 14px;
210
+ background: var(--color-fd-card);
211
+ text-decoration: none;
212
+ color: inherit;
213
+ transition:
214
+ border-color 0.15s ease,
215
+ background 0.15s ease,
216
+ transform 0.15s ease;
217
+ }
218
+
219
+ a.home-card:hover {
220
+ transform: translateY(-2px);
221
+ border-color: var(--color-fd-primary);
222
+ background: color-mix(in oklab, var(--color-fd-primary) 5%, var(--color-fd-card));
223
+ }
224
+
225
+ .home-card__icon {
226
+ display: inline-flex;
227
+ align-items: center;
228
+ justify-content: center;
229
+ width: 30px;
230
+ height: 30px;
231
+ margin-bottom: 0.35rem;
232
+ border-radius: 9px;
233
+ background: color-mix(in oklab, var(--color-fd-primary) 12%, transparent);
234
+ color: var(--color-fd-primary);
235
+ font-family: var(--home-mono);
236
+ font-size: 13px;
237
+ font-weight: 600;
238
+ }
239
+
240
+ .home-card__title {
241
+ font-size: 15.5px;
242
+ font-weight: 600;
243
+ letter-spacing: -0.01em;
244
+ }
245
+
246
+ .home-card__body {
247
+ font-size: 14px;
248
+ line-height: 1.6;
249
+ color: var(--color-fd-muted-foreground);
250
+ }
251
+
252
+ /* --- Two-column split: prose beside a code panel ------------------------- */
253
+
254
+ .home-split {
255
+ display: grid;
256
+ gap: clamp(1.25rem, 3vw, 2.5rem);
257
+ align-items: start;
258
+ grid-template-columns: 1fr;
259
+ }
260
+
261
+ @media (min-width: 960px) {
262
+ .home-split {
263
+ grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
264
+ }
265
+ }
266
+
267
+ .home-panel {
268
+ border: 1px solid var(--color-fd-border);
269
+ border-radius: 14px;
270
+ background: color-mix(in oklab, var(--color-fd-card) 92%, black);
271
+ overflow: hidden;
272
+ }
273
+
274
+ /* On a dark page the card is already near-black, so lift the panel instead. */
275
+ .dark .home-panel {
276
+ background: color-mix(in oklab, var(--color-fd-card) 92%, white);
277
+ }
278
+
279
+ .home-panel__bar {
280
+ display: flex;
281
+ align-items: center;
282
+ gap: 0.55rem;
283
+ padding: 0.7rem 1rem;
284
+ border-bottom: 1px solid var(--color-fd-border);
285
+ font-family: var(--home-mono);
286
+ font-size: 12px;
287
+ color: var(--color-fd-muted-foreground);
288
+ }
289
+
290
+ .home-panel__dots {
291
+ display: inline-flex;
292
+ gap: 5px;
293
+ }
294
+
295
+ .home-panel__dots i {
296
+ width: 9px;
297
+ height: 9px;
298
+ border-radius: 50%;
299
+ background: var(--color-fd-border);
300
+ }
301
+
302
+ .home-panel pre {
303
+ margin: 0;
304
+ padding: 1rem 1.15rem 1.2rem;
305
+ overflow-x: auto;
306
+ font-family: var(--home-mono);
307
+ font-size: 12.8px;
308
+ line-height: 1.85;
309
+ color: var(--color-fd-foreground);
310
+ }
311
+
312
+ /* Two hand-rolled highlight classes for the sample: `c` a comment, `k` a key. */
313
+ .home-panel .c {
314
+ color: var(--color-fd-muted-foreground);
315
+ }
316
+
317
+ .home-panel .k {
318
+ color: var(--color-fd-primary);
319
+ }
320
+
321
+ /* --- Ownership columns --------------------------------------------------- */
322
+
323
+ .home-owners {
324
+ display: grid;
325
+ gap: 0.9rem;
326
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
327
+ }
328
+
329
+ .home-owner {
330
+ padding: 1.2rem 1.35rem 1.35rem;
331
+ border: 1px solid var(--color-fd-border);
332
+ border-radius: 14px;
333
+ background: var(--color-fd-card);
334
+ }
335
+
336
+ .home-owner h3 {
337
+ margin: 0 0 0.15rem;
338
+ font-family: var(--home-mono);
339
+ font-size: 13px;
340
+ font-weight: 600;
341
+ letter-spacing: 0.01em;
342
+ color: var(--color-fd-primary);
343
+ }
344
+
345
+ .home-owner p {
346
+ margin: 0 0 0.9rem;
347
+ font-size: 13.5px;
348
+ color: var(--color-fd-muted-foreground);
349
+ }
350
+
351
+ .home-owner ul {
352
+ margin: 0;
353
+ padding: 0;
354
+ list-style: none;
355
+ display: flex;
356
+ flex-direction: column;
357
+ gap: 0.4rem;
358
+ }
359
+
360
+ .home-owner li {
361
+ padding-left: 1.1rem;
362
+ position: relative;
363
+ font-size: 14px;
364
+ line-height: 1.55;
365
+ }
366
+
367
+ .home-owner li::before {
368
+ content: '';
369
+ position: absolute;
370
+ left: 0;
371
+ top: 0.55em;
372
+ width: 6px;
373
+ height: 6px;
374
+ border-radius: 2px;
375
+ background: color-mix(in oklab, var(--color-fd-primary) 55%, transparent);
376
+ }
@@ -0,0 +1,52 @@
1
+ ---
2
+ title: __NAME__
3
+ description: Everything you need to get started.
4
+ ---
5
+
6
+ Welcome. This page is the front door of your documentation site.
7
+
8
+ `content/docs.json` is the single source of truth for the navigation. Add a page
9
+ to it, create the matching `.mdx` file under `content/docs/`, and it appears in
10
+ the sidebar in exactly the order you declared.
11
+
12
+ ## Write a page
13
+
14
+ Every page is Markdown with a frontmatter block.
15
+
16
+ ```mdx title="content/docs/guides/install.mdx"
17
+ ---
18
+ title: Install
19
+ description: Add the client library to your project.
20
+ ---
21
+
22
+ Run `npm install our-sdk`, then set `OUR_API_KEY` in your environment.
23
+ ```
24
+
25
+ Then declare it in `content/docs.json`:
26
+
27
+ ```json
28
+ { "tab": "Documentation", "icon": "book", "pages": ["index", "guides/install"] }
29
+ ```
30
+
31
+ ## Components you can use
32
+
33
+ The framework ships Mintlify-compatible components. Use them anywhere in a page.
34
+
35
+ <Info>
36
+ `Info`, `Tip`, `Warning`, `Note`, and `Check` render a callout.
37
+ </Info>
38
+
39
+ <Steps>
40
+ <Step title="Edit the navigation">Add the page to `content/docs.json`.</Step>
41
+ <Step title="Write the page">Create the `.mdx` file under `content/docs/`.</Step>
42
+ <Step title="Reload">The development server picks the change up.</Step>
43
+ </Steps>
44
+
45
+ ## Next
46
+
47
+ - Set the brand colours and the logo in `docs.config.ts`.
48
+ - Gate the site to your workspace with `auth: { mode: 'workspace', ... }`.
49
+ - Publish an OpenAPI reference with a try-it playground.
50
+ - Turn on Ask AI with one line of config.
51
+
52
+ Full documentation: <https://docs-core.blaaiz.dev>
@@ -0,0 +1,3 @@
1
+ {
2
+ "pages": ["index"]
3
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "__NAME__",
3
+ "navigation": {
4
+ "tabs": [
5
+ {
6
+ "tab": "Documentation",
7
+ "icon": "book",
8
+ "pages": ["index"]
9
+ }
10
+ ]
11
+ }
12
+ }
@@ -0,0 +1,7 @@
1
+ [
2
+ {
3
+ "text": "Documentation",
4
+ "url": "/docs",
5
+ "icon": "book"
6
+ }
7
+ ]
@@ -0,0 +1,36 @@
1
+ import { defineDocsConfig } from '@blaaiz/docs-core';
2
+
3
+ /**
4
+ * Site configuration.
5
+ *
6
+ * The framework owns the behaviour. This file owns the values that change per
7
+ * site: the brand, the access mode, the origins the try-it proxy may reach, and
8
+ * the features the site opts into. No secret ever lives here — config names an
9
+ * environment variable, and the server reads the value at runtime.
10
+ */
11
+ export default defineDocsConfig({
12
+ theme: {
13
+ name: '__NAME__',
14
+ colors: { primary: '#4c63f5' },
15
+ darkColors: { primary: '#8b9bff' },
16
+ },
17
+
18
+ // 'public' needs no middleware, no sign-in page, and no auth routes. Switch to
19
+ // { mode: 'workspace', allowedDomains: [...], providers: { ... } } to gate the
20
+ // site to your own people.
21
+ auth: 'public',
22
+
23
+ // Security-critical: the exhaustive list of upstream API origins the try-it
24
+ // playground may forward a request to. Anything else is refused. Leave it
25
+ // empty until the site publishes an API reference.
26
+ proxy: { allowedOrigins: [] },
27
+
28
+ features: {
29
+ // Show the "Copy page / View as Markdown" control on every page.
30
+ copyPage: true,
31
+ },
32
+
33
+ // Ask AI: uncomment the line below, set ANTHROPIC_API_KEY on the server, and
34
+ // mount the route and the panel. Naming a provider is the whole setup.
35
+ // ai: { provider: 'anthropic' },
36
+ });
@@ -0,0 +1,15 @@
1
+ # Server-side environment for the docs site. Copy this file to .env.local, fill in
2
+ # only what the site uses, and keep .env.local out of version control. Every value
3
+ # is read on the server; none of them reaches the browser.
4
+
5
+ # Signs the session cookie on a workspace-gated site. Generate with: openssl rand -hex 32
6
+ # DOCS_SESSION_SECRET=
7
+
8
+ # The one shared secret readers type in, for the workspace `secret` sign-in provider.
9
+ # DOCS_ACCESS_SECRET=
10
+
11
+ # API key for Ask AI with ai: { provider: 'anthropic' }.
12
+ # ANTHROPIC_API_KEY=
13
+
14
+ # API key for Ask AI with ai: { provider: 'openai' }.
15
+ # OPENAI_API_KEY=