@writedocs/generator 0.13.4 → 0.13.5

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 (86) hide show
  1. package/README.md +28 -28
  2. package/astro.config.mjs +645 -645
  3. package/bin/writedocs.js +356 -356
  4. package/package.json +99 -99
  5. package/src/cli/base-path-layout.js +44 -44
  6. package/src/cli/build-auth.js +135 -135
  7. package/src/cli/build.js +203 -203
  8. package/src/cli/check-built-styles.js +41 -41
  9. package/src/cli/convert.js +124 -124
  10. package/src/cli/dev.js +268 -268
  11. package/src/cli/exit-when-flushed.js +42 -42
  12. package/src/cli/generate-api-pages.js +507 -507
  13. package/src/cli/og-image-worker.js +20 -20
  14. package/src/cli/og-images.js +70 -70
  15. package/src/cli/page-list-watch.js +69 -69
  16. package/src/cli/run-astro.js +97 -97
  17. package/src/cli/run-pagefind.js +154 -154
  18. package/src/cli/write-mcp-files.js +103 -103
  19. package/src/cli/write-redirects-file.js +158 -158
  20. package/src/components/ApiReferencePanel.astro +1792 -1792
  21. package/src/components/AppIcon.astro +51 -51
  22. package/src/components/Card.astro +193 -193
  23. package/src/components/CodeGroup.astro +63 -39
  24. package/src/components/CopyPageMenu.astro +374 -374
  25. package/src/components/Hint.astro +188 -188
  26. package/src/components/Icon.astro +72 -72
  27. package/src/components/Image.astro +165 -165
  28. package/src/components/Tile.astro +67 -67
  29. package/src/components/Video.astro +137 -137
  30. package/src/content.config.ts +203 -203
  31. package/src/layout/BaseLayout.astro +908 -908
  32. package/src/layout/components/AnalyticsScripts.astro +49 -49
  33. package/src/layout/components/Breadcrumbs.astro +98 -98
  34. package/src/layout/components/ConsentBanner.astro +119 -119
  35. package/src/layout/components/MobileMenu.astro +225 -225
  36. package/src/layout/components/NavTree.astro +408 -408
  37. package/src/layout/components/Sidebar.astro +232 -232
  38. package/src/layout/components/SiteFooter.astro +87 -87
  39. package/src/layout/components/TopBar.astro +386 -386
  40. package/src/layout/styles/base.css +332 -326
  41. package/src/layout/styles/mobile-menu.css +285 -285
  42. package/src/lib/agent-markdown.js +164 -164
  43. package/src/lib/asset-dimensions.js +89 -89
  44. package/src/lib/base-path.js +90 -90
  45. package/src/lib/cli-report.js +22 -22
  46. package/src/lib/code-line-numbers.js +13 -0
  47. package/src/lib/config-schema.ts +2509 -2509
  48. package/src/lib/config.ts +1316 -1316
  49. package/src/lib/consent.js +108 -108
  50. package/src/lib/content-store-reload-integration.js +101 -101
  51. package/src/lib/icon-data-dev.js +53 -53
  52. package/src/lib/image-size.js +152 -152
  53. package/src/lib/json-schema-descriptions.js +228 -228
  54. package/src/lib/link-check.js +544 -544
  55. package/src/lib/llms-index.ts +90 -90
  56. package/src/lib/mcp-dev-integration.js +65 -65
  57. package/src/lib/mcp-index.ts +102 -102
  58. package/src/lib/mintlify-convert.js +605 -605
  59. package/src/lib/moved-api-pages.js +49 -49
  60. package/src/lib/og-cards.js +33 -33
  61. package/src/lib/og-image.js +235 -235
  62. package/src/lib/openapi-dev-status.js +80 -80
  63. package/src/lib/openapi-reload-integration.js +193 -193
  64. package/src/lib/pages.js +312 -312
  65. package/src/lib/project-files-integration.js +116 -116
  66. package/src/lib/project-files.js +137 -137
  67. package/src/lib/rehype-base-path.js +62 -62
  68. package/src/lib/rehype-image-loading.js +71 -71
  69. package/src/lib/robots-txt.js +21 -21
  70. package/src/lib/search-scope.js +44 -44
  71. package/src/lib/selector-placement.js +50 -50
  72. package/src/lib/seo-tags.js +155 -155
  73. package/src/lib/shiki-code-block.js +7 -1
  74. package/src/lib/site-base.ts +27 -27
  75. package/src/lib/styles-asset-integration.js +291 -291
  76. package/src/lib/wdignore-cases.json +195 -195
  77. package/src/lib/wdignore.js +177 -177
  78. package/src/pages/404.astro +63 -63
  79. package/src/pages/[...slug].astro +1762 -1608
  80. package/src/pages/[...slug].md.ts +93 -93
  81. package/src/pages/llms-full.txt.ts +88 -88
  82. package/src/pages/og/[...slug].png.ts +63 -63
  83. package/src/scripts/mobile-menu.ts +80 -80
  84. package/src/scripts/search.ts +245 -245
  85. package/src/scripts/sidebar-scroll.ts +61 -61
  86. package/src/styles/global.css +40 -40
@@ -1,408 +1,408 @@
1
- ---
2
- import { navTreeContainsSlug, isExternalHref, type NavTreeNode } from "../../lib/config";
3
- import AppIcon from "../../components/AppIcon.astro";
4
- import { methodClass } from "../../lib/openapi-render";
5
- import { siteHref } from '../../lib/site-base';
6
-
7
- interface Props {
8
- nodes: NavTreeNode[];
9
- hrefForSlug: (slug: string) => string;
10
- currentSlug: string;
11
- depth?: number;
12
- }
13
-
14
- const { nodes, hrefForSlug, currentSlug, depth = 0 } = Astro.props as Props;
15
-
16
- // The <style> below is global, not scoped: a scoped one puts a
17
- // data-astro-cid-* attribute on every <li>, <a> and <span> here - four per
18
- // item, 24 bytes each - and the tree is on every page, in full. With a long
19
- // OpenAPI section that was 30% of each page's HTML. Every selector in it
20
- // starts from a wd-nav-* class, which nothing else on a page uses.
21
- //
22
- // Without the scope, a selector is (0,1,0) less specific per part, so two
23
- // rules with a different number of parts can trade places. One pair did:
24
- // `.wd-nav-list a.active` came to outweigh `.wd-nav-group
25
- // .wd-nav-section-title a` - hence the font-weight there. A new rule has to be
26
- // weighed against the others with nothing but its own selectors to count.
27
- ---
28
-
29
- <ul class={`wd-nav-list wd-nav-depth-${depth}`}>
30
- {
31
- nodes.map((node) => {
32
- if (node.kind === "page") {
33
- return (
34
- <li>
35
- <a href={siteHref(hrefForSlug(node.slug))} class={node.slug === currentSlug ? "active" : ""}>
36
- {node.method && (
37
- <span class={`wd-nav-method wd-nav-method-${methodClass(node.method)}`}>{node.method}</span>
38
- )}
39
- {node.icon && <AppIcon icon={node.icon} class="wd-nav-page-icon" />}
40
- <span class="wd-nav-title">{node.title}</span>
41
- {node.deprecated && <span class="wd-nav-tag wd-nav-tag-deprecated">Deprecated</span>}
42
- {node.tag && <span class="wd-nav-tag">{node.tag}</span>}
43
- </a>
44
- </li>
45
- );
46
- }
47
-
48
- if (node.kind === "link") {
49
- // A bare external link sitting directly in the page tree (see
50
- // NavItem's `{ label, href }` leaf in lib/config.ts) - styled like
51
- // a page row, but never "active" (it's not a content page) and
52
- // always opens in a new tab since it's meant to point off-site.
53
- const external = isExternalHref(node.href);
54
- return (
55
- <li>
56
- <a
57
- href={siteHref(node.href)}
58
- class="wd-nav-link-leaf"
59
- target={external ? "_blank" : undefined}
60
- rel={external ? "noopener noreferrer" : undefined}
61
- >
62
- <span>{node.label}</span>
63
- {external && (
64
- <svg class="wd-nav-external-icon" width="10" height="10" viewBox="0 0 10 10" aria-hidden="true">
65
- <path
66
- d="M3 1.5H8.5V7M8.5 1.5L1.5 8.5"
67
- stroke="currentColor"
68
- stroke-width="1.2"
69
- fill="none"
70
- stroke-linecap="round"
71
- stroke-linejoin="round"
72
- />
73
- </svg>
74
- )}
75
- </a>
76
- </li>
77
- );
78
- }
79
-
80
- if (depth === 0) {
81
- // Top-level group = a static sidebar section title, never a
82
- // disclosure control - matches the reference design where the first
83
- // group level is just a bold label above its pages.
84
- return (
85
- <li class="wd-nav-group">
86
- <div class="wd-nav-section-title">
87
- {node.pageSlug ? (
88
- <a href={siteHref(hrefForSlug(node.pageSlug))} class={node.pageSlug === currentSlug ? "active" : ""}>
89
- {node.label}
90
- </a>
91
- ) : (
92
- node.label
93
- )}
94
- </div>
95
- <Astro.self nodes={node.children} hrefForSlug={hrefForSlug} currentSlug={currentSlug} depth={depth + 1} />
96
- </li>
97
- );
98
- }
99
-
100
- // Depth >= 1: a nested group renders as a collapsible row, styled and
101
- // inset exactly like a sibling page link, with a chevron on the
102
- // right. Defaults open whenever the active page lives anywhere inside
103
- // it (itself or a descendant), so landing on a child page never
104
- // leaves its own parent collapsed.
105
- const isActive = node.pageSlug === currentSlug;
106
- const open = isActive || navTreeContainsSlug(node.children, currentSlug);
107
- return (
108
- <li class="wd-nav-collapsible">
109
- <details open={open}>
110
- <summary class={isActive ? "active" : ""}>
111
- {node.pageSlug ? (
112
- <a href={siteHref(hrefForSlug(node.pageSlug))} class={isActive ? "active" : ""}>
113
- {node.label}
114
- </a>
115
- ) : (
116
- <span class="wd-nav-group-label">{node.label}</span>
117
- )}
118
- <svg class="wd-nav-chevron" width="10" height="10" viewBox="0 0 10 10" aria-hidden="true">
119
- <path
120
- d="M3.5 2L6.5 5L3.5 8"
121
- stroke="currentColor"
122
- stroke-width="1.4"
123
- fill="none"
124
- stroke-linecap="round"
125
- stroke-linejoin="round"
126
- />
127
- </svg>
128
- </summary>
129
- <Astro.self nodes={node.children} hrefForSlug={hrefForSlug} currentSlug={currentSlug} depth={depth + 1} />
130
- </details>
131
- </li>
132
- );
133
- })
134
- }
135
- </ul>
136
-
137
- <style is:global>
138
- .wd-nav-list {
139
- list-style: none;
140
- margin: 0;
141
- padding: 0;
142
- }
143
-
144
- .wd-nav-list li a,
145
- .wd-nav-list li summary {
146
- border-left: 1px solid transparent;
147
- }
148
-
149
- .wd-nav-list li a:not(summary a):hover,
150
- .wd-nav-list li summary:hover {
151
- border-left: 1px solid var(--wd-primary);
152
- }
153
-
154
- .wd-nav-list li a.active:not(summary a),
155
- .wd-nav-list li summary.active {
156
- border-left: 1px solid var(--wd-primary);
157
- }
158
-
159
- .wd-nav-depth-0 {
160
- margin-bottom: 1.25rem;
161
- }
162
- /* Space between a top-level group and whatever sits next to it - another
163
- group, or a page outside any group - so each group reads as its own
164
- block. */
165
- .wd-nav-depth-0 > .wd-nav-group + li,
166
- .wd-nav-depth-0 > li + .wd-nav-group {
167
- margin-top: 2rem;
168
- }
169
- .wd-nav-section-title {
170
- padding: 0;
171
- margin-bottom: 0.4rem;
172
- color: var(--wd-nav-title);
173
- font-size: 0.75rem;
174
- font-weight: 600;
175
- text-transform: uppercase;
176
- letter-spacing: 0.04em;
177
- }
178
- /* Overrides `.wd-nav-list a`'s own block/padding/font-size/pill-when-
179
- active styling further below - without this, a group-with-a-page's
180
- title (e.g. "Concepts" linking to its own overview page) inherits
181
- the same big rounded background pill a regular page row gets when
182
- active, which looks completely out of place sitting next to a
183
- plain-text sibling title like "Getting Started". A linked section
184
- title should still read as a section title - same size/weight/
185
- case/color as an unlinked one - just tinted primary on hover/active
186
- instead. The extra `.wd-nav-group` ancestor qualifier (2 classes)
187
- is load-bearing, not decoration: `.wd-nav-section-title a` alone
188
- has the exact same specificity as `.wd-nav-list a` (1 class + 1
189
- type each), so whichever rule happens to sit later in the
190
- stylesheet would silently win regardless of intent - this avoids
191
- that tie entirely. Mirrors the same "override to neutral, re-apply
192
- only color" pattern already used for .wd-nav-collapsible summary a
193
- below (which sidesteps the same tie via a `summary` type selector
194
- instead). */
195
- .wd-nav-group .wd-nav-section-title a {
196
- display: inline;
197
- padding: 0;
198
- border-radius: 0;
199
- background: none;
200
- color: inherit;
201
- font-size: inherit;
202
- font-weight: inherit;
203
- text-decoration: none;
204
- }
205
- .wd-nav-group .wd-nav-section-title a.active,
206
- .wd-nav-group .wd-nav-section-title a:hover {
207
- background: none;
208
- color: var(--wd-primary);
209
- /* The title's own weight, not `.wd-nav-list a.active`'s 500 - which
210
- ties with the rule above on specificity, and comes later. */
211
- font-weight: inherit;
212
- }
213
- .wd-nav-depth-1,
214
- .wd-nav-depth-2,
215
- .wd-nav-depth-3 {
216
- margin-bottom: 0.5rem;
217
- border-left: 1px solid var(--wd-border);
218
- }
219
-
220
- .wd-nav-depth-2,
221
- .wd-nav-depth-3 {
222
- margin-bottom: 0.5rem;
223
- margin-left: 0.75rem;
224
- border-left: 1px solid var(--wd-border);
225
- }
226
- .wd-nav-list a {
227
- display: flex;
228
- align-items: center;
229
- gap: 0.45rem;
230
- padding: 0.2rem 0.75rem;
231
- margin: 0.1rem 0;
232
- border-radius: 0 0.4rem 0.4rem 0;
233
- text-decoration: none;
234
- color: var(--wd-nav-text);
235
- font-size: 0.9rem;
236
- }
237
- /* Primary-tinted rather than a neutral surface gray - a faint preview
238
- of the active pill's own color (12% alpha), at half its strength, so
239
- hover reads as "this could become active" instead of a generic
240
- hover state shared with every other clickable thing on the page. */
241
- .wd-nav-list a:hover {
242
- background: color-mix(in srgb, var(--wd-primary) 6%, transparent);
243
- color: var(--wd-nav-title);
244
- }
245
- .wd-nav-list a.active {
246
- background: color-mix(in srgb, var(--wd-primary) 12%, transparent);
247
- color: var(--wd-primary);
248
- font-weight: 500;
249
- }
250
- .wd-nav-title {
251
- flex: 1;
252
- min-width: 0;
253
- overflow: hidden;
254
- /* text-overflow: ellipsis;
255
- white-space: nowrap; */
256
- }
257
- /* A page's own frontmatter `icon` (Mintlify's), which AppIcon.astro
258
- renders as an svg or a span. */
259
- svg.wd-nav-page-icon,
260
- span.wd-nav-page-icon {
261
- flex-shrink: 0;
262
- width: 1em;
263
- height: 1em;
264
- }
265
- span.wd-nav-page-icon {
266
- display: flex;
267
- align-items: center;
268
- justify-content: center;
269
- }
270
- /* Frontmatter `tag` / `deprecated` - a small pill after the title, same
271
- shape as the method badge. */
272
- .wd-nav-tag {
273
- flex-shrink: 0;
274
- padding: 0.05rem 0.4rem;
275
- border-radius: 999px;
276
- font-size: 0.62rem;
277
- font-weight: 700;
278
- line-height: 1.5;
279
- letter-spacing: 0.02em;
280
- color: var(--wd-primary);
281
- background: color-mix(in srgb, var(--wd-primary) 12%, transparent);
282
- }
283
- .wd-nav-tag-deprecated {
284
- color: #d97706;
285
- background: color-mix(in srgb, #d97706 15%, transparent);
286
- }
287
- .wd-nav-method {
288
- flex-shrink: 0;
289
- display: inline-block;
290
- padding: 0.05rem 0.4rem;
291
- border-radius: 0.3rem;
292
- font-size: 0.62rem;
293
- font-weight: 700;
294
- letter-spacing: 0.02em;
295
- line-height: 1.5;
296
- }
297
- .wd-nav-method-get {
298
- background: color-mix(in srgb, #16a34a 15%, transparent);
299
- color: #16a34a;
300
- }
301
- .wd-nav-method-post {
302
- background: color-mix(in srgb, #2563eb 15%, transparent);
303
- color: #2563eb;
304
- }
305
- .wd-nav-method-put {
306
- background: color-mix(in srgb, #9333ea 15%, transparent);
307
- color: #9333ea;
308
- }
309
- .wd-nav-method-patch {
310
- background: color-mix(in srgb, #d97706 15%, transparent);
311
- color: #d97706;
312
- }
313
- .wd-nav-method-delete {
314
- background: color-mix(in srgb, #dc2626 15%, transparent);
315
- color: #dc2626;
316
- }
317
- .wd-nav-method-other {
318
- background: var(--wd-surface);
319
- color: var(--wd-text-muted);
320
- }
321
- .wd-nav-link-leaf {
322
- display: flex !important;
323
- align-items: center;
324
- justify-content: space-between;
325
- gap: 0.5rem;
326
- }
327
- .wd-nav-external-icon {
328
- flex-shrink: 0;
329
- color: var(--wd-text-muted);
330
- }
331
-
332
- /* Depth >= 1 group: a collapsible row that looks like a page link. */
333
- .wd-nav-collapsible details {
334
- margin: 0;
335
- }
336
- .wd-nav-collapsible summary {
337
- display: flex;
338
- align-items: center;
339
- justify-content: space-between;
340
- gap: 0.5rem;
341
- padding: 0.2rem 0.75rem;
342
- margin: 0.1rem 0;
343
- border-radius: 0 0.4rem 0.4rem 0;
344
- cursor: pointer;
345
- color: var(--wd-nav-text);
346
- font-size: 0.9rem;
347
- list-style: none;
348
- }
349
- .wd-nav-collapsible summary::-webkit-details-marker {
350
- display: none;
351
- }
352
- .wd-nav-collapsible summary::marker {
353
- content: "";
354
- }
355
- /* Same primary-tinted hover as a plain page link above. */
356
- .wd-nav-collapsible summary:hover {
357
- background: color-mix(in srgb, var(--wd-primary) 6%, transparent);
358
- color: var(--wd-nav-title);
359
- }
360
- /* When the group's own attached page is the current page, the pill
361
- background lives on <summary> itself (not the inner <a> below,
362
- which is deliberately stripped of its own background/padding so the
363
- chevron can share the row) - otherwise only the label text would be
364
- highlighted, leaving the chevron sitting outside the pill. This is
365
- the same background/radius a plain `.wd-nav-list a.active` pill
366
- uses, so an active group header looks identical to an active leaf
367
- page row instead of falling back to text-only bold+color. */
368
- .wd-nav-collapsible summary.active {
369
- background: color-mix(in srgb, var(--wd-primary) 12%, transparent);
370
- border-left: 1px solid var(--wd-primary);
371
- }
372
-
373
- .wd-nav-collapsible summary.active > a {
374
- border-left: none;
375
- }
376
- /* Overrides `.wd-nav-list a`'s own block/padding - the row's padding is
377
- owned by <summary> now, the label inside is just flex content. Wins
378
- on specificity (class + 2 tags vs class + 1 tag) regardless of
379
- source order. */
380
- .wd-nav-collapsible summary a,
381
- .wd-nav-collapsible summary .wd-nav-group-label {
382
- display: block;
383
- padding: 0;
384
- border-radius: 0;
385
- background: none;
386
- color: inherit;
387
- font-weight: inherit;
388
- flex: 1;
389
- min-width: 0;
390
- }
391
- .wd-nav-collapsible summary a:hover {
392
- background: none;
393
- color: var(--wd-nav-title);
394
- }
395
- .wd-nav-collapsible summary a.active {
396
- background: none;
397
- color: var(--wd-primary);
398
- font-weight: 500;
399
- }
400
- .wd-nav-chevron {
401
- flex-shrink: 0;
402
- color: var(--wd-text-muted);
403
- transition: transform 0.15s ease;
404
- }
405
- .wd-nav-collapsible details[open] > summary .wd-nav-chevron {
406
- transform: rotate(90deg);
407
- }
408
- </style>
1
+ ---
2
+ import { navTreeContainsSlug, isExternalHref, type NavTreeNode } from "../../lib/config";
3
+ import AppIcon from "../../components/AppIcon.astro";
4
+ import { methodClass } from "../../lib/openapi-render";
5
+ import { siteHref } from '../../lib/site-base';
6
+
7
+ interface Props {
8
+ nodes: NavTreeNode[];
9
+ hrefForSlug: (slug: string) => string;
10
+ currentSlug: string;
11
+ depth?: number;
12
+ }
13
+
14
+ const { nodes, hrefForSlug, currentSlug, depth = 0 } = Astro.props as Props;
15
+
16
+ // The <style> below is global, not scoped: a scoped one puts a
17
+ // data-astro-cid-* attribute on every <li>, <a> and <span> here - four per
18
+ // item, 24 bytes each - and the tree is on every page, in full. With a long
19
+ // OpenAPI section that was 30% of each page's HTML. Every selector in it
20
+ // starts from a wd-nav-* class, which nothing else on a page uses.
21
+ //
22
+ // Without the scope, a selector is (0,1,0) less specific per part, so two
23
+ // rules with a different number of parts can trade places. One pair did:
24
+ // `.wd-nav-list a.active` came to outweigh `.wd-nav-group
25
+ // .wd-nav-section-title a` - hence the font-weight there. A new rule has to be
26
+ // weighed against the others with nothing but its own selectors to count.
27
+ ---
28
+
29
+ <ul class={`wd-nav-list wd-nav-depth-${depth}`}>
30
+ {
31
+ nodes.map((node) => {
32
+ if (node.kind === "page") {
33
+ return (
34
+ <li>
35
+ <a href={siteHref(hrefForSlug(node.slug))} class={node.slug === currentSlug ? "active" : ""}>
36
+ {node.method && (
37
+ <span class={`wd-nav-method wd-nav-method-${methodClass(node.method)}`}>{node.method}</span>
38
+ )}
39
+ {node.icon && <AppIcon icon={node.icon} class="wd-nav-page-icon" />}
40
+ <span class="wd-nav-title">{node.title}</span>
41
+ {node.deprecated && <span class="wd-nav-tag wd-nav-tag-deprecated">Deprecated</span>}
42
+ {node.tag && <span class="wd-nav-tag">{node.tag}</span>}
43
+ </a>
44
+ </li>
45
+ );
46
+ }
47
+
48
+ if (node.kind === "link") {
49
+ // A bare external link sitting directly in the page tree (see
50
+ // NavItem's `{ label, href }` leaf in lib/config.ts) - styled like
51
+ // a page row, but never "active" (it's not a content page) and
52
+ // always opens in a new tab since it's meant to point off-site.
53
+ const external = isExternalHref(node.href);
54
+ return (
55
+ <li>
56
+ <a
57
+ href={siteHref(node.href)}
58
+ class="wd-nav-link-leaf"
59
+ target={external ? "_blank" : undefined}
60
+ rel={external ? "noopener noreferrer" : undefined}
61
+ >
62
+ <span>{node.label}</span>
63
+ {external && (
64
+ <svg class="wd-nav-external-icon" width="10" height="10" viewBox="0 0 10 10" aria-hidden="true">
65
+ <path
66
+ d="M3 1.5H8.5V7M8.5 1.5L1.5 8.5"
67
+ stroke="currentColor"
68
+ stroke-width="1.2"
69
+ fill="none"
70
+ stroke-linecap="round"
71
+ stroke-linejoin="round"
72
+ />
73
+ </svg>
74
+ )}
75
+ </a>
76
+ </li>
77
+ );
78
+ }
79
+
80
+ if (depth === 0) {
81
+ // Top-level group = a static sidebar section title, never a
82
+ // disclosure control - matches the reference design where the first
83
+ // group level is just a bold label above its pages.
84
+ return (
85
+ <li class="wd-nav-group">
86
+ <div class="wd-nav-section-title">
87
+ {node.pageSlug ? (
88
+ <a href={siteHref(hrefForSlug(node.pageSlug))} class={node.pageSlug === currentSlug ? "active" : ""}>
89
+ {node.label}
90
+ </a>
91
+ ) : (
92
+ node.label
93
+ )}
94
+ </div>
95
+ <Astro.self nodes={node.children} hrefForSlug={hrefForSlug} currentSlug={currentSlug} depth={depth + 1} />
96
+ </li>
97
+ );
98
+ }
99
+
100
+ // Depth >= 1: a nested group renders as a collapsible row, styled and
101
+ // inset exactly like a sibling page link, with a chevron on the
102
+ // right. Defaults open whenever the active page lives anywhere inside
103
+ // it (itself or a descendant), so landing on a child page never
104
+ // leaves its own parent collapsed.
105
+ const isActive = node.pageSlug === currentSlug;
106
+ const open = isActive || navTreeContainsSlug(node.children, currentSlug);
107
+ return (
108
+ <li class="wd-nav-collapsible">
109
+ <details open={open}>
110
+ <summary class={isActive ? "active" : ""}>
111
+ {node.pageSlug ? (
112
+ <a href={siteHref(hrefForSlug(node.pageSlug))} class={isActive ? "active" : ""}>
113
+ {node.label}
114
+ </a>
115
+ ) : (
116
+ <span class="wd-nav-group-label">{node.label}</span>
117
+ )}
118
+ <svg class="wd-nav-chevron" width="10" height="10" viewBox="0 0 10 10" aria-hidden="true">
119
+ <path
120
+ d="M3.5 2L6.5 5L3.5 8"
121
+ stroke="currentColor"
122
+ stroke-width="1.4"
123
+ fill="none"
124
+ stroke-linecap="round"
125
+ stroke-linejoin="round"
126
+ />
127
+ </svg>
128
+ </summary>
129
+ <Astro.self nodes={node.children} hrefForSlug={hrefForSlug} currentSlug={currentSlug} depth={depth + 1} />
130
+ </details>
131
+ </li>
132
+ );
133
+ })
134
+ }
135
+ </ul>
136
+
137
+ <style is:global>
138
+ .wd-nav-list {
139
+ list-style: none;
140
+ margin: 0;
141
+ padding: 0;
142
+ }
143
+
144
+ .wd-nav-list li a,
145
+ .wd-nav-list li summary {
146
+ border-left: 1px solid transparent;
147
+ }
148
+
149
+ .wd-nav-list li a:not(summary a):hover,
150
+ .wd-nav-list li summary:hover {
151
+ border-left: 1px solid var(--wd-primary);
152
+ }
153
+
154
+ .wd-nav-list li a.active:not(summary a),
155
+ .wd-nav-list li summary.active {
156
+ border-left: 1px solid var(--wd-primary);
157
+ }
158
+
159
+ .wd-nav-depth-0 {
160
+ margin-bottom: 1.25rem;
161
+ }
162
+ /* Space between a top-level group and whatever sits next to it - another
163
+ group, or a page outside any group - so each group reads as its own
164
+ block. */
165
+ .wd-nav-depth-0 > .wd-nav-group + li,
166
+ .wd-nav-depth-0 > li + .wd-nav-group {
167
+ margin-top: 2rem;
168
+ }
169
+ .wd-nav-section-title {
170
+ padding: 0;
171
+ margin-bottom: 0.4rem;
172
+ color: var(--wd-nav-title);
173
+ font-size: 0.75rem;
174
+ font-weight: 600;
175
+ text-transform: uppercase;
176
+ letter-spacing: 0.04em;
177
+ }
178
+ /* Overrides `.wd-nav-list a`'s own block/padding/font-size/pill-when-
179
+ active styling further below - without this, a group-with-a-page's
180
+ title (e.g. "Concepts" linking to its own overview page) inherits
181
+ the same big rounded background pill a regular page row gets when
182
+ active, which looks completely out of place sitting next to a
183
+ plain-text sibling title like "Getting Started". A linked section
184
+ title should still read as a section title - same size/weight/
185
+ case/color as an unlinked one - just tinted primary on hover/active
186
+ instead. The extra `.wd-nav-group` ancestor qualifier (2 classes)
187
+ is load-bearing, not decoration: `.wd-nav-section-title a` alone
188
+ has the exact same specificity as `.wd-nav-list a` (1 class + 1
189
+ type each), so whichever rule happens to sit later in the
190
+ stylesheet would silently win regardless of intent - this avoids
191
+ that tie entirely. Mirrors the same "override to neutral, re-apply
192
+ only color" pattern already used for .wd-nav-collapsible summary a
193
+ below (which sidesteps the same tie via a `summary` type selector
194
+ instead). */
195
+ .wd-nav-group .wd-nav-section-title a {
196
+ display: inline;
197
+ padding: 0;
198
+ border-radius: 0;
199
+ background: none;
200
+ color: inherit;
201
+ font-size: inherit;
202
+ font-weight: inherit;
203
+ text-decoration: none;
204
+ }
205
+ .wd-nav-group .wd-nav-section-title a.active,
206
+ .wd-nav-group .wd-nav-section-title a:hover {
207
+ background: none;
208
+ color: var(--wd-primary);
209
+ /* The title's own weight, not `.wd-nav-list a.active`'s 500 - which
210
+ ties with the rule above on specificity, and comes later. */
211
+ font-weight: inherit;
212
+ }
213
+ .wd-nav-depth-1,
214
+ .wd-nav-depth-2,
215
+ .wd-nav-depth-3 {
216
+ margin-bottom: 0.5rem;
217
+ border-left: 1px solid var(--wd-border);
218
+ }
219
+
220
+ .wd-nav-depth-2,
221
+ .wd-nav-depth-3 {
222
+ margin-bottom: 0.5rem;
223
+ margin-left: 0.75rem;
224
+ border-left: 1px solid var(--wd-border);
225
+ }
226
+ .wd-nav-list a {
227
+ display: flex;
228
+ align-items: center;
229
+ gap: 0.45rem;
230
+ padding: 0.2rem 0.75rem;
231
+ margin: 0.1rem 0;
232
+ border-radius: 0 0.4rem 0.4rem 0;
233
+ text-decoration: none;
234
+ color: var(--wd-nav-text);
235
+ font-size: 0.9rem;
236
+ }
237
+ /* Primary-tinted rather than a neutral surface gray - a faint preview
238
+ of the active pill's own color (12% alpha), at half its strength, so
239
+ hover reads as "this could become active" instead of a generic
240
+ hover state shared with every other clickable thing on the page. */
241
+ .wd-nav-list a:hover {
242
+ background: color-mix(in srgb, var(--wd-primary) 6%, transparent);
243
+ color: var(--wd-nav-title);
244
+ }
245
+ .wd-nav-list a.active {
246
+ background: color-mix(in srgb, var(--wd-primary) 12%, transparent);
247
+ color: var(--wd-primary);
248
+ font-weight: 500;
249
+ }
250
+ .wd-nav-title {
251
+ flex: 1;
252
+ min-width: 0;
253
+ overflow: hidden;
254
+ /* text-overflow: ellipsis;
255
+ white-space: nowrap; */
256
+ }
257
+ /* A page's own frontmatter `icon` (Mintlify's), which AppIcon.astro
258
+ renders as an svg or a span. */
259
+ svg.wd-nav-page-icon,
260
+ span.wd-nav-page-icon {
261
+ flex-shrink: 0;
262
+ width: 1em;
263
+ height: 1em;
264
+ }
265
+ span.wd-nav-page-icon {
266
+ display: flex;
267
+ align-items: center;
268
+ justify-content: center;
269
+ }
270
+ /* Frontmatter `tag` / `deprecated` - a small pill after the title, same
271
+ shape as the method badge. */
272
+ .wd-nav-tag {
273
+ flex-shrink: 0;
274
+ padding: 0.05rem 0.4rem;
275
+ border-radius: 999px;
276
+ font-size: 0.62rem;
277
+ font-weight: 700;
278
+ line-height: 1.5;
279
+ letter-spacing: 0.02em;
280
+ color: var(--wd-primary);
281
+ background: color-mix(in srgb, var(--wd-primary) 12%, transparent);
282
+ }
283
+ .wd-nav-tag-deprecated {
284
+ color: #d97706;
285
+ background: color-mix(in srgb, #d97706 15%, transparent);
286
+ }
287
+ .wd-nav-method {
288
+ flex-shrink: 0;
289
+ display: inline-block;
290
+ padding: 0.05rem 0.4rem;
291
+ border-radius: 0.3rem;
292
+ font-size: 0.62rem;
293
+ font-weight: 700;
294
+ letter-spacing: 0.02em;
295
+ line-height: 1.5;
296
+ }
297
+ .wd-nav-method-get {
298
+ background: color-mix(in srgb, #16a34a 15%, transparent);
299
+ color: #16a34a;
300
+ }
301
+ .wd-nav-method-post {
302
+ background: color-mix(in srgb, #2563eb 15%, transparent);
303
+ color: #2563eb;
304
+ }
305
+ .wd-nav-method-put {
306
+ background: color-mix(in srgb, #9333ea 15%, transparent);
307
+ color: #9333ea;
308
+ }
309
+ .wd-nav-method-patch {
310
+ background: color-mix(in srgb, #d97706 15%, transparent);
311
+ color: #d97706;
312
+ }
313
+ .wd-nav-method-delete {
314
+ background: color-mix(in srgb, #dc2626 15%, transparent);
315
+ color: #dc2626;
316
+ }
317
+ .wd-nav-method-other {
318
+ background: var(--wd-surface);
319
+ color: var(--wd-text-muted);
320
+ }
321
+ .wd-nav-link-leaf {
322
+ display: flex !important;
323
+ align-items: center;
324
+ justify-content: space-between;
325
+ gap: 0.5rem;
326
+ }
327
+ .wd-nav-external-icon {
328
+ flex-shrink: 0;
329
+ color: var(--wd-text-muted);
330
+ }
331
+
332
+ /* Depth >= 1 group: a collapsible row that looks like a page link. */
333
+ .wd-nav-collapsible details {
334
+ margin: 0;
335
+ }
336
+ .wd-nav-collapsible summary {
337
+ display: flex;
338
+ align-items: center;
339
+ justify-content: space-between;
340
+ gap: 0.5rem;
341
+ padding: 0.2rem 0.75rem;
342
+ margin: 0.1rem 0;
343
+ border-radius: 0 0.4rem 0.4rem 0;
344
+ cursor: pointer;
345
+ color: var(--wd-nav-text);
346
+ font-size: 0.9rem;
347
+ list-style: none;
348
+ }
349
+ .wd-nav-collapsible summary::-webkit-details-marker {
350
+ display: none;
351
+ }
352
+ .wd-nav-collapsible summary::marker {
353
+ content: "";
354
+ }
355
+ /* Same primary-tinted hover as a plain page link above. */
356
+ .wd-nav-collapsible summary:hover {
357
+ background: color-mix(in srgb, var(--wd-primary) 6%, transparent);
358
+ color: var(--wd-nav-title);
359
+ }
360
+ /* When the group's own attached page is the current page, the pill
361
+ background lives on <summary> itself (not the inner <a> below,
362
+ which is deliberately stripped of its own background/padding so the
363
+ chevron can share the row) - otherwise only the label text would be
364
+ highlighted, leaving the chevron sitting outside the pill. This is
365
+ the same background/radius a plain `.wd-nav-list a.active` pill
366
+ uses, so an active group header looks identical to an active leaf
367
+ page row instead of falling back to text-only bold+color. */
368
+ .wd-nav-collapsible summary.active {
369
+ background: color-mix(in srgb, var(--wd-primary) 12%, transparent);
370
+ border-left: 1px solid var(--wd-primary);
371
+ }
372
+
373
+ .wd-nav-collapsible summary.active > a {
374
+ border-left: none;
375
+ }
376
+ /* Overrides `.wd-nav-list a`'s own block/padding - the row's padding is
377
+ owned by <summary> now, the label inside is just flex content. Wins
378
+ on specificity (class + 2 tags vs class + 1 tag) regardless of
379
+ source order. */
380
+ .wd-nav-collapsible summary a,
381
+ .wd-nav-collapsible summary .wd-nav-group-label {
382
+ display: block;
383
+ padding: 0;
384
+ border-radius: 0;
385
+ background: none;
386
+ color: inherit;
387
+ font-weight: inherit;
388
+ flex: 1;
389
+ min-width: 0;
390
+ }
391
+ .wd-nav-collapsible summary a:hover {
392
+ background: none;
393
+ color: var(--wd-nav-title);
394
+ }
395
+ .wd-nav-collapsible summary a.active {
396
+ background: none;
397
+ color: var(--wd-primary);
398
+ font-weight: 500;
399
+ }
400
+ .wd-nav-chevron {
401
+ flex-shrink: 0;
402
+ color: var(--wd-text-muted);
403
+ transition: transform 0.15s ease;
404
+ }
405
+ .wd-nav-collapsible details[open] > summary .wd-nav-chevron {
406
+ transform: rotate(90deg);
407
+ }
408
+ </style>