@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.
- package/README.md +28 -28
- package/astro.config.mjs +645 -645
- package/bin/writedocs.js +356 -356
- package/package.json +99 -99
- package/src/cli/base-path-layout.js +44 -44
- package/src/cli/build-auth.js +135 -135
- package/src/cli/build.js +203 -203
- package/src/cli/check-built-styles.js +41 -41
- package/src/cli/convert.js +124 -124
- package/src/cli/dev.js +268 -268
- package/src/cli/exit-when-flushed.js +42 -42
- package/src/cli/generate-api-pages.js +507 -507
- package/src/cli/og-image-worker.js +20 -20
- package/src/cli/og-images.js +70 -70
- package/src/cli/page-list-watch.js +69 -69
- package/src/cli/run-astro.js +97 -97
- package/src/cli/run-pagefind.js +154 -154
- package/src/cli/write-mcp-files.js +103 -103
- package/src/cli/write-redirects-file.js +158 -158
- package/src/components/ApiReferencePanel.astro +1792 -1792
- package/src/components/AppIcon.astro +51 -51
- package/src/components/Card.astro +193 -193
- package/src/components/CodeGroup.astro +63 -39
- package/src/components/CopyPageMenu.astro +374 -374
- package/src/components/Hint.astro +188 -188
- package/src/components/Icon.astro +72 -72
- package/src/components/Image.astro +165 -165
- package/src/components/Tile.astro +67 -67
- package/src/components/Video.astro +137 -137
- package/src/content.config.ts +203 -203
- package/src/layout/BaseLayout.astro +908 -908
- package/src/layout/components/AnalyticsScripts.astro +49 -49
- package/src/layout/components/Breadcrumbs.astro +98 -98
- package/src/layout/components/ConsentBanner.astro +119 -119
- package/src/layout/components/MobileMenu.astro +225 -225
- package/src/layout/components/NavTree.astro +408 -408
- package/src/layout/components/Sidebar.astro +232 -232
- package/src/layout/components/SiteFooter.astro +87 -87
- package/src/layout/components/TopBar.astro +386 -386
- package/src/layout/styles/base.css +332 -326
- package/src/layout/styles/mobile-menu.css +285 -285
- package/src/lib/agent-markdown.js +164 -164
- package/src/lib/asset-dimensions.js +89 -89
- package/src/lib/base-path.js +90 -90
- package/src/lib/cli-report.js +22 -22
- package/src/lib/code-line-numbers.js +13 -0
- package/src/lib/config-schema.ts +2509 -2509
- package/src/lib/config.ts +1316 -1316
- package/src/lib/consent.js +108 -108
- package/src/lib/content-store-reload-integration.js +101 -101
- package/src/lib/icon-data-dev.js +53 -53
- package/src/lib/image-size.js +152 -152
- package/src/lib/json-schema-descriptions.js +228 -228
- package/src/lib/link-check.js +544 -544
- package/src/lib/llms-index.ts +90 -90
- package/src/lib/mcp-dev-integration.js +65 -65
- package/src/lib/mcp-index.ts +102 -102
- package/src/lib/mintlify-convert.js +605 -605
- package/src/lib/moved-api-pages.js +49 -49
- package/src/lib/og-cards.js +33 -33
- package/src/lib/og-image.js +235 -235
- package/src/lib/openapi-dev-status.js +80 -80
- package/src/lib/openapi-reload-integration.js +193 -193
- package/src/lib/pages.js +312 -312
- package/src/lib/project-files-integration.js +116 -116
- package/src/lib/project-files.js +137 -137
- package/src/lib/rehype-base-path.js +62 -62
- package/src/lib/rehype-image-loading.js +71 -71
- package/src/lib/robots-txt.js +21 -21
- package/src/lib/search-scope.js +44 -44
- package/src/lib/selector-placement.js +50 -50
- package/src/lib/seo-tags.js +155 -155
- package/src/lib/shiki-code-block.js +7 -1
- package/src/lib/site-base.ts +27 -27
- package/src/lib/styles-asset-integration.js +291 -291
- package/src/lib/wdignore-cases.json +195 -195
- package/src/lib/wdignore.js +177 -177
- package/src/pages/404.astro +63 -63
- package/src/pages/[...slug].astro +1762 -1608
- package/src/pages/[...slug].md.ts +93 -93
- package/src/pages/llms-full.txt.ts +88 -88
- package/src/pages/og/[...slug].png.ts +63 -63
- package/src/scripts/mobile-menu.ts +80 -80
- package/src/scripts/search.ts +245 -245
- package/src/scripts/sidebar-scroll.ts +61 -61
- package/src/styles/global.css +40 -40
|
@@ -1,1608 +1,1762 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { getCollection, render, type CollectionEntry } from "astro:content";
|
|
3
|
-
import fs from "node:fs";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import {
|
|
6
|
-
loadDocsConfig,
|
|
7
|
-
resolveSections,
|
|
8
|
-
resolveGlobalDropdowns,
|
|
9
|
-
findSectionIndexForSlug,
|
|
10
|
-
buildNavTree,
|
|
11
|
-
ancestorGroupsForSlug,
|
|
12
|
-
buildSelectors,
|
|
13
|
-
buildGlobalDropdowns,
|
|
14
|
-
fileIdForEntry,
|
|
15
|
-
normalizeEntryId,
|
|
16
|
-
flattenNav,
|
|
17
|
-
firstSlugOfNavigation,
|
|
18
|
-
mergeSeo,
|
|
19
|
-
contextMenuOptions,
|
|
20
|
-
resolveSiteUrl,
|
|
21
|
-
findAllPages,
|
|
22
|
-
resolveLandings,
|
|
23
|
-
landingSelectors,
|
|
24
|
-
} from "../lib/config";
|
|
25
|
-
import { writedocsTempDir } from "../lib/writedocs-temp-dir.js";
|
|
26
|
-
import { throwIfOpenApiProblem } from "../lib/openapi-dev-status.js";
|
|
27
|
-
import { parseOpenApiRef } from "../lib/openapi-ref.js";
|
|
28
|
-
import { languageAlternates } from "../lib/item-pages.js";
|
|
29
|
-
import { wantsGeneratedCard, ogImagePath } from "../lib/og-image.js";
|
|
30
|
-
import BaseLayout from "../layout/BaseLayout.astro";
|
|
31
|
-
import Sidebar from "../layout/components/Sidebar.astro";
|
|
32
|
-
import TableOfContents from "../layout/components/TableOfContents.astro";
|
|
33
|
-
import Breadcrumbs from "../layout/components/Breadcrumbs.astro";
|
|
34
|
-
import CopyPageMenu from "../components/CopyPageMenu.astro";
|
|
35
|
-
import Callout from "../components/Callout.astro";
|
|
36
|
-
import Note from "../components/Note.astro";
|
|
37
|
-
import Info from "../components/Info.astro";
|
|
38
|
-
import Tip from "../components/Tip.astro";
|
|
39
|
-
import Warning from "../components/Warning.astro";
|
|
40
|
-
import Danger from "../components/Danger.astro";
|
|
41
|
-
import Card from "../components/Card.astro";
|
|
42
|
-
import CardGroup from "../components/CardGroup.astro";
|
|
43
|
-
import Tabs from "../components/Tabs.astro";
|
|
44
|
-
import Tab from "../components/Tab.astro";
|
|
45
|
-
import CodeGroup from "../components/CodeGroup.astro";
|
|
46
|
-
import Accordion from "../components/Accordion.astro";
|
|
47
|
-
import AccordionGroup from "../components/AccordionGroup.astro";
|
|
48
|
-
import Steps from "../components/Steps.astro";
|
|
49
|
-
import Step from "../components/Step.astro";
|
|
50
|
-
import Hint from "../components/Hint.astro";
|
|
51
|
-
import Image from "../components/Image.astro";
|
|
52
|
-
import Frame from "../components/Frame.astro";
|
|
53
|
-
import Video from "../components/Video.astro";
|
|
54
|
-
import Parameter from "../components/Parameter.astro";
|
|
55
|
-
import Expandable from "../components/Expandable.astro";
|
|
56
|
-
import Searchbar from "../components/Searchbar.astro";
|
|
57
|
-
import Badge from "../components/Badge.astro";
|
|
58
|
-
import Icon from "../components/Icon.astro";
|
|
59
|
-
import RequestExample from "../components/RequestExample.astro";
|
|
60
|
-
import ResponseExample from "../components/ResponseExample.astro";
|
|
61
|
-
import Check from "../components/Check.astro";
|
|
62
|
-
import ParamField from "../components/ParamField.astro";
|
|
63
|
-
import ResponseField from "../components/ResponseField.astro";
|
|
64
|
-
import Columns from "../components/Columns.astro";
|
|
65
|
-
import Column from "../components/Column.astro";
|
|
66
|
-
import CodeBlock from "../components/CodeBlock.astro";
|
|
67
|
-
import Tooltip from "../components/Tooltip.astro";
|
|
68
|
-
import Update from "../components/Update.astro";
|
|
69
|
-
import Tile from "../components/Tile.astro";
|
|
70
|
-
import Panel from "../components/Panel.astro";
|
|
71
|
-
import Prompt from "../components/Prompt.astro";
|
|
72
|
-
import View from "../components/View.astro";
|
|
73
|
-
import Visibility from "../components/Visibility.astro";
|
|
74
|
-
import { Tree, FileTree, Color, GitHub } from "../components/compound";
|
|
75
|
-
import ApiPlayground from "../components/ApiPlayground.astro";
|
|
76
|
-
import ApiReferencePanel from "../components/ApiReferencePanel.astro";
|
|
77
|
-
import { searchScope, sectionTrail, ALL_SCOPES } from "../lib/search-scope.js";
|
|
78
|
-
import { selectorPlacements } from "../lib/selector-placement.js";
|
|
79
|
-
import { spaceOf } from "../lib/hidden-sections.js";
|
|
80
|
-
import { navigationPageOrder } from "../lib/pages.js";
|
|
81
|
-
import { folderRedirects } from "../lib/folder-redirects.js";
|
|
82
|
-
import { oncePerBuild } from "../lib/build-memo.js";
|
|
83
|
-
// writedocs.json's `basePath` - the addresses below stay site addresses
|
|
84
|
-
// ("/guides/a/"); the base goes in where one is written (lib/site-base.ts).
|
|
85
|
-
import { siteHref } from "../lib/site-base";
|
|
86
|
-
|
|
87
|
-
// A page is hand-written (the `pages` collection, sourced from anywhere
|
|
88
|
-
// in the project - docs/ has no special status, see findAllPages() in
|
|
89
|
-
// lib/config.ts) or an auto-generated OpenAPI stub (the `generatedDocs`
|
|
90
|
-
// collection, sourced from writedocsTempDir()'s generated-docs/
|
|
91
|
-
// directory - see content.config.ts / generate-api-pages.js) - kept as two separate
|
|
92
|
-
// collections rather than one, since Astro's loader API has no supported
|
|
93
|
-
// way to point a single collection's glob() at more than one base
|
|
94
|
-
// directory without one's own cleanup pass deleting the other's entries
|
|
95
|
-
// (see content.config.ts's own comment on this). Both share the exact
|
|
96
|
-
// same schema, so every consumer below just treats them as one combined
|
|
97
|
-
// list.
|
|
98
|
-
//
|
|
99
|
-
// The two `getCollection()` calls below are inlined at each of their two
|
|
100
|
-
// call sites (getStaticPaths, and the component body further down)
|
|
101
|
-
// rather than factored into one shared top-level helper: Astro's
|
|
102
|
-
// getStaticPaths extraction (a separate bundling pass from the rest of
|
|
103
|
-
// the component - see the pathDescription comment further down for
|
|
104
|
-
// another instance of this) was observed to silently drop a top-level
|
|
105
|
-
// function declaration referenced from inside getStaticPaths, producing
|
|
106
|
-
// a raw "getAllDocsEntries is not defined" ReferenceError at build time
|
|
107
|
-
// instead of ever running. Keeping both call sites self-contained avoids
|
|
108
|
-
// relying on whatever static-analysis pass decides what counts as
|
|
109
|
-
// "used" by the extracted chunk.
|
|
110
|
-
//
|
|
111
|
-
// Each site also only calls getCollection('generatedDocs') when there's
|
|
112
|
-
// actually something in it (most sites have no OpenAPI groups - see
|
|
113
|
-
// generate-api-pages.js), rather than unconditionally calling it and
|
|
114
|
-
// letting content.config.ts's skipIfMissing() loader no-op internally:
|
|
115
|
-
// astro:content's own getCollection() logs "The collection ... does not
|
|
116
|
-
// exist or is empty" to the console whenever a collection ends up with
|
|
117
|
-
// zero registered entries, regardless of *why* it's empty - the data
|
|
118
|
-
// store has no supported way to mark a collection as "intentionally
|
|
119
|
-
// empty" short of writing at least one entry to it. Not calling
|
|
120
|
-
// getCollection() at all for an empty one sidesteps that warning at the
|
|
121
|
-
// source instead of trying to suppress it after the fact.
|
|
122
|
-
type DocsEntry = CollectionEntry<"pages"> | CollectionEntry<"generatedDocs">;
|
|
123
|
-
|
|
124
|
-
export async function getStaticPaths() {
|
|
125
|
-
const contentDir = process.env.WRITEDOCS_CONTENT_DIR || process.cwd();
|
|
126
|
-
const packageRoot = process.env.WRITEDOCS_PACKAGE_ROOT || process.cwd();
|
|
127
|
-
const config = loadDocsConfig(contentDir);
|
|
128
|
-
const sections = resolveSections(config.navigation);
|
|
129
|
-
const hasGeneratedDocs = fs.existsSync(path.join(writedocsTempDir(contentDir), "generated-docs"));
|
|
130
|
-
const hasPages = findAllPages(contentDir).length > 0;
|
|
131
|
-
const [pagesEntries, generatedDocsEntries] = await Promise.all([
|
|
132
|
-
hasPages ? getCollection("pages") : Promise.resolve([]),
|
|
133
|
-
hasGeneratedDocs ? getCollection("generatedDocs") : Promise.resolve([]),
|
|
134
|
-
]);
|
|
135
|
-
const entries: DocsEntry[] = [...pagesEntries, ...generatedDocsEntries];
|
|
136
|
-
// writedocs.json always references a page by its file id; `entry.id` is
|
|
137
|
-
// Astro's own resolved slug for it (the file-path default, or a
|
|
138
|
-
// frontmatter `slug` override it recognizes natively - see
|
|
139
|
-
// fileIdForEntry() in lib/config.ts) and is what the page is actually
|
|
140
|
-
// routed at. Keyed by file id so every navEntry.slug below finds its
|
|
141
|
-
// entry regardless of which one is in play.
|
|
142
|
-
const entryByFileId = new Map(entries.map((e) => [fileIdForEntry(contentDir, packageRoot, e), e]));
|
|
143
|
-
|
|
144
|
-
// "/" is only produced below when some page's *resolved* slug
|
|
145
|
-
// (entry.id) is literally "index" - the conventional home page (an
|
|
146
|
-
// index.mdx at the project root; a root-level index.mdx keeps file id
|
|
147
|
-
// "index" verbatim, since Astro's own default id computation only
|
|
148
|
-
// strips a trailing `/index` *segment*, which a single-segment root
|
|
149
|
-
// file doesn't have - see fileIdForEntry()'s own comment on this in
|
|
150
|
-
// lib/config.ts), or any page overriding its own slug to "index"/"/".
|
|
151
|
-
// Most navigations don't have such a page - Astro then warns "no
|
|
152
|
-
// matching static path was found for /" on every request. Rather than
|
|
153
|
-
// requiring every writedocs.json to name a page "index", synthesize a
|
|
154
|
-
// redirect-only route for "/" pointing at the site's first real page
|
|
155
|
-
// whenever nothing already claims root.
|
|
156
|
-
// Checked against every entry, not just nav-referenced ones - a hidden
|
|
157
|
-
// page (see hiddenRoutes below) sitting at "index" claims root exactly
|
|
158
|
-
// as well as a nav-listed one would, and needs to suppress the synthetic
|
|
159
|
-
// redirect below the same way (two routes both wanting `params.slug:
|
|
160
|
-
// undefined` is a build error, not a silent pick-one).
|
|
161
|
-
const rootAlreadyClaimed = entries.some((e) => normalizeEntryId(e.id) === "index");
|
|
162
|
-
const firstSlug = rootAlreadyClaimed ? null : firstSlugOfNavigation(config.navigation);
|
|
163
|
-
const firstEntry = firstSlug ? entryByFileId.get(firstSlug) : undefined;
|
|
164
|
-
// Not calling the top-level hrefForSlug() here: it's only otherwise
|
|
165
|
-
// referenced from the component body, not from inside getStaticPaths,
|
|
166
|
-
// and per the describeSectionPath lesson above, closures introduced
|
|
167
|
-
// into getStaticPaths should be self-contained rather than assume a
|
|
168
|
-
// module-level binding survives Astro's bundling extraction. firstEntry
|
|
169
|
-
// can never resolve to "index" here (that's exactly what
|
|
170
|
-
// rootAlreadyClaimed rules out), so the ternary below always resolves
|
|
171
|
-
// to the non-root branch.
|
|
172
|
-
const rootRedirect = firstEntry
|
|
173
|
-
? [{ params: { slug: undefined }, props: { redirectTo: `/${normalizeEntryId(firstEntry.id)}/`, temporary: true } }]
|
|
174
|
-
: [];
|
|
175
|
-
|
|
176
|
-
// Tracks every file id a nav-driven route below already claims, so
|
|
177
|
-
// hiddenRoutes (further down) knows which entries are left over - any
|
|
178
|
-
// page/generatedDocs entry that exists (findAllPages() already required
|
|
179
|
-
// it to have frontmatter with a `title` - see content.config.ts's
|
|
180
|
-
// docsSchema) but isn't reachable by walking writedocs.json's navigation at
|
|
181
|
-
// all. Those still get routed here, just without a nav-derived
|
|
182
|
-
// prev/next or section - a page doesn't have to be in the sidebar to be
|
|
183
|
-
// a real, directly-linkable page (an in-progress draft, an unlisted
|
|
184
|
-
// landing page, etc.).
|
|
185
|
-
const claimedFileIds = new Set<string>();
|
|
186
|
-
|
|
187
|
-
const pageRoutes = sections.flatMap((section, sectionIndex) => {
|
|
188
|
-
const flatNav = flattenNav(section.pages);
|
|
189
|
-
// Prev/next skip pages that aren't in the sidebar (frontmatter
|
|
190
|
-
// `hidden`) or aren't pages at all (frontmatter `url`, an external
|
|
191
|
-
// link) - the reader should land on the next page they could also
|
|
192
|
-
// have clicked in the sidebar. Inlined for the same reason as the
|
|
193
|
-
// error branch below.
|
|
194
|
-
const isPaginationStop = (slug: string) => {
|
|
195
|
-
const data = entryByFileId.get(slug)?.data;
|
|
196
|
-
return Boolean(data) && !data!.hidden && !data!.url;
|
|
197
|
-
};
|
|
198
|
-
return flatNav.map((navEntry, i) => {
|
|
199
|
-
const entry = entryByFileId.get(navEntry.slug);
|
|
200
|
-
if (!entry) {
|
|
201
|
-
// Inlined rather than a separate top-level helper: Astro's
|
|
202
|
-
// getStaticPaths extraction (a separate bundling pass from the
|
|
203
|
-
// rest of the component) was observed to silently drop a
|
|
204
|
-
// top-level function declaration that's only referenced inside
|
|
205
|
-
// this rarely-taken branch, producing a raw "X is not defined"
|
|
206
|
-
// ReferenceError instead of this readable message. Keeping the
|
|
207
|
-
// logic inside getStaticPaths' own closure avoids relying on
|
|
208
|
-
// whatever static-analysis pass decides what counts as "used".
|
|
209
|
-
const pathDescription =
|
|
210
|
-
section.path.length === 0
|
|
211
|
-
? "(root)"
|
|
212
|
-
: section.path
|
|
213
|
-
.map((seg) => {
|
|
214
|
-
const item = seg.items[seg.index] as Record<string, unknown>;
|
|
215
|
-
const name = (item.tab ?? item.version ?? item.language ?? item.dropdown ?? item.product) as string;
|
|
216
|
-
return `${seg.kind} "${name}"`;
|
|
217
|
-
})
|
|
218
|
-
.join(" > ");
|
|
219
|
-
throw new Error(
|
|
220
|
-
`[writedocs] writedocs.json references page "${navEntry.slug}"` +
|
|
221
|
-
` (${pathDescription})` +
|
|
222
|
-
` but no matching file was found`,
|
|
223
|
-
);
|
|
224
|
-
}
|
|
225
|
-
claimedFileIds.add(navEntry.slug);
|
|
226
|
-
const prev = flatNav.slice(0, i).findLast((e) => isPaginationStop(e.slug)) ?? null;
|
|
227
|
-
const next = flatNav.slice(i + 1).find((e) => isPaginationStop(e.slug)) ?? null;
|
|
228
|
-
const urlSlug = normalizeEntryId(entry.id);
|
|
229
|
-
// A frontmatter `url` page (Mintlify's external link) exists only
|
|
230
|
-
// to put that link in the sidebar - its own URL redirects there.
|
|
231
|
-
if (entry.data.url) {
|
|
232
|
-
return {
|
|
233
|
-
params: { slug: urlSlug === "index" ? undefined : urlSlug },
|
|
234
|
-
props: { redirectTo: entry.data.url },
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
return {
|
|
238
|
-
params: { slug: urlSlug === "index" ? undefined : urlSlug },
|
|
239
|
-
props: { entry, prev, next, sectionIndex },
|
|
240
|
-
};
|
|
241
|
-
});
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
// An item's own page (a tab's, a dropdown's, ... `page` - resolveLandings()
|
|
245
|
-
// in lib/config.ts) that no sidebar lists: shown inside its item. One the
|
|
246
|
-
// sidebar does list was routed above, in its sidebar. Its Next is the
|
|
247
|
-
// item's first sidebar page, if the item has a sidebar of its own.
|
|
248
|
-
const landings = resolveLandings(config.navigation);
|
|
249
|
-
const landingRoutes = landings.flatMap((landing, landingIndex) => {
|
|
250
|
-
if (claimedFileIds.has(landing.slug)) return [];
|
|
251
|
-
const entry = entryByFileId.get(landing.slug);
|
|
252
|
-
if (!entry) {
|
|
253
|
-
const last = landing.path[landing.path.length - 1];
|
|
254
|
-
const item = landing.item as Record<string, unknown>;
|
|
255
|
-
const name = (item.tab ?? item.version ?? item.language ?? item.dropdown ?? item.product) as string;
|
|
256
|
-
throw new Error(
|
|
257
|
-
`[writedocs] writedocs.json's ${last.kind} "${name}" names page "${landing.slug}" as its own page,` +
|
|
258
|
-
` but no matching file was found`,
|
|
259
|
-
);
|
|
260
|
-
}
|
|
261
|
-
claimedFileIds.add(landing.slug);
|
|
262
|
-
const next =
|
|
263
|
-
flattenNav(landing.pages).find((e) => {
|
|
264
|
-
const data = entryByFileId.get(e.slug)?.data;
|
|
265
|
-
return Boolean(data) && !data!.hidden && !data!.url;
|
|
266
|
-
}) ?? null;
|
|
267
|
-
const urlSlug = normalizeEntryId(entry.id);
|
|
268
|
-
if (entry.data.url) {
|
|
269
|
-
return [{ params: { slug: urlSlug === "index" ? undefined : urlSlug }, props: { redirectTo: entry.data.url } }];
|
|
270
|
-
}
|
|
271
|
-
return [
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
//
|
|
277
|
-
//
|
|
278
|
-
//
|
|
279
|
-
//
|
|
280
|
-
//
|
|
281
|
-
//
|
|
282
|
-
//
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
//
|
|
302
|
-
//
|
|
303
|
-
// navigation
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
//
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
const
|
|
324
|
-
...
|
|
325
|
-
...
|
|
326
|
-
]
|
|
327
|
-
const
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
//
|
|
359
|
-
//
|
|
360
|
-
//
|
|
361
|
-
//
|
|
362
|
-
//
|
|
363
|
-
//
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
//
|
|
379
|
-
//
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
const
|
|
392
|
-
const
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
//
|
|
398
|
-
|
|
399
|
-
//
|
|
400
|
-
// `
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
const
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
//
|
|
420
|
-
//
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
const
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
const
|
|
440
|
-
const
|
|
441
|
-
//
|
|
442
|
-
//
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
//
|
|
453
|
-
const
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
const
|
|
463
|
-
|
|
464
|
-
//
|
|
465
|
-
//
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
const
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
//
|
|
473
|
-
//
|
|
474
|
-
//
|
|
475
|
-
//
|
|
476
|
-
const
|
|
477
|
-
//
|
|
478
|
-
//
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
//
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
//
|
|
486
|
-
//
|
|
487
|
-
const
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
//
|
|
499
|
-
//
|
|
500
|
-
//
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
// A page
|
|
506
|
-
//
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
//
|
|
510
|
-
|
|
511
|
-
const
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
const
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
//
|
|
528
|
-
//
|
|
529
|
-
//
|
|
530
|
-
//
|
|
531
|
-
//
|
|
532
|
-
//
|
|
533
|
-
|
|
534
|
-
//
|
|
535
|
-
//
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
//
|
|
539
|
-
//
|
|
540
|
-
const
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
//
|
|
547
|
-
// the
|
|
548
|
-
const
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
//
|
|
555
|
-
//
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
//
|
|
559
|
-
//
|
|
560
|
-
//
|
|
561
|
-
//
|
|
562
|
-
//
|
|
563
|
-
//
|
|
564
|
-
//
|
|
565
|
-
//
|
|
566
|
-
//
|
|
567
|
-
//
|
|
568
|
-
|
|
569
|
-
const
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
<
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
//
|
|
801
|
-
//
|
|
802
|
-
//
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
//
|
|
806
|
-
//
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
if (
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
}
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
const
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
.wd-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
.wd-
|
|
1143
|
-
display: flex;
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
}
|
|
1150
|
-
.wd-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
}
|
|
1164
|
-
/*
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
}
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
/*
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
}
|
|
1227
|
-
.wd-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
margin:
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
}
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
}
|
|
1395
|
-
/*
|
|
1396
|
-
button
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
}
|
|
1420
|
-
/*
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
}
|
|
1447
|
-
.
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
background:
|
|
1464
|
-
opacity:
|
|
1465
|
-
}
|
|
1466
|
-
.
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
.
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
.wd-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
}
|
|
1608
|
-
|
|
1
|
+
---
|
|
2
|
+
import { getCollection, render, type CollectionEntry } from "astro:content";
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import {
|
|
6
|
+
loadDocsConfig,
|
|
7
|
+
resolveSections,
|
|
8
|
+
resolveGlobalDropdowns,
|
|
9
|
+
findSectionIndexForSlug,
|
|
10
|
+
buildNavTree,
|
|
11
|
+
ancestorGroupsForSlug,
|
|
12
|
+
buildSelectors,
|
|
13
|
+
buildGlobalDropdowns,
|
|
14
|
+
fileIdForEntry,
|
|
15
|
+
normalizeEntryId,
|
|
16
|
+
flattenNav,
|
|
17
|
+
firstSlugOfNavigation,
|
|
18
|
+
mergeSeo,
|
|
19
|
+
contextMenuOptions,
|
|
20
|
+
resolveSiteUrl,
|
|
21
|
+
findAllPages,
|
|
22
|
+
resolveLandings,
|
|
23
|
+
landingSelectors,
|
|
24
|
+
} from "../lib/config";
|
|
25
|
+
import { writedocsTempDir } from "../lib/writedocs-temp-dir.js";
|
|
26
|
+
import { throwIfOpenApiProblem } from "../lib/openapi-dev-status.js";
|
|
27
|
+
import { parseOpenApiRef } from "../lib/openapi-ref.js";
|
|
28
|
+
import { languageAlternates } from "../lib/item-pages.js";
|
|
29
|
+
import { wantsGeneratedCard, ogImagePath } from "../lib/og-image.js";
|
|
30
|
+
import BaseLayout from "../layout/BaseLayout.astro";
|
|
31
|
+
import Sidebar from "../layout/components/Sidebar.astro";
|
|
32
|
+
import TableOfContents from "../layout/components/TableOfContents.astro";
|
|
33
|
+
import Breadcrumbs from "../layout/components/Breadcrumbs.astro";
|
|
34
|
+
import CopyPageMenu from "../components/CopyPageMenu.astro";
|
|
35
|
+
import Callout from "../components/Callout.astro";
|
|
36
|
+
import Note from "../components/Note.astro";
|
|
37
|
+
import Info from "../components/Info.astro";
|
|
38
|
+
import Tip from "../components/Tip.astro";
|
|
39
|
+
import Warning from "../components/Warning.astro";
|
|
40
|
+
import Danger from "../components/Danger.astro";
|
|
41
|
+
import Card from "../components/Card.astro";
|
|
42
|
+
import CardGroup from "../components/CardGroup.astro";
|
|
43
|
+
import Tabs from "../components/Tabs.astro";
|
|
44
|
+
import Tab from "../components/Tab.astro";
|
|
45
|
+
import CodeGroup from "../components/CodeGroup.astro";
|
|
46
|
+
import Accordion from "../components/Accordion.astro";
|
|
47
|
+
import AccordionGroup from "../components/AccordionGroup.astro";
|
|
48
|
+
import Steps from "../components/Steps.astro";
|
|
49
|
+
import Step from "../components/Step.astro";
|
|
50
|
+
import Hint from "../components/Hint.astro";
|
|
51
|
+
import Image from "../components/Image.astro";
|
|
52
|
+
import Frame from "../components/Frame.astro";
|
|
53
|
+
import Video from "../components/Video.astro";
|
|
54
|
+
import Parameter from "../components/Parameter.astro";
|
|
55
|
+
import Expandable from "../components/Expandable.astro";
|
|
56
|
+
import Searchbar from "../components/Searchbar.astro";
|
|
57
|
+
import Badge from "../components/Badge.astro";
|
|
58
|
+
import Icon from "../components/Icon.astro";
|
|
59
|
+
import RequestExample from "../components/RequestExample.astro";
|
|
60
|
+
import ResponseExample from "../components/ResponseExample.astro";
|
|
61
|
+
import Check from "../components/Check.astro";
|
|
62
|
+
import ParamField from "../components/ParamField.astro";
|
|
63
|
+
import ResponseField from "../components/ResponseField.astro";
|
|
64
|
+
import Columns from "../components/Columns.astro";
|
|
65
|
+
import Column from "../components/Column.astro";
|
|
66
|
+
import CodeBlock from "../components/CodeBlock.astro";
|
|
67
|
+
import Tooltip from "../components/Tooltip.astro";
|
|
68
|
+
import Update from "../components/Update.astro";
|
|
69
|
+
import Tile from "../components/Tile.astro";
|
|
70
|
+
import Panel from "../components/Panel.astro";
|
|
71
|
+
import Prompt from "../components/Prompt.astro";
|
|
72
|
+
import View from "../components/View.astro";
|
|
73
|
+
import Visibility from "../components/Visibility.astro";
|
|
74
|
+
import { Tree, FileTree, Color, GitHub } from "../components/compound";
|
|
75
|
+
import ApiPlayground from "../components/ApiPlayground.astro";
|
|
76
|
+
import ApiReferencePanel from "../components/ApiReferencePanel.astro";
|
|
77
|
+
import { searchScope, sectionTrail, ALL_SCOPES } from "../lib/search-scope.js";
|
|
78
|
+
import { selectorPlacements } from "../lib/selector-placement.js";
|
|
79
|
+
import { spaceOf } from "../lib/hidden-sections.js";
|
|
80
|
+
import { navigationPageOrder } from "../lib/pages.js";
|
|
81
|
+
import { folderRedirects } from "../lib/folder-redirects.js";
|
|
82
|
+
import { oncePerBuild } from "../lib/build-memo.js";
|
|
83
|
+
// writedocs.json's `basePath` - the addresses below stay site addresses
|
|
84
|
+
// ("/guides/a/"); the base goes in where one is written (lib/site-base.ts).
|
|
85
|
+
import { siteHref } from "../lib/site-base";
|
|
86
|
+
|
|
87
|
+
// A page is hand-written (the `pages` collection, sourced from anywhere
|
|
88
|
+
// in the project - docs/ has no special status, see findAllPages() in
|
|
89
|
+
// lib/config.ts) or an auto-generated OpenAPI stub (the `generatedDocs`
|
|
90
|
+
// collection, sourced from writedocsTempDir()'s generated-docs/
|
|
91
|
+
// directory - see content.config.ts / generate-api-pages.js) - kept as two separate
|
|
92
|
+
// collections rather than one, since Astro's loader API has no supported
|
|
93
|
+
// way to point a single collection's glob() at more than one base
|
|
94
|
+
// directory without one's own cleanup pass deleting the other's entries
|
|
95
|
+
// (see content.config.ts's own comment on this). Both share the exact
|
|
96
|
+
// same schema, so every consumer below just treats them as one combined
|
|
97
|
+
// list.
|
|
98
|
+
//
|
|
99
|
+
// The two `getCollection()` calls below are inlined at each of their two
|
|
100
|
+
// call sites (getStaticPaths, and the component body further down)
|
|
101
|
+
// rather than factored into one shared top-level helper: Astro's
|
|
102
|
+
// getStaticPaths extraction (a separate bundling pass from the rest of
|
|
103
|
+
// the component - see the pathDescription comment further down for
|
|
104
|
+
// another instance of this) was observed to silently drop a top-level
|
|
105
|
+
// function declaration referenced from inside getStaticPaths, producing
|
|
106
|
+
// a raw "getAllDocsEntries is not defined" ReferenceError at build time
|
|
107
|
+
// instead of ever running. Keeping both call sites self-contained avoids
|
|
108
|
+
// relying on whatever static-analysis pass decides what counts as
|
|
109
|
+
// "used" by the extracted chunk.
|
|
110
|
+
//
|
|
111
|
+
// Each site also only calls getCollection('generatedDocs') when there's
|
|
112
|
+
// actually something in it (most sites have no OpenAPI groups - see
|
|
113
|
+
// generate-api-pages.js), rather than unconditionally calling it and
|
|
114
|
+
// letting content.config.ts's skipIfMissing() loader no-op internally:
|
|
115
|
+
// astro:content's own getCollection() logs "The collection ... does not
|
|
116
|
+
// exist or is empty" to the console whenever a collection ends up with
|
|
117
|
+
// zero registered entries, regardless of *why* it's empty - the data
|
|
118
|
+
// store has no supported way to mark a collection as "intentionally
|
|
119
|
+
// empty" short of writing at least one entry to it. Not calling
|
|
120
|
+
// getCollection() at all for an empty one sidesteps that warning at the
|
|
121
|
+
// source instead of trying to suppress it after the fact.
|
|
122
|
+
type DocsEntry = CollectionEntry<"pages"> | CollectionEntry<"generatedDocs">;
|
|
123
|
+
|
|
124
|
+
export async function getStaticPaths() {
|
|
125
|
+
const contentDir = process.env.WRITEDOCS_CONTENT_DIR || process.cwd();
|
|
126
|
+
const packageRoot = process.env.WRITEDOCS_PACKAGE_ROOT || process.cwd();
|
|
127
|
+
const config = loadDocsConfig(contentDir);
|
|
128
|
+
const sections = resolveSections(config.navigation);
|
|
129
|
+
const hasGeneratedDocs = fs.existsSync(path.join(writedocsTempDir(contentDir), "generated-docs"));
|
|
130
|
+
const hasPages = findAllPages(contentDir).length > 0;
|
|
131
|
+
const [pagesEntries, generatedDocsEntries] = await Promise.all([
|
|
132
|
+
hasPages ? getCollection("pages") : Promise.resolve([]),
|
|
133
|
+
hasGeneratedDocs ? getCollection("generatedDocs") : Promise.resolve([]),
|
|
134
|
+
]);
|
|
135
|
+
const entries: DocsEntry[] = [...pagesEntries, ...generatedDocsEntries];
|
|
136
|
+
// writedocs.json always references a page by its file id; `entry.id` is
|
|
137
|
+
// Astro's own resolved slug for it (the file-path default, or a
|
|
138
|
+
// frontmatter `slug` override it recognizes natively - see
|
|
139
|
+
// fileIdForEntry() in lib/config.ts) and is what the page is actually
|
|
140
|
+
// routed at. Keyed by file id so every navEntry.slug below finds its
|
|
141
|
+
// entry regardless of which one is in play.
|
|
142
|
+
const entryByFileId = new Map(entries.map((e) => [fileIdForEntry(contentDir, packageRoot, e), e]));
|
|
143
|
+
|
|
144
|
+
// "/" is only produced below when some page's *resolved* slug
|
|
145
|
+
// (entry.id) is literally "index" - the conventional home page (an
|
|
146
|
+
// index.mdx at the project root; a root-level index.mdx keeps file id
|
|
147
|
+
// "index" verbatim, since Astro's own default id computation only
|
|
148
|
+
// strips a trailing `/index` *segment*, which a single-segment root
|
|
149
|
+
// file doesn't have - see fileIdForEntry()'s own comment on this in
|
|
150
|
+
// lib/config.ts), or any page overriding its own slug to "index"/"/".
|
|
151
|
+
// Most navigations don't have such a page - Astro then warns "no
|
|
152
|
+
// matching static path was found for /" on every request. Rather than
|
|
153
|
+
// requiring every writedocs.json to name a page "index", synthesize a
|
|
154
|
+
// redirect-only route for "/" pointing at the site's first real page
|
|
155
|
+
// whenever nothing already claims root.
|
|
156
|
+
// Checked against every entry, not just nav-referenced ones - a hidden
|
|
157
|
+
// page (see hiddenRoutes below) sitting at "index" claims root exactly
|
|
158
|
+
// as well as a nav-listed one would, and needs to suppress the synthetic
|
|
159
|
+
// redirect below the same way (two routes both wanting `params.slug:
|
|
160
|
+
// undefined` is a build error, not a silent pick-one).
|
|
161
|
+
const rootAlreadyClaimed = entries.some((e) => normalizeEntryId(e.id) === "index");
|
|
162
|
+
const firstSlug = rootAlreadyClaimed ? null : firstSlugOfNavigation(config.navigation);
|
|
163
|
+
const firstEntry = firstSlug ? entryByFileId.get(firstSlug) : undefined;
|
|
164
|
+
// Not calling the top-level hrefForSlug() here: it's only otherwise
|
|
165
|
+
// referenced from the component body, not from inside getStaticPaths,
|
|
166
|
+
// and per the describeSectionPath lesson above, closures introduced
|
|
167
|
+
// into getStaticPaths should be self-contained rather than assume a
|
|
168
|
+
// module-level binding survives Astro's bundling extraction. firstEntry
|
|
169
|
+
// can never resolve to "index" here (that's exactly what
|
|
170
|
+
// rootAlreadyClaimed rules out), so the ternary below always resolves
|
|
171
|
+
// to the non-root branch.
|
|
172
|
+
const rootRedirect = firstEntry
|
|
173
|
+
? [{ params: { slug: undefined }, props: { redirectTo: `/${normalizeEntryId(firstEntry.id)}/`, temporary: true } }]
|
|
174
|
+
: [];
|
|
175
|
+
|
|
176
|
+
// Tracks every file id a nav-driven route below already claims, so
|
|
177
|
+
// hiddenRoutes (further down) knows which entries are left over - any
|
|
178
|
+
// page/generatedDocs entry that exists (findAllPages() already required
|
|
179
|
+
// it to have frontmatter with a `title` - see content.config.ts's
|
|
180
|
+
// docsSchema) but isn't reachable by walking writedocs.json's navigation at
|
|
181
|
+
// all. Those still get routed here, just without a nav-derived
|
|
182
|
+
// prev/next or section - a page doesn't have to be in the sidebar to be
|
|
183
|
+
// a real, directly-linkable page (an in-progress draft, an unlisted
|
|
184
|
+
// landing page, etc.).
|
|
185
|
+
const claimedFileIds = new Set<string>();
|
|
186
|
+
|
|
187
|
+
const pageRoutes = sections.flatMap((section, sectionIndex) => {
|
|
188
|
+
const flatNav = flattenNav(section.pages);
|
|
189
|
+
// Prev/next skip pages that aren't in the sidebar (frontmatter
|
|
190
|
+
// `hidden`) or aren't pages at all (frontmatter `url`, an external
|
|
191
|
+
// link) - the reader should land on the next page they could also
|
|
192
|
+
// have clicked in the sidebar. Inlined for the same reason as the
|
|
193
|
+
// error branch below.
|
|
194
|
+
const isPaginationStop = (slug: string) => {
|
|
195
|
+
const data = entryByFileId.get(slug)?.data;
|
|
196
|
+
return Boolean(data) && !data!.hidden && !data!.url;
|
|
197
|
+
};
|
|
198
|
+
return flatNav.map((navEntry, i) => {
|
|
199
|
+
const entry = entryByFileId.get(navEntry.slug);
|
|
200
|
+
if (!entry) {
|
|
201
|
+
// Inlined rather than a separate top-level helper: Astro's
|
|
202
|
+
// getStaticPaths extraction (a separate bundling pass from the
|
|
203
|
+
// rest of the component) was observed to silently drop a
|
|
204
|
+
// top-level function declaration that's only referenced inside
|
|
205
|
+
// this rarely-taken branch, producing a raw "X is not defined"
|
|
206
|
+
// ReferenceError instead of this readable message. Keeping the
|
|
207
|
+
// logic inside getStaticPaths' own closure avoids relying on
|
|
208
|
+
// whatever static-analysis pass decides what counts as "used".
|
|
209
|
+
const pathDescription =
|
|
210
|
+
section.path.length === 0
|
|
211
|
+
? "(root)"
|
|
212
|
+
: section.path
|
|
213
|
+
.map((seg) => {
|
|
214
|
+
const item = seg.items[seg.index] as Record<string, unknown>;
|
|
215
|
+
const name = (item.tab ?? item.version ?? item.language ?? item.dropdown ?? item.product) as string;
|
|
216
|
+
return `${seg.kind} "${name}"`;
|
|
217
|
+
})
|
|
218
|
+
.join(" > ");
|
|
219
|
+
throw new Error(
|
|
220
|
+
`[writedocs] writedocs.json references page "${navEntry.slug}"` +
|
|
221
|
+
` (${pathDescription})` +
|
|
222
|
+
` but no matching file was found`,
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
claimedFileIds.add(navEntry.slug);
|
|
226
|
+
const prev = flatNav.slice(0, i).findLast((e) => isPaginationStop(e.slug)) ?? null;
|
|
227
|
+
const next = flatNav.slice(i + 1).find((e) => isPaginationStop(e.slug)) ?? null;
|
|
228
|
+
const urlSlug = normalizeEntryId(entry.id);
|
|
229
|
+
// A frontmatter `url` page (Mintlify's external link) exists only
|
|
230
|
+
// to put that link in the sidebar - its own URL redirects there.
|
|
231
|
+
if (entry.data.url) {
|
|
232
|
+
return {
|
|
233
|
+
params: { slug: urlSlug === "index" ? undefined : urlSlug },
|
|
234
|
+
props: { redirectTo: entry.data.url },
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
return {
|
|
238
|
+
params: { slug: urlSlug === "index" ? undefined : urlSlug },
|
|
239
|
+
props: { entry, prev, next, sectionIndex },
|
|
240
|
+
};
|
|
241
|
+
});
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
// An item's own page (a tab's, a dropdown's, ... `page` - resolveLandings()
|
|
245
|
+
// in lib/config.ts) that no sidebar lists: shown inside its item. One the
|
|
246
|
+
// sidebar does list was routed above, in its sidebar. Its Next is the
|
|
247
|
+
// item's first sidebar page, if the item has a sidebar of its own.
|
|
248
|
+
const landings = resolveLandings(config.navigation);
|
|
249
|
+
const landingRoutes = landings.flatMap((landing, landingIndex) => {
|
|
250
|
+
if (claimedFileIds.has(landing.slug)) return [];
|
|
251
|
+
const entry = entryByFileId.get(landing.slug);
|
|
252
|
+
if (!entry) {
|
|
253
|
+
const last = landing.path[landing.path.length - 1];
|
|
254
|
+
const item = landing.item as Record<string, unknown>;
|
|
255
|
+
const name = (item.tab ?? item.version ?? item.language ?? item.dropdown ?? item.product) as string;
|
|
256
|
+
throw new Error(
|
|
257
|
+
`[writedocs] writedocs.json's ${last.kind} "${name}" names page "${landing.slug}" as its own page,` +
|
|
258
|
+
` but no matching file was found`,
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
claimedFileIds.add(landing.slug);
|
|
262
|
+
const next =
|
|
263
|
+
flattenNav(landing.pages).find((e) => {
|
|
264
|
+
const data = entryByFileId.get(e.slug)?.data;
|
|
265
|
+
return Boolean(data) && !data!.hidden && !data!.url;
|
|
266
|
+
}) ?? null;
|
|
267
|
+
const urlSlug = normalizeEntryId(entry.id);
|
|
268
|
+
if (entry.data.url) {
|
|
269
|
+
return [{ params: { slug: urlSlug === "index" ? undefined : urlSlug }, props: { redirectTo: entry.data.url } }];
|
|
270
|
+
}
|
|
271
|
+
return [
|
|
272
|
+
{ params: { slug: urlSlug === "index" ? undefined : urlSlug }, props: { entry, prev: null, next, landingIndex } },
|
|
273
|
+
];
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
// "Hidden" pages: any file the `pages`/`generatedDocs` collections
|
|
277
|
+
// picked up that writedocs.json's navigation never references (see
|
|
278
|
+
// claimedFileIds above) still gets a real route here - just with no
|
|
279
|
+
// prev/next (nothing in nav to derive that from) and no section of its
|
|
280
|
+
// own to be "active" in. findSectionIndexForSlug's existing "0 if this
|
|
281
|
+
// slug isn't in any section" fallback (already used nowhere else in
|
|
282
|
+
// this file, but built for exactly this) picks which section's
|
|
283
|
+
// sidebar/selectors a hidden page borrows - arbitrary, but no worse
|
|
284
|
+
// than the alternative of hidden pages having no chrome at all.
|
|
285
|
+
const hiddenRoutes = entries
|
|
286
|
+
.filter((entry) => !claimedFileIds.has(fileIdForEntry(contentDir, packageRoot, entry)))
|
|
287
|
+
.map((entry) => {
|
|
288
|
+
const urlSlug = normalizeEntryId(entry.id);
|
|
289
|
+
return {
|
|
290
|
+
params: { slug: urlSlug === "index" ? undefined : urlSlug },
|
|
291
|
+
props: {
|
|
292
|
+
entry,
|
|
293
|
+
prev: null,
|
|
294
|
+
next: null,
|
|
295
|
+
sectionIndex: findSectionIndexForSlug(sections, fileIdForEntry(contentDir, packageRoot, entry)),
|
|
296
|
+
isHidden: true,
|
|
297
|
+
},
|
|
298
|
+
};
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
// Folder addresses with pages under them but none of their own
|
|
302
|
+
// (`/docs/creator/`) redirect to the first page under them
|
|
303
|
+
// (lib/folder-redirects.js). Preferred in the reader's order: navigation
|
|
304
|
+
// order, public sections before hidden ones, pages outside the
|
|
305
|
+
// navigation last.
|
|
306
|
+
const slugOf = (route: { params: { slug?: string } }) => route.params.slug ?? "index";
|
|
307
|
+
const inHiddenSection = sections.map((section) => spaceOf(section.path) !== null);
|
|
308
|
+
const contentRoutes = pageRoutes.filter((route) => !("redirectTo" in route.props));
|
|
309
|
+
// An item's own page counts where the navigation names it: before the
|
|
310
|
+
// item's sidebar (navigationPageOrder()), so `/guides/` opens the Guides
|
|
311
|
+
// tab's own page rather than its first sidebar page.
|
|
312
|
+
type ContentRoute = {
|
|
313
|
+
params: { slug?: string };
|
|
314
|
+
props: { entry?: DocsEntry; sectionIndex?: number; landingIndex?: number };
|
|
315
|
+
};
|
|
316
|
+
const navOrder = new Map(navigationPageOrder(config.navigation).map((id, i) => [id, i]));
|
|
317
|
+
const orderOf = (route: ContentRoute) =>
|
|
318
|
+
navOrder.get(fileIdForEntry(contentDir, packageRoot, route.props.entry!)) ?? Infinity;
|
|
319
|
+
const inHiddenItem = (route: ContentRoute) =>
|
|
320
|
+
route.props.landingIndex !== undefined
|
|
321
|
+
? spaceOf(landings[route.props.landingIndex].path) !== null
|
|
322
|
+
: inHiddenSection[route.props.sectionIndex!];
|
|
323
|
+
const navContent = [
|
|
324
|
+
...contentRoutes,
|
|
325
|
+
...landingRoutes.filter((route) => !("redirectTo" in route.props)),
|
|
326
|
+
] as ContentRoute[];
|
|
327
|
+
const folderTargets = [
|
|
328
|
+
...navContent
|
|
329
|
+
.filter((route) => !inHiddenItem(route))
|
|
330
|
+
.sort((a, b) => orderOf(a) - orderOf(b))
|
|
331
|
+
.map(slugOf),
|
|
332
|
+
...navContent
|
|
333
|
+
.filter(inHiddenItem)
|
|
334
|
+
.sort((a, b) => orderOf(a) - orderOf(b))
|
|
335
|
+
.map(slugOf),
|
|
336
|
+
...hiddenRoutes.map(slugOf),
|
|
337
|
+
];
|
|
338
|
+
const takenAddresses = new Set([
|
|
339
|
+
...[...pageRoutes, ...landingRoutes, ...hiddenRoutes].map(slugOf),
|
|
340
|
+
...(config.redirects ?? []).map((r) => r.source.replace(/^\/+|\/+$/g, "")),
|
|
341
|
+
]);
|
|
342
|
+
const folderRoutes = [...folderRedirects(folderTargets, takenAddresses)].map(([folder, target]) => ({
|
|
343
|
+
params: { slug: folder },
|
|
344
|
+
props: { redirectTo: `/${target}/`, temporary: true },
|
|
345
|
+
}));
|
|
346
|
+
|
|
347
|
+
return [...rootRedirect, ...pageRoutes, ...landingRoutes, ...hiddenRoutes, ...folderRoutes];
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
interface Props {
|
|
351
|
+
redirectTo?: string;
|
|
352
|
+
// The automatic "/" and folder redirects: temporary, see below.
|
|
353
|
+
temporary?: boolean;
|
|
354
|
+
entry?: DocsEntry;
|
|
355
|
+
prev?: { slug: string; group: string | null } | null;
|
|
356
|
+
next?: { slug: string; group: string | null } | null;
|
|
357
|
+
sectionIndex?: number;
|
|
358
|
+
// Set by hiddenRoutes in getStaticPaths above - a page with no place in
|
|
359
|
+
// writedocs.json's navigation has no sidebar section of its own to show, so
|
|
360
|
+
// its default mode drops the sidebar entirely (see pageMode below)
|
|
361
|
+
// rather than borrowing findSectionIndexForSlug's arbitrary fallback
|
|
362
|
+
// section's sidebar contents, which would misleadingly suggest the page
|
|
363
|
+
// belongs there.
|
|
364
|
+
isHidden?: boolean;
|
|
365
|
+
// Set by landingRoutes in getStaticPaths above - an item's own page that
|
|
366
|
+
// no sidebar lists, shown inside that item (index into resolveLandings()).
|
|
367
|
+
landingIndex?: number;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
const rawProps = Astro.props as Props;
|
|
371
|
+
if (rawProps.redirectTo) {
|
|
372
|
+
// The automatic "/" redirect is temporary (302): its target is just the
|
|
373
|
+
// navigation's first page, and it goes away once the site has a page at
|
|
374
|
+
// "/". A 301 is remembered by the browser for good - after that, "/" kept
|
|
375
|
+
// redirecting even with a home page in place, in `writedocs dev` (every
|
|
376
|
+
// project's preview shares localhost:4321) and for returning visitors.
|
|
377
|
+
// A frontmatter `url` page stays 301. In a static build the status only
|
|
378
|
+
// picks the refresh delay of Astro's redirect page, and the build rewrites
|
|
379
|
+
// those pages to redirect at once either way (rewrite-redirect-pages.js).
|
|
380
|
+
return Astro.redirect(siteHref(rawProps.redirectTo), rawProps.temporary ? 302 : 301);
|
|
381
|
+
}
|
|
382
|
+
const {
|
|
383
|
+
entry,
|
|
384
|
+
prev = null,
|
|
385
|
+
next = null,
|
|
386
|
+
sectionIndex = 0,
|
|
387
|
+
isHidden = false,
|
|
388
|
+
landingIndex,
|
|
389
|
+
} = rawProps as Required<Props>;
|
|
390
|
+
|
|
391
|
+
const contentDir = process.env.WRITEDOCS_CONTENT_DIR || process.cwd();
|
|
392
|
+
const packageRoot = process.env.WRITEDOCS_PACKAGE_ROOT || process.cwd();
|
|
393
|
+
// `writedocs dev`, with an OpenAPI spec that stopped parsing: the error
|
|
394
|
+
// instead of the page, until it parses again (lib/openapi-dev-status.js).
|
|
395
|
+
throwIfOpenApiProblem(contentDir);
|
|
396
|
+
const config = loadDocsConfig(contentDir);
|
|
397
|
+
// Once per build, like the lookup tables further down.
|
|
398
|
+
const sections = oncePerBuild("slug:sections", () => resolveSections(config.navigation));
|
|
399
|
+
// Falls back to an empty stand-in section rather than crashing on
|
|
400
|
+
// `.pages` below - only reachable for a hidden page (see hiddenRoutes in
|
|
401
|
+
// getStaticPaths above) on a site whose writedocs.json has no navigation
|
|
402
|
+
// sections at all, which previously could never produce a route to
|
|
403
|
+
// render in the first place.
|
|
404
|
+
// An item's own page shown inside its item (landingRoutes above): the item's
|
|
405
|
+
// path, and its own sidebar if it has one.
|
|
406
|
+
const landing =
|
|
407
|
+
landingIndex === undefined
|
|
408
|
+
? undefined
|
|
409
|
+
: oncePerBuild("slug:landings", () => resolveLandings(config.navigation))[landingIndex];
|
|
410
|
+
const activeSection = landing
|
|
411
|
+
? { pages: landing.pages, path: landing.path }
|
|
412
|
+
: (sections[sectionIndex] ?? { pages: [], path: [] });
|
|
413
|
+
|
|
414
|
+
const { Content, headings } = await render(entry);
|
|
415
|
+
const tocHeadings = headings.filter((h) => h.depth === 2 || h.depth === 3);
|
|
416
|
+
|
|
417
|
+
// The lookup tables below are the same for every page, so a build makes
|
|
418
|
+
// them once (oncePerBuild(), lib/build-memo.js) - findAllPages() alone reads
|
|
419
|
+
// every page file of the project, and ran here once per page. In
|
|
420
|
+
// `writedocs dev` they're made again on every request, as before.
|
|
421
|
+
const { titleByFileId, navTitleByFileId, entryByFileId, methodByFileId } = await oncePerBuild(
|
|
422
|
+
"slug:lookups",
|
|
423
|
+
async () => {
|
|
424
|
+
const hasGeneratedDocs = fs.existsSync(path.join(writedocsTempDir(contentDir), "generated-docs"));
|
|
425
|
+
const hasPages = findAllPages(contentDir).length > 0;
|
|
426
|
+
const [pagesEntries, generatedDocsEntries] = await Promise.all([
|
|
427
|
+
hasPages ? getCollection("pages") : Promise.resolve([]),
|
|
428
|
+
hasGeneratedDocs ? getCollection("generatedDocs") : Promise.resolve([]),
|
|
429
|
+
]);
|
|
430
|
+
const entries: DocsEntry[] = [...pagesEntries, ...generatedDocsEntries];
|
|
431
|
+
// Two maps keyed by file id (not `entry.id` - see fileIdForEntry() in
|
|
432
|
+
// lib/config.ts for why those can differ once a page overrides its own
|
|
433
|
+
// slug): titles for prev/next and sidebar labels, and the entries
|
|
434
|
+
// themselves so hrefForSlug can resolve a writedocs.json file-id reference to
|
|
435
|
+
// wherever that page actually got routed.
|
|
436
|
+
const titleByFileId = new Map<string, string>();
|
|
437
|
+
// Navigation labels (sidebar, topbar dropdowns): a page's `sidebarTitle`
|
|
438
|
+
// when it has one - Mintlify's short nav label - else its `title`.
|
|
439
|
+
const navTitleByFileId = new Map<string, string>();
|
|
440
|
+
const entryByFileId = new Map<string, DocsEntry>();
|
|
441
|
+
// The HTTP method badge NavTree.astro shows next to an API operation
|
|
442
|
+
// page in the sidebar - read straight off the page's own `openapi:
|
|
443
|
+
// "METHOD /path"` frontmatter rather than the resolved operation JSON,
|
|
444
|
+
// since the method itself is right there in that string already and
|
|
445
|
+
// doesn't need a spec lookup.
|
|
446
|
+
const methodByFileId = new Map<string, string>();
|
|
447
|
+
for (const e of entries) {
|
|
448
|
+
const fileId = fileIdForEntry(contentDir, packageRoot, e);
|
|
449
|
+
titleByFileId.set(fileId, e.data.title);
|
|
450
|
+
navTitleByFileId.set(fileId, e.data.sidebarTitle ?? e.data.title);
|
|
451
|
+
entryByFileId.set(fileId, e);
|
|
452
|
+
// `hideApiMarker` (Mintlify's) drops the badge for this one page.
|
|
453
|
+
const apiRef = parseOpenApiRef(e.data.openapi);
|
|
454
|
+
if (apiRef && !e.data.hideApiMarker) {
|
|
455
|
+
methodByFileId.set(fileId, apiRef.method);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
return { titleByFileId, navTitleByFileId, entryByFileId, methodByFileId };
|
|
459
|
+
},
|
|
460
|
+
);
|
|
461
|
+
const titleForSlug = (slug: string) => titleByFileId.get(slug) ?? slug;
|
|
462
|
+
const navTitleForSlug = (slug: string) => navTitleByFileId.get(slug) ?? slug;
|
|
463
|
+
const methodForSlug = (slug: string) => methodByFileId.get(slug) ?? null;
|
|
464
|
+
// Frontmatter that changes how a page appears in navigation (hidden, url,
|
|
465
|
+
// icon, tag, deprecated) - see buildNavTree() in lib/config.ts.
|
|
466
|
+
const navMetaForSlug = (slug: string) => entryByFileId.get(slug)?.data;
|
|
467
|
+
const hrefForSlug = (slug: string) => {
|
|
468
|
+
const raw = entryByFileId.get(slug)?.id ?? slug;
|
|
469
|
+
const effective = normalizeEntryId(raw);
|
|
470
|
+
return effective === "index" ? "/" : `/${effective}/`;
|
|
471
|
+
};
|
|
472
|
+
// The current page's own file id (as writedocs.json references it) - distinct
|
|
473
|
+
// from `entry.id` (its resolved URL slug) for the same reason as above,
|
|
474
|
+
// and what every "is this the active page" comparison below needs, since
|
|
475
|
+
// navTree/globalDropdowns are built from writedocs.json's file-id space.
|
|
476
|
+
const currentFileId = fileIdForEntry(contentDir, packageRoot, entry);
|
|
477
|
+
// A section's tree doesn't depend on which of its pages is open (NavTree.astro
|
|
478
|
+
// marks the current one), so it's built once per section in a build.
|
|
479
|
+
const navTree = oncePerBuild(`slug:nav:${landingIndex === undefined ? `s${sectionIndex}` : `l${landingIndex}`}`, () =>
|
|
480
|
+
buildNavTree(activeSection.pages, navTitleForSlug, methodForSlug, navMetaForSlug),
|
|
481
|
+
);
|
|
482
|
+
// The ancestor sidebar-group trail above the auto <h1> (Breadcrumbs.astro)
|
|
483
|
+
// - empty for a page sitting at the top level of its Section with no
|
|
484
|
+
// enclosing group, in which case [...slug].astro below skips rendering
|
|
485
|
+
// the component entirely rather than showing a breadcrumb bar with
|
|
486
|
+
// nothing in it but the page's own title.
|
|
487
|
+
const breadcrumbs = ancestorGroupsForSlug(navTree, currentFileId, hrefForSlug);
|
|
488
|
+
|
|
489
|
+
// The reader's page's own position within the active Section's flattened
|
|
490
|
+
// pages list - passed to buildSelectors() so a version/language switch
|
|
491
|
+
// can try to land on the *same* page in the target option instead of
|
|
492
|
+
// always its first page (equivalentPageIn() in lib/config.ts). -1 (not
|
|
493
|
+
// found) just disables that - firstSlugOf() is still the fallback.
|
|
494
|
+
const activePagePosition = flattenNav(activeSection.pages).findIndex((e) => e.slug === currentFileId);
|
|
495
|
+
|
|
496
|
+
// One selector per level of the active page's navigation path (tabs,
|
|
497
|
+
// versions, languages, products, or a dropdown nested partway down),
|
|
498
|
+
// plus the always-visible global dropdown list - see BaseLayout.astro
|
|
499
|
+
// for how each renders.
|
|
500
|
+
// An item's own page also gets the level under the item, with nothing chosen.
|
|
501
|
+
const selectors = landing
|
|
502
|
+
? landingSelectors(landing, hrefForSlug)
|
|
503
|
+
: buildSelectors(activeSection.path, hrefForSlug, activePagePosition);
|
|
504
|
+
// <html lang>: the `language` of the navigation level this page sits under,
|
|
505
|
+
// if any. A hidden page has no level of its own (activeSection is only a
|
|
506
|
+
// fallback for its chrome), so it keeps the default.
|
|
507
|
+
// For search: the section line under this page's result (and words it can
|
|
508
|
+
// be found by), and the version/language/product it belongs to - search
|
|
509
|
+
// shows the reader's own first. A hidden page belongs to no section.
|
|
510
|
+
const pageSearchScope = isHidden ? { key: ALL_SCOPES, label: "" } : searchScope(activeSection.path);
|
|
511
|
+
const pageSectionTrail = isHidden ? "" : sectionTrail(activeSection.path, breadcrumbs);
|
|
512
|
+
// A page under a hidden navigation item searches its own index, not the
|
|
513
|
+
// site's (lib/hidden-sections.js, cli/run-pagefind.js).
|
|
514
|
+
const pageSearchSpace = isHidden ? null : spaceOf(activeSection.path);
|
|
515
|
+
const languageSegment = isHidden ? undefined : activeSection.path.find((segment) => segment.kind === "language");
|
|
516
|
+
const pageLang = languageSegment
|
|
517
|
+
? (languageSegment.items[languageSegment.index] as { language: string }).language
|
|
518
|
+
: undefined;
|
|
519
|
+
const globalDropdowns = buildGlobalDropdowns(
|
|
520
|
+
resolveGlobalDropdowns(config.navigation),
|
|
521
|
+
currentFileId,
|
|
522
|
+
navTitleForSlug,
|
|
523
|
+
hrefForSlug,
|
|
524
|
+
navMetaForSlug,
|
|
525
|
+
);
|
|
526
|
+
|
|
527
|
+
// Meta tags: this page's own frontmatter `seo` overrides writedocs.json's
|
|
528
|
+
// site-wide `seo` field by field (mergeSeo() in lib/config.ts), and the
|
|
529
|
+
// canonical/OG/Twitter URLs need this page's actual served path - reusing
|
|
530
|
+
// hrefForSlug (already built above for prev/next and the sidebar) rather
|
|
531
|
+
// than recomputing it, since it already encodes the same
|
|
532
|
+
// frontmatter-slug-override-aware routing logic.
|
|
533
|
+
const pageSeo = mergeSeo(config.seo, entry.data.seo);
|
|
534
|
+
// A page with no picture of its own for link previews gets the generated
|
|
535
|
+
// card (lib/og-image.js, served by src/pages/og/[...slug].png.ts).
|
|
536
|
+
if (wantsGeneratedCard(pageSeo, entry.data, config.seo)) pageSeo.ogImage = ogImagePath(normalizeEntryId(entry.id));
|
|
537
|
+
const currentPath = hrefForSlug(currentFileId);
|
|
538
|
+
// This page in each language, for hreflang (languageAlternates() in
|
|
539
|
+
// lib/item-pages.js) - a hidden page belongs to no language level.
|
|
540
|
+
const alternates = isHidden
|
|
541
|
+
? []
|
|
542
|
+
: languageAlternates(activeSection.path, currentFileId, activeSection.pages, landing !== undefined).map((a) => ({
|
|
543
|
+
lang: a.lang,
|
|
544
|
+
href: hrefForSlug(a.slug),
|
|
545
|
+
}));
|
|
546
|
+
// The trail for the page's structured data (lib/json-ld.js): home, the
|
|
547
|
+
// groups above the page that have a page of their own, the page.
|
|
548
|
+
const structuredTrail = [
|
|
549
|
+
{ name: config.name, href: "/" },
|
|
550
|
+
...breadcrumbs.filter((crumb) => crumb.href).map((crumb) => ({ name: crumb.label, href: crumb.href as string })),
|
|
551
|
+
...(currentPath === "/" ? [] : [{ name: entry.data.title, href: currentPath }]),
|
|
552
|
+
];
|
|
553
|
+
|
|
554
|
+
// Page mode (content.config.ts's docsSchema `mode` field, defaulted to
|
|
555
|
+
// 'default' there so this is never actually undefined) - see
|
|
556
|
+
// BaseLayout.astro for what each value strips out of the topbar/shell,
|
|
557
|
+
// and the comment on <BaseLayout mode=...> below for what this file
|
|
558
|
+
// itself controls (which slots get filled at all, and how the article
|
|
559
|
+
// itself renders).
|
|
560
|
+
// A hidden page (isHidden - see hiddenRoutes/Props above) defaults to
|
|
561
|
+
// "frame" instead of "default": it has no real section of its own, so
|
|
562
|
+
// the sidebar would otherwise show findSectionIndexForSlug's arbitrary
|
|
563
|
+
// fallback section with nothing in it actually active - "frame" drops
|
|
564
|
+
// the sidebar (and ToC) while keeping the topbar and normal article
|
|
565
|
+
// styling. Only a *default*: a hidden page's own frontmatter mode, if
|
|
566
|
+
// it set one explicitly, still wins.
|
|
567
|
+
// An item's own page with nothing for a sidebar - the item holds tabs, or
|
|
568
|
+
// versions, ... that switch elsewhere - is laid out the same way.
|
|
569
|
+
const landingWithoutSidebar =
|
|
570
|
+
landing !== undefined &&
|
|
571
|
+
flattenNav(landing.pages).length === 0 &&
|
|
572
|
+
!selectorPlacements(selectors, { sidebar: true }).includes("sidebar");
|
|
573
|
+
const pageMode = (isHidden || landingWithoutSidebar) && entry.data.mode === "default" ? "frame" : entry.data.mode;
|
|
574
|
+
const showSidebar = pageMode === "default" || pageMode === "wide";
|
|
575
|
+
// Products inside a tab or dropdown switch at the top of the sidebar, not in
|
|
576
|
+
// the top bar (lib/selector-placement.js - TopBar.astro applies the same rule).
|
|
577
|
+
const sidebarPlacements = selectorPlacements(selectors, { sidebar: showSidebar });
|
|
578
|
+
const sidebarSwitchers = selectors.filter((_, i) => sidebarPlacements[i] === "sidebar");
|
|
579
|
+
const showToc = pageMode === "default";
|
|
580
|
+
// 'custom' and 'blank' both get the bare wd-canvas treatment below (no
|
|
581
|
+
// auto <h1>, no prev/next, no prose width/padding) - they only differ in
|
|
582
|
+
// whether BaseLayout keeps the topbar, which is BaseLayout's own concern
|
|
583
|
+
// (mode is passed straight through), not something this file needs to
|
|
584
|
+
// branch on separately.
|
|
585
|
+
const isCanvasMode = pageMode === "custom" || pageMode === "blank";
|
|
586
|
+
|
|
587
|
+
// The "Copy page" menu (CopyPageMenu.astro) - on by default, with the
|
|
588
|
+
// options writedocs.json's `contextMenu` leaves on (contextMenuOptions() in
|
|
589
|
+
// lib/config-schema.ts; `false` turns it off), and only
|
|
590
|
+
// shown where there's a real auto-rendered <h1> to sit next to: canvas
|
|
591
|
+
// mode pages (custom/blank) have no such header (a hand-built landing
|
|
592
|
+
// page controls its own layout, there's nothing standard to anchor the
|
|
593
|
+
// menu to), and OpenAPI operation pages render almost entirely from the
|
|
594
|
+
// spec rather than prose - see [...slug].md.ts's own comment on why
|
|
595
|
+
// those are excluded from the .md route this menu links to in the first
|
|
596
|
+
// place, which this mirrors on the UI side.
|
|
597
|
+
const contextMenuItems = contextMenuOptions(config.contextMenu, { mcp: config.mcp });
|
|
598
|
+
const showCopyPageMenu = contextMenuItems.length > 0 && !isCanvasMode;
|
|
599
|
+
const siteUrl = resolveSiteUrl(config);
|
|
600
|
+
|
|
601
|
+
const components = {
|
|
602
|
+
Callout,
|
|
603
|
+
Note,
|
|
604
|
+
Info,
|
|
605
|
+
Tip,
|
|
606
|
+
Warning,
|
|
607
|
+
Danger,
|
|
608
|
+
Card,
|
|
609
|
+
CardGroup,
|
|
610
|
+
Tabs,
|
|
611
|
+
Tab,
|
|
612
|
+
CodeGroup,
|
|
613
|
+
Accordion,
|
|
614
|
+
AccordionGroup,
|
|
615
|
+
Steps,
|
|
616
|
+
Step,
|
|
617
|
+
Hint,
|
|
618
|
+
Image,
|
|
619
|
+
Frame,
|
|
620
|
+
Video,
|
|
621
|
+
Parameter,
|
|
622
|
+
Expandable,
|
|
623
|
+
Searchbar,
|
|
624
|
+
Badge,
|
|
625
|
+
Icon,
|
|
626
|
+
RequestExample,
|
|
627
|
+
ResponseExample,
|
|
628
|
+
Check,
|
|
629
|
+
ParamField,
|
|
630
|
+
ResponseField,
|
|
631
|
+
Columns,
|
|
632
|
+
Column,
|
|
633
|
+
CodeBlock,
|
|
634
|
+
Tooltip,
|
|
635
|
+
Update,
|
|
636
|
+
Tile,
|
|
637
|
+
Panel,
|
|
638
|
+
Prompt,
|
|
639
|
+
View,
|
|
640
|
+
Visibility,
|
|
641
|
+
Tree,
|
|
642
|
+
FileTree,
|
|
643
|
+
Color,
|
|
644
|
+
GitHub,
|
|
645
|
+
};
|
|
646
|
+
---
|
|
647
|
+
|
|
648
|
+
<BaseLayout
|
|
649
|
+
config={config}
|
|
650
|
+
title={entry.data.title}
|
|
651
|
+
description={entry.data.description}
|
|
652
|
+
path={currentPath}
|
|
653
|
+
seo={pageSeo}
|
|
654
|
+
selectors={selectors}
|
|
655
|
+
globalDropdowns={globalDropdowns}
|
|
656
|
+
mode={pageMode}
|
|
657
|
+
lang={pageLang}
|
|
658
|
+
alternates={alternates}
|
|
659
|
+
breadcrumbs={structuredTrail}
|
|
660
|
+
isApi={Boolean(entry.data.openapi)}
|
|
661
|
+
>
|
|
662
|
+
{
|
|
663
|
+
showSidebar && (
|
|
664
|
+
<Sidebar
|
|
665
|
+
slot="sidebar"
|
|
666
|
+
navTree={navTree}
|
|
667
|
+
hrefForSlug={hrefForSlug}
|
|
668
|
+
currentSlug={currentFileId}
|
|
669
|
+
switchers={sidebarSwitchers}
|
|
670
|
+
/>
|
|
671
|
+
)
|
|
672
|
+
}
|
|
673
|
+
{
|
|
674
|
+
isCanvasMode ? (
|
|
675
|
+
// 'custom' and 'blank' both get this treatment: no auto <h1>, no
|
|
676
|
+
// prev/next nav, none of .wd-article's own prose max-width/padding -
|
|
677
|
+
// just the page's own MDX/component content, edge to edge. Still gets
|
|
678
|
+
// a data-pagefind-body wrapper so a hand-built page's own text is
|
|
679
|
+
// still searchable.
|
|
680
|
+
<div class="wd-canvas" data-pagefind-body>
|
|
681
|
+
<Content components={components} />
|
|
682
|
+
{entry.data.openapi && <ApiPlayground operation={entry.data.openapi} contentDir={contentDir} />}
|
|
683
|
+
{/* After the content: a result's excerpt shows the section only when
|
|
684
|
+
that's what matched. */}
|
|
685
|
+
<div
|
|
686
|
+
hidden
|
|
687
|
+
data-markdown-ignore
|
|
688
|
+
data-wd-search-scope={pageSearchScope.key}
|
|
689
|
+
data-wd-search-scope-label={pageSearchScope.label}
|
|
690
|
+
data-wd-search-space={pageSearchSpace?.id}
|
|
691
|
+
data-wd-search-public={pageSearchSpace?.searchPublic ? "true" : undefined}
|
|
692
|
+
data-pagefind-filter={`scope:${pageSearchScope.key}`}
|
|
693
|
+
>
|
|
694
|
+
{pageSectionTrail && <span data-pagefind-meta="section">{pageSectionTrail}</span>}
|
|
695
|
+
</div>
|
|
696
|
+
</div>
|
|
697
|
+
) : (
|
|
698
|
+
<article class={`wd-article ${pageMode === "wide" ? "wd-article-wide" : ""}`} data-pagefind-body>
|
|
699
|
+
{breadcrumbs.length > 0 && <Breadcrumbs items={breadcrumbs} />}
|
|
700
|
+
<div class="wd-article-header">
|
|
701
|
+
{
|
|
702
|
+
// Frontmatter `deprecated` puts a label beside the <h1>, not in
|
|
703
|
+
// it - the <h1>'s text is the search index's page title.
|
|
704
|
+
entry.data.deprecated ? (
|
|
705
|
+
<div class="wd-article-title">
|
|
706
|
+
<h1 data-pagefind-meta="title">{entry.data.title}</h1>
|
|
707
|
+
<span class="wd-deprecated-badge">Deprecated</span>
|
|
708
|
+
</div>
|
|
709
|
+
) : (
|
|
710
|
+
<h1 data-pagefind-meta="title">{entry.data.title}</h1>
|
|
711
|
+
)
|
|
712
|
+
}
|
|
713
|
+
{showCopyPageMenu && (
|
|
714
|
+
<CopyPageMenu
|
|
715
|
+
currentPath={currentPath}
|
|
716
|
+
siteUrl={siteUrl}
|
|
717
|
+
siteName={config.name}
|
|
718
|
+
options={contextMenuItems}
|
|
719
|
+
/>
|
|
720
|
+
)}
|
|
721
|
+
</div>
|
|
722
|
+
<Content components={components} />
|
|
723
|
+
{entry.data.openapi && <ApiPlayground operation={entry.data.openapi} contentDir={contentDir} />}
|
|
724
|
+
<div
|
|
725
|
+
hidden
|
|
726
|
+
data-markdown-ignore
|
|
727
|
+
data-wd-search-scope={pageSearchScope.key}
|
|
728
|
+
data-wd-search-scope-label={pageSearchScope.label}
|
|
729
|
+
data-wd-search-space={pageSearchSpace?.id}
|
|
730
|
+
data-wd-search-public={pageSearchSpace?.searchPublic ? "true" : undefined}
|
|
731
|
+
data-pagefind-filter={`scope:${pageSearchScope.key}`}
|
|
732
|
+
>
|
|
733
|
+
{pageSectionTrail && <span data-pagefind-meta="section">{pageSectionTrail}</span>}
|
|
734
|
+
</div>
|
|
735
|
+
{!entry.data.hideFooterPagination && (
|
|
736
|
+
<nav class="wd-prevnext" data-pagefind-ignore data-markdown-ignore>
|
|
737
|
+
{prev && (
|
|
738
|
+
<a class="wd-prevnext-card wd-prevnext-prev" href={siteHref(hrefForSlug(prev.slug))}>
|
|
739
|
+
<span class="wd-prevnext-row">
|
|
740
|
+
<svg
|
|
741
|
+
class="wd-prevnext-icon"
|
|
742
|
+
width="16"
|
|
743
|
+
height="16"
|
|
744
|
+
viewBox="0 0 24 24"
|
|
745
|
+
fill="none"
|
|
746
|
+
stroke="currentColor"
|
|
747
|
+
stroke-width="2"
|
|
748
|
+
stroke-linecap="round"
|
|
749
|
+
stroke-linejoin="round"
|
|
750
|
+
aria-hidden="true"
|
|
751
|
+
>
|
|
752
|
+
<line x1="19" y1="12" x2="5" y2="12" />
|
|
753
|
+
<polyline points="12 19 5 12 12 5" />
|
|
754
|
+
</svg>
|
|
755
|
+
<span class="wd-prevnext-label">Previous</span>
|
|
756
|
+
</span>
|
|
757
|
+
<span class="wd-prevnext-title">{titleForSlug(prev.slug)}</span>
|
|
758
|
+
</a>
|
|
759
|
+
)}
|
|
760
|
+
{next && (
|
|
761
|
+
<a class="wd-prevnext-card wd-prevnext-next" href={siteHref(hrefForSlug(next.slug))}>
|
|
762
|
+
<span class="wd-prevnext-row">
|
|
763
|
+
<span class="wd-prevnext-label">Next</span>
|
|
764
|
+
<svg
|
|
765
|
+
class="wd-prevnext-icon"
|
|
766
|
+
width="16"
|
|
767
|
+
height="16"
|
|
768
|
+
viewBox="0 0 24 24"
|
|
769
|
+
fill="none"
|
|
770
|
+
stroke="currentColor"
|
|
771
|
+
stroke-width="2"
|
|
772
|
+
stroke-linecap="round"
|
|
773
|
+
stroke-linejoin="round"
|
|
774
|
+
aria-hidden="true"
|
|
775
|
+
>
|
|
776
|
+
<line x1="5" y1="12" x2="19" y2="12" />
|
|
777
|
+
<polyline points="12 5 19 12 12 19" />
|
|
778
|
+
</svg>
|
|
779
|
+
</span>
|
|
780
|
+
<span class="wd-prevnext-title">{titleForSlug(next.slug)}</span>
|
|
781
|
+
</a>
|
|
782
|
+
)}
|
|
783
|
+
</nav>
|
|
784
|
+
)}
|
|
785
|
+
</article>
|
|
786
|
+
)
|
|
787
|
+
}
|
|
788
|
+
{
|
|
789
|
+
showToc &&
|
|
790
|
+
(entry.data.openapi ? (
|
|
791
|
+
<ApiReferencePanel slot="toc" operation={entry.data.openapi} contentDir={contentDir} />
|
|
792
|
+
) : (
|
|
793
|
+
<TableOfContents slot="toc" headings={tocHeadings} />
|
|
794
|
+
))
|
|
795
|
+
}
|
|
796
|
+
</BaseLayout>
|
|
797
|
+
|
|
798
|
+
<script>
|
|
799
|
+
import { mcpServerUrl, cursorInstallLink, vscodeInstallLink } from "../lib/mcp-links.js";
|
|
800
|
+
// writedocs.json's `basePath` ("" or "/docs", astro.config.mjs) - the MCP
|
|
801
|
+
// server is at the site's root, under it. Written as `__WD_BASE__ ? ... : ...`
|
|
802
|
+
// so a site without one gets the same code as before basePath existed.
|
|
803
|
+
declare const __WD_BASE__: string;
|
|
804
|
+
|
|
805
|
+
// Astro assigns every h2-h4 an id automatically, but doesn't add a
|
|
806
|
+
// clickable anchor next to it. rehype-autolink-headings can't be used
|
|
807
|
+
// for this directly: Astro's own heading-id rehype plugin always runs
|
|
808
|
+
// AFTER any user-supplied rehypePlugins in its pipeline, so a plugin
|
|
809
|
+
// that links existing ids never sees them. Adding the anchor client-side
|
|
810
|
+
// sidesteps that ordering constraint entirely.
|
|
811
|
+
function addHeadingAnchors(root: ParentNode) {
|
|
812
|
+
root
|
|
813
|
+
.querySelectorAll<HTMLElement>(".wd-article > h2[id], .wd-article > h3[id], .wd-article > h4[id]")
|
|
814
|
+
.forEach((heading) => {
|
|
815
|
+
if (heading.querySelector(".wd-heading-anchor")) return;
|
|
816
|
+
const anchor = document.createElement("a");
|
|
817
|
+
anchor.className = "wd-heading-anchor";
|
|
818
|
+
anchor.href = `#${heading.id}`;
|
|
819
|
+
anchor.setAttribute("aria-label", "Link to this section");
|
|
820
|
+
anchor.textContent = "#";
|
|
821
|
+
heading.appendChild(anchor);
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
addHeadingAnchors(document);
|
|
825
|
+
document.addEventListener("astro:page-load", () => addHeadingAnchors(document));
|
|
826
|
+
|
|
827
|
+
// Copy-to-clipboard button for every fenced (```) code block - the
|
|
828
|
+
// button itself is emitted at build time by codeBlockTransformer
|
|
829
|
+
// (astro.config.mjs / src/lib/shiki-code-block.js), wrapping each
|
|
830
|
+
// <pre> in a .wd-code-block container; this just wires up the click
|
|
831
|
+
// behavior client-side, same dataset-guarded init pattern as
|
|
832
|
+
// addHeadingAnchors above.
|
|
833
|
+
function initCodeCopyButtons(root: ParentNode) {
|
|
834
|
+
root.querySelectorAll<HTMLButtonElement>(".wd-code-copy-btn").forEach((btn) => {
|
|
835
|
+
if (btn.dataset.wdInit) return;
|
|
836
|
+
btn.dataset.wdInit = "true";
|
|
837
|
+
btn.addEventListener("click", async () => {
|
|
838
|
+
const pre = btn.closest(".wd-code-block")?.querySelector("pre");
|
|
839
|
+
if (!pre) return;
|
|
840
|
+
try {
|
|
841
|
+
await navigator.clipboard.writeText(pre.textContent ?? "");
|
|
842
|
+
} catch {
|
|
843
|
+
return; // clipboard unavailable (e.g. insecure context) - fail silently
|
|
844
|
+
}
|
|
845
|
+
btn.textContent = "✓";
|
|
846
|
+
btn.classList.add("wd-code-copied");
|
|
847
|
+
window.setTimeout(() => {
|
|
848
|
+
btn.textContent = "⧉";
|
|
849
|
+
btn.classList.remove("wd-code-copied");
|
|
850
|
+
}, 1500);
|
|
851
|
+
});
|
|
852
|
+
});
|
|
853
|
+
}
|
|
854
|
+
initCodeCopyButtons(document);
|
|
855
|
+
document.addEventListener("astro:page-load", () => initCodeCopyButtons(document));
|
|
856
|
+
|
|
857
|
+
// Clipboard-copy button for CopyPageMenu.astro's primary "Copy page"
|
|
858
|
+
// button (the split button's left half - the right half is just a
|
|
859
|
+
// .wd-dropdown-trigger caret, handled by BaseLayout's own
|
|
860
|
+
// initDropdowns()) - same dataset-guarded init pattern as
|
|
861
|
+
// initCodeCopyButtons above, but fetches its content from the button's
|
|
862
|
+
// own data-md-path (the [...slug].md.ts route for the current page -
|
|
863
|
+
// see CopyPageMenu.astro) rather than reading it from an
|
|
864
|
+
// already-rendered element on the page, since the raw Markdown source
|
|
865
|
+
// isn't otherwise present in the DOM anywhere (the rendered HTML
|
|
866
|
+
// content is not the same text).
|
|
867
|
+
function initCopyPageMenu(root: ParentNode) {
|
|
868
|
+
root.querySelectorAll<HTMLButtonElement>("button[data-copy-page]").forEach((btn) => {
|
|
869
|
+
if (btn.dataset.wdInit) return;
|
|
870
|
+
btn.dataset.wdInit = "true";
|
|
871
|
+
const label = btn.querySelector<HTMLElement>(".wd-copy-page-primary-label");
|
|
872
|
+
const originalLabel = label?.textContent ?? "Copy page";
|
|
873
|
+
btn.addEventListener("click", async () => {
|
|
874
|
+
const mdPath = btn.dataset.mdPath;
|
|
875
|
+
if (!mdPath) return;
|
|
876
|
+
try {
|
|
877
|
+
const res = await fetch(mdPath);
|
|
878
|
+
const text = await res.text();
|
|
879
|
+
await navigator.clipboard.writeText(text);
|
|
880
|
+
} catch {
|
|
881
|
+
return; // fetch/clipboard unavailable - fail silently, same as initCodeCopyButtons
|
|
882
|
+
}
|
|
883
|
+
btn.classList.add("wd-copy-page-copied");
|
|
884
|
+
if (label) label.textContent = "Copied!";
|
|
885
|
+
window.setTimeout(() => {
|
|
886
|
+
btn.classList.remove("wd-copy-page-copied");
|
|
887
|
+
if (label) label.textContent = originalLabel;
|
|
888
|
+
}, 1500);
|
|
889
|
+
});
|
|
890
|
+
});
|
|
891
|
+
}
|
|
892
|
+
initCopyPageMenu(document);
|
|
893
|
+
document.addEventListener("astro:page-load", () => initCopyPageMenu(document));
|
|
894
|
+
|
|
895
|
+
// "Open in ChatGPT/Claude/Perplexity" on a site with no writedocs.json
|
|
896
|
+
// `domain`: the page's absolute .md URL isn't known at build time, so the
|
|
897
|
+
// link is completed here from the address the page is served from (see
|
|
898
|
+
// CopyPageMenu.astro) - same prompt the build writes when it does know.
|
|
899
|
+
function initAskLinks(root: ParentNode) {
|
|
900
|
+
root.querySelectorAll<HTMLAnchorElement>("a[data-ask-base][data-md-path]").forEach((link) => {
|
|
901
|
+
const url = new URL(link.dataset.mdPath ?? "/", window.location.origin).href;
|
|
902
|
+
link.href = link.dataset.askBase + encodeURIComponent(`Read ${url} so you can answer questions about it.`);
|
|
903
|
+
});
|
|
904
|
+
}
|
|
905
|
+
initAskLinks(document);
|
|
906
|
+
document.addEventListener("astro:page-load", () => initAskLinks(document));
|
|
907
|
+
|
|
908
|
+
// The menu's MCP options (CopyPageMenu.astro). "Copy MCP server URL"
|
|
909
|
+
// copies it and says so in its own label - inside the menu, which stays
|
|
910
|
+
// open to show it. "Connect to Cursor / VS Code" on a site with no
|
|
911
|
+
// `domain` get their install links here, for the address the page is
|
|
912
|
+
// served from.
|
|
913
|
+
function initMcpMenu(root: ParentNode) {
|
|
914
|
+
const serverUrl = (el: HTMLElement) =>
|
|
915
|
+
el.dataset.copyMcp || mcpServerUrl(__WD_BASE__ ? window.location.origin + __WD_BASE__ : window.location.origin);
|
|
916
|
+
root.querySelectorAll<HTMLButtonElement>("button[data-copy-mcp]").forEach((btn) => {
|
|
917
|
+
if (btn.dataset.wdInit) return;
|
|
918
|
+
btn.dataset.wdInit = "true";
|
|
919
|
+
const label = btn.querySelector<HTMLElement>(".wd-copy-page-item-title, .wd-copy-page-primary-label");
|
|
920
|
+
const originalLabel = label?.textContent ?? "";
|
|
921
|
+
btn.addEventListener("click", async (e) => {
|
|
922
|
+
e.stopPropagation();
|
|
923
|
+
try {
|
|
924
|
+
await navigator.clipboard.writeText(serverUrl(btn));
|
|
925
|
+
} catch {
|
|
926
|
+
return;
|
|
927
|
+
}
|
|
928
|
+
if (label) label.textContent = "Copied!";
|
|
929
|
+
window.setTimeout(() => {
|
|
930
|
+
if (label) label.textContent = originalLabel;
|
|
931
|
+
}, 1500);
|
|
932
|
+
});
|
|
933
|
+
});
|
|
934
|
+
root.querySelectorAll<HTMLAnchorElement>("a[data-mcp-install]").forEach((link) => {
|
|
935
|
+
const url = mcpServerUrl(__WD_BASE__ ? window.location.origin + __WD_BASE__ : window.location.origin);
|
|
936
|
+
const name = link.dataset.mcpName ?? document.title;
|
|
937
|
+
link.href = link.dataset.mcpInstall === "cursor" ? cursorInstallLink(name, url) : vscodeInstallLink(name, url);
|
|
938
|
+
});
|
|
939
|
+
}
|
|
940
|
+
initMcpMenu(document);
|
|
941
|
+
document.addEventListener("astro:page-load", () => initMcpMenu(document));
|
|
942
|
+
|
|
943
|
+
// Show more/less toggle for ```js expandable code blocks - same
|
|
944
|
+
// build-time-emitted-button + client-wired-click pattern as the copy
|
|
945
|
+
// button above; codeBlockTransformer only adds this button when the
|
|
946
|
+
// fence's meta string contains the `expandable` keyword.
|
|
947
|
+
function initCodeExpandButtons(root: ParentNode) {
|
|
948
|
+
root.querySelectorAll<HTMLButtonElement>(".wd-code-expand-btn").forEach((btn) => {
|
|
949
|
+
if (btn.dataset.wdInit) return;
|
|
950
|
+
btn.dataset.wdInit = "true";
|
|
951
|
+
const block = btn.closest<HTMLElement>(".wd-code-expandable");
|
|
952
|
+
if (!block) return;
|
|
953
|
+
// A block no taller than the collapsed height has nothing to show
|
|
954
|
+
// more of: .wd-code-fits drops the fade and the button. Only when
|
|
955
|
+
// it can be measured - a block in a hidden CodeGroup tab or a
|
|
956
|
+
// closed accordion has no height yet, and keeps its button.
|
|
957
|
+
const pre = block.querySelector("pre");
|
|
958
|
+
// The collapsed height shows 12 lines and hides only the bottom
|
|
959
|
+
// padding, so that padding doesn't count against fitting.
|
|
960
|
+
const padBottom = pre ? parseFloat(getComputedStyle(pre).paddingBottom) || 0 : 0;
|
|
961
|
+
if (pre && pre.clientHeight > 0 && pre.scrollHeight - padBottom <= pre.clientHeight + 1) {
|
|
962
|
+
block.classList.add("wd-code-fits");
|
|
963
|
+
return;
|
|
964
|
+
}
|
|
965
|
+
btn.addEventListener("click", () => {
|
|
966
|
+
const expanded = block.classList.toggle("wd-code-expanded");
|
|
967
|
+
btn.textContent = expanded ? "Show less" : "Show more";
|
|
968
|
+
btn.setAttribute("aria-expanded", String(expanded));
|
|
969
|
+
// Collapsing a long block can leave the reader below it: bring
|
|
970
|
+
// it back into view.
|
|
971
|
+
if (!expanded) block.scrollIntoView({ block: "nearest" });
|
|
972
|
+
});
|
|
973
|
+
});
|
|
974
|
+
}
|
|
975
|
+
initCodeExpandButtons(document);
|
|
976
|
+
document.addEventListener("astro:page-load", () => initCodeExpandButtons(document));
|
|
977
|
+
|
|
978
|
+
// Renders ```mermaid fenced blocks - already reshaped at build time into
|
|
979
|
+
// plain <div class="mermaid">source text</div> containers (see
|
|
980
|
+
// rehypeMermaid in astro.config.mjs/src/lib/mermaid-rehype.js) - into
|
|
981
|
+
// actual SVG diagrams. Lazily imports the mermaid package itself, same
|
|
982
|
+
// reasoning as initSearch's Pagefind import above: most pages have no
|
|
983
|
+
// diagrams at all, no reason to ship/parse that bundle on every load.
|
|
984
|
+
let mermaidLoadPromise: Promise<typeof import("mermaid")> | null = null;
|
|
985
|
+
function ensureMermaid() {
|
|
986
|
+
if (!mermaidLoadPromise) mermaidLoadPromise = import("mermaid");
|
|
987
|
+
return mermaidLoadPromise;
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
// mermaid.run() replaces a block's contents with the rendered SVG,
|
|
991
|
+
// destroying the original diagram source - stashed in a data attribute
|
|
992
|
+
// the first time a block is seen (before it's ever rendered), so a
|
|
993
|
+
// later re-render (see the wd:theme-change listener below - diagrams
|
|
994
|
+
// are baked to static SVG at render time, so a theme change needs an
|
|
995
|
+
// actual re-render, unlike Shiki code blocks which swap colors live via
|
|
996
|
+
// CSS custom properties) has something to restore from.
|
|
997
|
+
function stashMermaidSource(root: ParentNode) {
|
|
998
|
+
root.querySelectorAll<HTMLElement>(".mermaid").forEach((el) => {
|
|
999
|
+
if (el.dataset.mermaidSource === undefined) el.dataset.mermaidSource = el.textContent ?? "";
|
|
1000
|
+
});
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
async function renderMermaid(root: ParentNode, theme: "light" | "dark") {
|
|
1004
|
+
const blocks = Array.from(root.querySelectorAll<HTMLElement>(".mermaid"));
|
|
1005
|
+
if (blocks.length === 0) return;
|
|
1006
|
+
const { default: mermaid } = await ensureMermaid();
|
|
1007
|
+
mermaid.initialize({ startOnLoad: false, theme: theme === "dark" ? "dark" : "default", securityLevel: "strict" });
|
|
1008
|
+
blocks.forEach((el) => {
|
|
1009
|
+
el.removeAttribute("data-processed"); // mermaid's own re-render guard - see run()'s docs
|
|
1010
|
+
el.innerHTML = el.dataset.mermaidSource ?? "";
|
|
1011
|
+
});
|
|
1012
|
+
// suppressErrors: a malformed diagram on one block shouldn't take
|
|
1013
|
+
// down every other diagram on the page - mermaid still renders a
|
|
1014
|
+
// per-block error SVG in place and logs details to the console.
|
|
1015
|
+
await mermaid.run({ nodes: blocks, suppressErrors: true });
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
function initMermaid(root: ParentNode) {
|
|
1019
|
+
stashMermaidSource(root);
|
|
1020
|
+
if (!root.querySelector(".mermaid")) return;
|
|
1021
|
+
const theme = document.documentElement.dataset.theme === "dark" ? "dark" : "light";
|
|
1022
|
+
renderMermaid(root, theme);
|
|
1023
|
+
}
|
|
1024
|
+
initMermaid(document);
|
|
1025
|
+
document.addEventListener("astro:page-load", () => initMermaid(document));
|
|
1026
|
+
document.addEventListener("wd:theme-change", ((e: CustomEvent<{ theme: "light" | "dark" }>) => {
|
|
1027
|
+
renderMermaid(document, e.detail.theme);
|
|
1028
|
+
}) as EventListener);
|
|
1029
|
+
|
|
1030
|
+
// RequestExample/ResponseExample.astro's own docking behavior - on
|
|
1031
|
+
// desktop, moves their rendered .wd-example-panel(s) out of the normal
|
|
1032
|
+
// article flow and into .wd-toc-col (replacing whatever it would
|
|
1033
|
+
// otherwise show - the heading-based TableOfContents or
|
|
1034
|
+
// ApiReferencePanel, per those two components' own comment), matching
|
|
1035
|
+
// Mintlify's stated behavior for the components this was modeled on:
|
|
1036
|
+
// pinned in the sidebar on desktop, plain in-place code blocks below
|
|
1037
|
+
// 1150px (the exact breakpoint .wd-toc-col itself disappears at - see
|
|
1038
|
+
// base.css). This can't be done at build time: MDX compiles a page's
|
|
1039
|
+
// whole body into one content flow, with no way for a static render to
|
|
1040
|
+
// place part of that flow into a *different* column's own slot output
|
|
1041
|
+
// - a client-side move after the fact is the only way to get this
|
|
1042
|
+
// content into a sibling column's subtree at all.
|
|
1043
|
+
function initExamplePanels(root: ParentNode) {
|
|
1044
|
+
const tocCol = document.querySelector<HTMLElement>(".wd-toc-col");
|
|
1045
|
+
if (!tocCol) return; // no toc column on this page (mode !== 'default') - nothing to dock into
|
|
1046
|
+
|
|
1047
|
+
// Top-level panels only: Mintlify's <Panel> (Panel.astro) is itself a
|
|
1048
|
+
// .wd-example-panel, and a RequestExample/ResponseExample inside it
|
|
1049
|
+
// moves with it rather than on its own.
|
|
1050
|
+
const panels = Array.from(root.querySelectorAll<HTMLElement>(".wd-example-panel")).filter(
|
|
1051
|
+
(panel) => !panel.parentElement?.closest(".wd-example-panel"),
|
|
1052
|
+
);
|
|
1053
|
+
if (panels.length === 0) return;
|
|
1054
|
+
if (tocCol.dataset.wdExampleInit) return;
|
|
1055
|
+
tocCol.dataset.wdExampleInit = "true";
|
|
1056
|
+
|
|
1057
|
+
// Response always docks below Request regardless of source order,
|
|
1058
|
+
// matching Mintlify's own stated behavior for these two components.
|
|
1059
|
+
panels.sort((a, b) => {
|
|
1060
|
+
const rank = (el: HTMLElement) => (el.classList.contains("wd-request-example") ? 0 : 1);
|
|
1061
|
+
return rank(a) - rank(b);
|
|
1062
|
+
});
|
|
1063
|
+
|
|
1064
|
+
// A comment node marks each panel's original in-flow position, so
|
|
1065
|
+
// undock() (a desktop -> mobile resize, or simply no matching media
|
|
1066
|
+
// query at all) can put it back exactly where the article's own
|
|
1067
|
+
// content expects it, rather than leaving a permanent gap.
|
|
1068
|
+
const anchors = panels.map((panel) => {
|
|
1069
|
+
const anchor = document.createComment("wd-example-anchor");
|
|
1070
|
+
panel.before(anchor);
|
|
1071
|
+
return anchor;
|
|
1072
|
+
});
|
|
1073
|
+
|
|
1074
|
+
let host = tocCol.querySelector<HTMLElement>(".wd-example-host");
|
|
1075
|
+
if (!host) {
|
|
1076
|
+
host = document.createElement("div");
|
|
1077
|
+
host.className = "wd-example-host";
|
|
1078
|
+
tocCol.prepend(host);
|
|
1079
|
+
}
|
|
1080
|
+
const dockedHost = host;
|
|
1081
|
+
|
|
1082
|
+
// Whatever .wd-toc-col would otherwise render (TableOfContents' own
|
|
1083
|
+
// <nav class="wd-toc">, or ApiReferencePanel's own markup) - hidden
|
|
1084
|
+
// while panels are docked rather than removed, so undock() has
|
|
1085
|
+
// something to restore instead of needing to re-render it.
|
|
1086
|
+
const existingTocContent = Array.from(tocCol.children).filter((el) => el !== dockedHost) as HTMLElement[];
|
|
1087
|
+
|
|
1088
|
+
function dock() {
|
|
1089
|
+
existingTocContent.forEach((el) => (el.style.display = "none"));
|
|
1090
|
+
dockedHost.hidden = false;
|
|
1091
|
+
panels.forEach((panel) => dockedHost.appendChild(panel));
|
|
1092
|
+
}
|
|
1093
|
+
function undock() {
|
|
1094
|
+
dockedHost.hidden = true;
|
|
1095
|
+
existingTocContent.forEach((el) => (el.style.display = ""));
|
|
1096
|
+
panels.forEach((panel, i) => anchors[i].after(panel));
|
|
1097
|
+
}
|
|
1098
|
+
const desktopQuery = window.matchMedia("(min-width: 1151px)");
|
|
1099
|
+
const sync = () => (desktopQuery.matches ? dock() : undock());
|
|
1100
|
+
sync();
|
|
1101
|
+
desktopQuery.addEventListener("change", sync);
|
|
1102
|
+
}
|
|
1103
|
+
initExamplePanels(document);
|
|
1104
|
+
document.addEventListener("astro:page-load", () => initExamplePanels(document));
|
|
1105
|
+
</script>
|
|
1106
|
+
|
|
1107
|
+
<style>
|
|
1108
|
+
.wd-article {
|
|
1109
|
+
max-width: 900px;
|
|
1110
|
+
margin: 0 auto;
|
|
1111
|
+
/* Top padding matches Sidebar.astro's .wd-sidebar and
|
|
1112
|
+
TableOfContents.astro's .wd-toc exactly (both 1.5rem) - all three
|
|
1113
|
+
are siblings in the same .wd-shell row with no padding of their
|
|
1114
|
+
own on .wd-main-col in between, so this is what actually lines up
|
|
1115
|
+
the article's top edge with the sidebar/TOC's first item instead
|
|
1116
|
+
of starting visibly lower than both. */
|
|
1117
|
+
padding: 1.5rem 1.5rem 4rem;
|
|
1118
|
+
}
|
|
1119
|
+
/* frontmatter `mode: wide` - the table of contents column is gone (see
|
|
1120
|
+
BaseLayout.astro), so the article itself gets more room too, rather
|
|
1121
|
+
than just recentering the same 760px column into now-empty space. */
|
|
1122
|
+
.wd-article-wide {
|
|
1123
|
+
max-width: 1040px;
|
|
1124
|
+
}
|
|
1125
|
+
/* frontmatter `mode: custom` - no prose width/padding at all, no
|
|
1126
|
+
max-width, no centering: a hand-built landing page controls its own
|
|
1127
|
+
layout completely, full-bleed if it wants to. */
|
|
1128
|
+
.wd-canvas {
|
|
1129
|
+
width: 100%;
|
|
1130
|
+
}
|
|
1131
|
+
/* Wraps the auto-rendered <h1> together with CopyPageMenu (only
|
|
1132
|
+
rendered when writedocs.json's `contextMenu` isn't off - see
|
|
1133
|
+
showCopyPageMenu above) so the two sit on one row, menu pinned to
|
|
1134
|
+
the right. Always present (even with no menu) rather than only
|
|
1135
|
+
wrapping the <h1> conditionally, so the <h1>'s own top/bottom
|
|
1136
|
+
spacing comes from exactly one place regardless of whether the menu
|
|
1137
|
+
renders - flex items don't margin-collapse with their container the
|
|
1138
|
+
way a bare <h1> would with .wd-article, so that margin is
|
|
1139
|
+
reset/reapplied here instead of relying on the browser's default
|
|
1140
|
+
heading margin still doing the right thing once it's no longer a
|
|
1141
|
+
direct .wd-article child. */
|
|
1142
|
+
.wd-article-header {
|
|
1143
|
+
display: flex;
|
|
1144
|
+
flex-wrap: wrap;
|
|
1145
|
+
align-items: center;
|
|
1146
|
+
justify-content: space-between;
|
|
1147
|
+
gap: 0.75rem 1rem;
|
|
1148
|
+
margin: 0 0 1rem;
|
|
1149
|
+
}
|
|
1150
|
+
.wd-article-header h1 {
|
|
1151
|
+
margin: 0;
|
|
1152
|
+
/* A word longer than the whole line (a long product name on a phone)
|
|
1153
|
+
breaks rather than pushing the page wider than the screen. */
|
|
1154
|
+
overflow-wrap: break-word;
|
|
1155
|
+
}
|
|
1156
|
+
/* The title takes the room the menu leaves. Its basis is 0, so the row
|
|
1157
|
+
only wraps when its longest word and the menu can't share a line - on
|
|
1158
|
+
a desktop, a long title still wraps beside the menu; on a phone, a long
|
|
1159
|
+
word sends the menu below the title instead of off the screen. */
|
|
1160
|
+
.wd-article-header > h1,
|
|
1161
|
+
.wd-article-header > .wd-article-title {
|
|
1162
|
+
flex: 1 1 0;
|
|
1163
|
+
}
|
|
1164
|
+
/* Frontmatter `deprecated: true` (Mintlify's) - same amber as the
|
|
1165
|
+
sidebar's own deprecated tag (NavTree.astro) and Parameter's
|
|
1166
|
+
deprecated badge. */
|
|
1167
|
+
.wd-article-title {
|
|
1168
|
+
display: flex;
|
|
1169
|
+
align-items: center;
|
|
1170
|
+
flex-wrap: wrap;
|
|
1171
|
+
gap: 0.6rem;
|
|
1172
|
+
}
|
|
1173
|
+
.wd-deprecated-badge {
|
|
1174
|
+
display: inline-block;
|
|
1175
|
+
padding: 0.15rem 0.55rem;
|
|
1176
|
+
border-radius: 999px;
|
|
1177
|
+
font-size: 0.8rem;
|
|
1178
|
+
font-weight: 700;
|
|
1179
|
+
color: #d97706;
|
|
1180
|
+
background: color-mix(in srgb, #d97706 15%, transparent);
|
|
1181
|
+
}
|
|
1182
|
+
.wd-prevnext {
|
|
1183
|
+
display: flex;
|
|
1184
|
+
justify-content: space-between;
|
|
1185
|
+
margin-top: 3rem;
|
|
1186
|
+
padding-top: 1.5rem;
|
|
1187
|
+
border-top: 1px solid var(--wd-border);
|
|
1188
|
+
gap: 1rem;
|
|
1189
|
+
}
|
|
1190
|
+
/* Two side-by-side cards, each taking up to half the row - flex: 1 1
|
|
1191
|
+
0 rather than a fixed 50% so a single remaining card (first page:
|
|
1192
|
+
only next, last page: only prev) grows to fill the width instead
|
|
1193
|
+
of leaving an empty gap next to it. */
|
|
1194
|
+
.wd-prevnext-card {
|
|
1195
|
+
display: flex;
|
|
1196
|
+
flex: 1 1 0;
|
|
1197
|
+
min-width: 0;
|
|
1198
|
+
flex-direction: column;
|
|
1199
|
+
gap: 0.1rem;
|
|
1200
|
+
padding: 0.75rem 1.1rem;
|
|
1201
|
+
border: 1px solid var(--wd-border);
|
|
1202
|
+
border-radius: 0.75rem;
|
|
1203
|
+
text-decoration: none;
|
|
1204
|
+
color: inherit;
|
|
1205
|
+
transition:
|
|
1206
|
+
border-color 0.15s ease,
|
|
1207
|
+
box-shadow 0.15s ease;
|
|
1208
|
+
}
|
|
1209
|
+
/* Both cards are identical at rest - the accent border/glow in the
|
|
1210
|
+
reference screenshot is that card's :hover state, not a permanent
|
|
1211
|
+
treatment on Next, so both wd-prevnext-prev and wd-prevnext-next
|
|
1212
|
+
share this one hover rule instead of Next getting its own always-on
|
|
1213
|
+
copy. Built from --wd-primary via color-mix() rather than a flat
|
|
1214
|
+
hardcoded color, so it stays correct under any theme's own accent. */
|
|
1215
|
+
.wd-prevnext-card:hover {
|
|
1216
|
+
border-color: var(--wd-primary);
|
|
1217
|
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--wd-primary) 10%, transparent);
|
|
1218
|
+
}
|
|
1219
|
+
.wd-prevnext-row {
|
|
1220
|
+
display: flex;
|
|
1221
|
+
align-items: center;
|
|
1222
|
+
justify-content: space-between;
|
|
1223
|
+
gap: 0.5rem;
|
|
1224
|
+
color: var(--wd-text-muted);
|
|
1225
|
+
font-size: 0.75rem;
|
|
1226
|
+
}
|
|
1227
|
+
.wd-prevnext-icon {
|
|
1228
|
+
flex-shrink: 0;
|
|
1229
|
+
color: var(--wd-text-muted);
|
|
1230
|
+
transition: color 0.15s ease;
|
|
1231
|
+
}
|
|
1232
|
+
.wd-prevnext-title {
|
|
1233
|
+
font-weight: 600;
|
|
1234
|
+
font-size: 0.85rem;
|
|
1235
|
+
color: var(--wd-heading);
|
|
1236
|
+
white-space: nowrap;
|
|
1237
|
+
overflow: hidden;
|
|
1238
|
+
text-overflow: ellipsis;
|
|
1239
|
+
transition: color 0.15s ease;
|
|
1240
|
+
}
|
|
1241
|
+
/* Previous's title sits at the same end of the card its own
|
|
1242
|
+
"Previous" label already does (right-aligned, next to the arrow's
|
|
1243
|
+
fixed spot on the left) - Next's title stays left-aligned, at the
|
|
1244
|
+
same end its own "Next" label sits. Keeps each card's two rows
|
|
1245
|
+
reading as one consistent left/right-anchored column instead of
|
|
1246
|
+
the title always defaulting to the left regardless of which side
|
|
1247
|
+
its card's own label/arrow occupy. */
|
|
1248
|
+
.wd-prevnext-prev .wd-prevnext-title {
|
|
1249
|
+
text-align: right;
|
|
1250
|
+
}
|
|
1251
|
+
/* Icon and title pick up the accent color on hover - the
|
|
1252
|
+
"Next"/"Previous" label itself stays muted even then, since it's a
|
|
1253
|
+
plain UI affordance rather than the actual content being pointed
|
|
1254
|
+
to. */
|
|
1255
|
+
.wd-prevnext-card:hover .wd-prevnext-icon,
|
|
1256
|
+
.wd-prevnext-card:hover .wd-prevnext-title {
|
|
1257
|
+
color: var(--wd-primary);
|
|
1258
|
+
}
|
|
1259
|
+
@media (width <= 640px) {
|
|
1260
|
+
.wd-prevnext {
|
|
1261
|
+
flex-direction: column;
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
</style>
|
|
1265
|
+
|
|
1266
|
+
<style is:global>
|
|
1267
|
+
/*
|
|
1268
|
+
* These target direct children of .wd-article (or, for inline marks,
|
|
1269
|
+
* specific prose containers) rather than bare tag selectors. MDX
|
|
1270
|
+
* component internals (Card titles/links, prev/next nav links) also
|
|
1271
|
+
* live inside .wd-article but nested deeper - a bare ".wd-article h3"
|
|
1272
|
+
* or ".wd-article a" would win the specificity tie against those
|
|
1273
|
+
* components' own scoped styles and visibly break them (oversized
|
|
1274
|
+
* card titles, underlined cards, underlined prev/next links). Real
|
|
1275
|
+
* MDX content (headings, paragraphs, lists, etc.) renders as flat
|
|
1276
|
+
* direct children of .wd-article, so the ">" combinator is enough to
|
|
1277
|
+
* separate "actual content" from "component chrome" without needing
|
|
1278
|
+
* per-component :not() exceptions.
|
|
1279
|
+
*/
|
|
1280
|
+
/* --wd-topbar-offset is set by initTopbarOffset() (src/scripts/
|
|
1281
|
+
topbar-offset.ts) to the sticky topbar's real measured height - see
|
|
1282
|
+
its own file comment for why a fixed 5rem (this var()'s own
|
|
1283
|
+
fallback, for the instant before that script's first measurement)
|
|
1284
|
+
isn't enough once a site's topbar grows a second row. Without this,
|
|
1285
|
+
jumping straight to a #heading link (a hard load, or clicking one of
|
|
1286
|
+
the .wd-heading-anchor links below) lands the heading partly hidden
|
|
1287
|
+
under the sticky topbar. */
|
|
1288
|
+
.wd-article > h2 {
|
|
1289
|
+
font-size: 1.5rem;
|
|
1290
|
+
margin: 2.75rem 0 1rem;
|
|
1291
|
+
padding-top: 0.25rem;
|
|
1292
|
+
scroll-margin-top: var(--wd-topbar-offset, 5rem);
|
|
1293
|
+
}
|
|
1294
|
+
.wd-article > h3 {
|
|
1295
|
+
font-size: 1.2rem;
|
|
1296
|
+
margin: 2rem 0 0.75rem;
|
|
1297
|
+
scroll-margin-top: var(--wd-topbar-offset, 5rem);
|
|
1298
|
+
}
|
|
1299
|
+
.wd-article > h4 {
|
|
1300
|
+
font-size: 1rem;
|
|
1301
|
+
margin: 1.5rem 0 0.5rem;
|
|
1302
|
+
scroll-margin-top: var(--wd-topbar-offset, 5rem);
|
|
1303
|
+
}
|
|
1304
|
+
.wd-article > h2:first-child,
|
|
1305
|
+
.wd-article > h3:first-child {
|
|
1306
|
+
margin-top: 0;
|
|
1307
|
+
}
|
|
1308
|
+
.wd-article > p {
|
|
1309
|
+
margin: 0.9rem 0;
|
|
1310
|
+
}
|
|
1311
|
+
.wd-article > ul,
|
|
1312
|
+
.wd-article > ol {
|
|
1313
|
+
margin: 0.9rem 0;
|
|
1314
|
+
padding-left: 1.4rem;
|
|
1315
|
+
}
|
|
1316
|
+
.wd-article li {
|
|
1317
|
+
margin: 0.35rem 0;
|
|
1318
|
+
}
|
|
1319
|
+
.wd-article li > ul,
|
|
1320
|
+
.wd-article li > ol {
|
|
1321
|
+
margin: 0.35rem 0;
|
|
1322
|
+
}
|
|
1323
|
+
.wd-article > blockquote {
|
|
1324
|
+
margin: 1.25rem 0;
|
|
1325
|
+
padding: 0.1rem 1rem;
|
|
1326
|
+
border-left: 3px solid var(--wd-primary);
|
|
1327
|
+
background: var(--wd-surface);
|
|
1328
|
+
border-radius: 0 0.4rem 0.4rem 0;
|
|
1329
|
+
color: var(--wd-text-muted);
|
|
1330
|
+
}
|
|
1331
|
+
.wd-article blockquote p {
|
|
1332
|
+
margin: 0.7rem 0;
|
|
1333
|
+
}
|
|
1334
|
+
.wd-article > table {
|
|
1335
|
+
width: 100%;
|
|
1336
|
+
border-collapse: collapse;
|
|
1337
|
+
margin: 1.25rem 0;
|
|
1338
|
+
font-size: 0.9rem;
|
|
1339
|
+
}
|
|
1340
|
+
.wd-article th,
|
|
1341
|
+
.wd-article td {
|
|
1342
|
+
text-align: left;
|
|
1343
|
+
padding: 0.55rem 0.75rem;
|
|
1344
|
+
border-bottom: 1px solid var(--wd-border);
|
|
1345
|
+
vertical-align: top;
|
|
1346
|
+
}
|
|
1347
|
+
.wd-article th {
|
|
1348
|
+
color: var(--wd-text-muted);
|
|
1349
|
+
font-weight: 600;
|
|
1350
|
+
font-size: 0.8rem;
|
|
1351
|
+
text-transform: uppercase;
|
|
1352
|
+
letter-spacing: 0.03em;
|
|
1353
|
+
}
|
|
1354
|
+
.wd-article > hr {
|
|
1355
|
+
border: none;
|
|
1356
|
+
border-top: 1px solid var(--wd-border);
|
|
1357
|
+
margin: 2.5rem 0;
|
|
1358
|
+
}
|
|
1359
|
+
/* Fenced (```) code blocks - codeBlockTransformer
|
|
1360
|
+
(src/lib/shiki-code-block.js) wraps every one's <pre> in this
|
|
1361
|
+
.wd-code-block div at build time (plus an optional .wd-code-title
|
|
1362
|
+
bar, and the copy/expand buttons - see below). The card-like chrome
|
|
1363
|
+
(border/radius/background) lives on the wrapper rather than the
|
|
1364
|
+
<pre> itself so a title bar, when present, can sit flush above it
|
|
1365
|
+
inside the same box; Astro's Shiki pipeline (dual light/dark themes
|
|
1366
|
+
configured in astro.config.mjs) already supplies the <pre>'s own
|
|
1367
|
+
background/text colors via inline styles. Matches both a standalone
|
|
1368
|
+
block (direct child of .wd-article) and one nested inside
|
|
1369
|
+
<CodeGroup> (which re-targets the margin/radius itself via its own
|
|
1370
|
+
more specific `.wd-codegroup > .wd-code-block` rule in
|
|
1371
|
+
CodeGroup.astro).
|
|
1372
|
+
The layout follows Mintlify's: a frame (the wrapper - border, surface
|
|
1373
|
+
background, a 0.125rem inset) holding the title bar, and the code in
|
|
1374
|
+
its own rounded panel inside it (the <pre>, in the code theme's
|
|
1375
|
+
background). --wd-code-pad-x is the panel's side padding: the
|
|
1376
|
+
highlighted and diff lines below stretch past it by the same amount
|
|
1377
|
+
to reach the panel's edges. */
|
|
1378
|
+
.wd-code-block {
|
|
1379
|
+
--wd-code-pad-x: 1rem;
|
|
1380
|
+
position: relative;
|
|
1381
|
+
margin: 1.25rem 0 2rem;
|
|
1382
|
+
padding: 0.125rem;
|
|
1383
|
+
border: 1px solid var(--wd-border);
|
|
1384
|
+
border-radius: 1rem;
|
|
1385
|
+
background: var(--wd-surface);
|
|
1386
|
+
}
|
|
1387
|
+
.wd-article pre.astro-code {
|
|
1388
|
+
margin: 0;
|
|
1389
|
+
padding: 0.75rem var(--wd-code-pad-x);
|
|
1390
|
+
border: none;
|
|
1391
|
+
border-radius: 0.875rem;
|
|
1392
|
+
font-size: 0.875rem;
|
|
1393
|
+
line-height: 1.5rem;
|
|
1394
|
+
}
|
|
1395
|
+
/* On the frame, above the panel - room on the right for the copy
|
|
1396
|
+
button, which moves into this bar when there is one (below). */
|
|
1397
|
+
.wd-code-title {
|
|
1398
|
+
padding: 0.25rem 2.75rem 0.25rem var(--wd-code-pad-x);
|
|
1399
|
+
font-size: 0.75rem;
|
|
1400
|
+
font-weight: 500;
|
|
1401
|
+
line-height: 1.5rem;
|
|
1402
|
+
color: var(--wd-text);
|
|
1403
|
+
white-space: nowrap;
|
|
1404
|
+
overflow: hidden;
|
|
1405
|
+
text-overflow: ellipsis;
|
|
1406
|
+
}
|
|
1407
|
+
/* A fence's `icon="..."` (shiki-code-block.js) - the icon's own SVG
|
|
1408
|
+
arrives as a data URL in --wd-code-icon and is used as a mask, so it
|
|
1409
|
+
paints in the title's text color instead of the SVG's own fill. */
|
|
1410
|
+
.wd-code-title-icon {
|
|
1411
|
+
display: inline-block;
|
|
1412
|
+
width: 1em;
|
|
1413
|
+
height: 1em;
|
|
1414
|
+
margin-right: 0.45rem;
|
|
1415
|
+
vertical-align: -0.125em;
|
|
1416
|
+
background: currentColor;
|
|
1417
|
+
-webkit-mask: var(--wd-code-icon) center / contain no-repeat;
|
|
1418
|
+
mask: var(--wd-code-icon) center / contain no-repeat;
|
|
1419
|
+
}
|
|
1420
|
+
/* Without a title bar, the copy button sits in the panel's top-right
|
|
1421
|
+
corner and shows on hover or keyboard focus. */
|
|
1422
|
+
.wd-code-copy-btn {
|
|
1423
|
+
position: absolute;
|
|
1424
|
+
top: 0.625rem;
|
|
1425
|
+
right: 0.625rem;
|
|
1426
|
+
z-index: 1;
|
|
1427
|
+
display: inline-flex;
|
|
1428
|
+
align-items: center;
|
|
1429
|
+
justify-content: center;
|
|
1430
|
+
width: 1.75rem;
|
|
1431
|
+
height: 1.75rem;
|
|
1432
|
+
padding: 0;
|
|
1433
|
+
border-radius: 0.5rem;
|
|
1434
|
+
border: 1px solid var(--wd-border);
|
|
1435
|
+
background: var(--wd-surface);
|
|
1436
|
+
color: var(--wd-text-muted);
|
|
1437
|
+
font-size: 0.9rem;
|
|
1438
|
+
line-height: 1;
|
|
1439
|
+
cursor: pointer;
|
|
1440
|
+
opacity: 0;
|
|
1441
|
+
transition:
|
|
1442
|
+
opacity 0.15s ease,
|
|
1443
|
+
color 0.15s ease,
|
|
1444
|
+
background 0.15s ease,
|
|
1445
|
+
border-color 0.15s ease;
|
|
1446
|
+
}
|
|
1447
|
+
.wd-code-block:hover .wd-code-copy-btn,
|
|
1448
|
+
.wd-code-copy-btn:focus-visible {
|
|
1449
|
+
opacity: 1;
|
|
1450
|
+
}
|
|
1451
|
+
.wd-code-copy-btn:hover {
|
|
1452
|
+
color: var(--wd-text);
|
|
1453
|
+
background: var(--wd-background);
|
|
1454
|
+
}
|
|
1455
|
+
/* With a title bar, it's an always-visible icon at the bar's right end,
|
|
1456
|
+
like Mintlify's: centered in the 2rem bar, inside the frame's inset. */
|
|
1457
|
+
.wd-code-title ~ .wd-code-copy-btn {
|
|
1458
|
+
top: 0.375rem;
|
|
1459
|
+
right: 0.5rem;
|
|
1460
|
+
width: 1.5rem;
|
|
1461
|
+
height: 1.5rem;
|
|
1462
|
+
border-color: transparent;
|
|
1463
|
+
background: transparent;
|
|
1464
|
+
opacity: 1;
|
|
1465
|
+
}
|
|
1466
|
+
.wd-code-title ~ .wd-code-copy-btn:hover {
|
|
1467
|
+
background: color-mix(in srgb, var(--wd-text) 8%, transparent);
|
|
1468
|
+
}
|
|
1469
|
+
.wd-code-copy-btn.wd-code-copied {
|
|
1470
|
+
opacity: 1;
|
|
1471
|
+
color: #16a34a;
|
|
1472
|
+
border-color: #16a34a;
|
|
1473
|
+
}
|
|
1474
|
+
/* ```js wrap - opts a single block into wrapping long lines instead
|
|
1475
|
+
of horizontal-scrolling (the default). */
|
|
1476
|
+
.wd-code-wrap pre.astro-code,
|
|
1477
|
+
.wd-code-wrap pre.astro-code code {
|
|
1478
|
+
white-space: pre-wrap;
|
|
1479
|
+
word-break: break-word;
|
|
1480
|
+
overflow-x: hidden;
|
|
1481
|
+
}
|
|
1482
|
+
/* ```js lines (or showLineNumbers) - a CSS-counter gutter, no markup
|
|
1483
|
+
needed beyond a class since every line is already its own .line
|
|
1484
|
+
span. The column is --wd-code-digits characters wide (set on the
|
|
1485
|
+
wrapper by shiki-code-block.js from the line count), so the numbers
|
|
1486
|
+
start at the panel's padding and stay right-aligned past nine lines. */
|
|
1487
|
+
.wd-code-lines pre.astro-code code {
|
|
1488
|
+
counter-reset: wd-code-line;
|
|
1489
|
+
}
|
|
1490
|
+
.wd-code-lines pre.astro-code .line {
|
|
1491
|
+
counter-increment: wd-code-line;
|
|
1492
|
+
}
|
|
1493
|
+
.wd-code-lines pre.astro-code .line::before {
|
|
1494
|
+
content: counter(wd-code-line);
|
|
1495
|
+
display: inline-block;
|
|
1496
|
+
width: calc(var(--wd-code-digits, 2) * 1ch);
|
|
1497
|
+
margin-right: 1.25rem;
|
|
1498
|
+
text-align: right;
|
|
1499
|
+
color: var(--wd-text-muted);
|
|
1500
|
+
user-select: none;
|
|
1501
|
+
}
|
|
1502
|
+
/* ```js expandable - collapses to its first 12 lines (plus the panel's
|
|
1503
|
+
top padding) with a "Show more" button below; toggled via
|
|
1504
|
+
.wd-code-expanded, added by the click handler in the <script> block
|
|
1505
|
+
below. A block that already fits gets .wd-code-fits from the same
|
|
1506
|
+
script instead, and is never collapsed: no fade, no button. */
|
|
1507
|
+
.wd-code-expandable:not(.wd-code-expanded, .wd-code-fits) pre.astro-code {
|
|
1508
|
+
max-height: calc(12 * 1.5rem + 0.75rem);
|
|
1509
|
+
overflow-y: hidden;
|
|
1510
|
+
}
|
|
1511
|
+
/* The fade over the last visible lines: a strip at the end of the code,
|
|
1512
|
+
stuck to the bottom of the clipped panel (and to its left edge, if
|
|
1513
|
+
the block is scrolled sideways), three lines tall and solid over the
|
|
1514
|
+
last one, so no line shows cut in half. It's the panel's own background -
|
|
1515
|
+
`inherit` takes the <pre>'s computed color, the dark theme's in dark
|
|
1516
|
+
mode - masked from transparent to solid, so it fades into whatever
|
|
1517
|
+
code theme the site uses. */
|
|
1518
|
+
.wd-code-expandable:not(.wd-code-expanded, .wd-code-fits) pre.astro-code::after {
|
|
1519
|
+
content: "";
|
|
1520
|
+
position: sticky;
|
|
1521
|
+
/* Sticky offsets count from inside the <pre>'s padding: minus the
|
|
1522
|
+
padding puts the strip on the panel's edges, over the padding too. */
|
|
1523
|
+
bottom: -0.75rem;
|
|
1524
|
+
left: calc(-1 * var(--wd-code-pad-x));
|
|
1525
|
+
display: block;
|
|
1526
|
+
width: calc(100% + 2 * var(--wd-code-pad-x));
|
|
1527
|
+
height: 4.5rem;
|
|
1528
|
+
margin: -4.5rem calc(-1 * var(--wd-code-pad-x)) 0;
|
|
1529
|
+
background-color: inherit;
|
|
1530
|
+
-webkit-mask-image: linear-gradient(to bottom, transparent, #000 70%);
|
|
1531
|
+
mask-image: linear-gradient(to bottom, transparent, #000 70%);
|
|
1532
|
+
pointer-events: none;
|
|
1533
|
+
}
|
|
1534
|
+
.wd-code-fits .wd-code-expand-btn {
|
|
1535
|
+
display: none;
|
|
1536
|
+
}
|
|
1537
|
+
/* Below the panel, on the frame, with a chevron that turns up once
|
|
1538
|
+
the block is open. */
|
|
1539
|
+
.wd-code-expand-btn {
|
|
1540
|
+
display: flex;
|
|
1541
|
+
align-items: center;
|
|
1542
|
+
justify-content: center;
|
|
1543
|
+
gap: 0.5rem;
|
|
1544
|
+
width: 100%;
|
|
1545
|
+
padding: 0.25rem;
|
|
1546
|
+
border: none;
|
|
1547
|
+
border-radius: 0 0 0.875rem 0.875rem;
|
|
1548
|
+
background: transparent;
|
|
1549
|
+
color: var(--wd-text-muted);
|
|
1550
|
+
font-family: inherit;
|
|
1551
|
+
font-size: 0.75rem;
|
|
1552
|
+
font-weight: 500;
|
|
1553
|
+
line-height: 1.5rem;
|
|
1554
|
+
cursor: pointer;
|
|
1555
|
+
transition:
|
|
1556
|
+
color 0.15s ease,
|
|
1557
|
+
background 0.15s ease;
|
|
1558
|
+
}
|
|
1559
|
+
.wd-code-expand-btn::after {
|
|
1560
|
+
content: "";
|
|
1561
|
+
width: 0.375rem;
|
|
1562
|
+
height: 0.375rem;
|
|
1563
|
+
border-right: 1.5px solid currentColor;
|
|
1564
|
+
border-bottom: 1.5px solid currentColor;
|
|
1565
|
+
transform: translateY(-0.1rem) rotate(45deg);
|
|
1566
|
+
transition: transform 0.15s ease;
|
|
1567
|
+
}
|
|
1568
|
+
.wd-code-expanded .wd-code-expand-btn::after {
|
|
1569
|
+
transform: translateY(0.1rem) rotate(-135deg);
|
|
1570
|
+
}
|
|
1571
|
+
.wd-code-expand-btn:hover {
|
|
1572
|
+
color: var(--wd-text);
|
|
1573
|
+
background: color-mix(in srgb, var(--wd-text) 6%, transparent);
|
|
1574
|
+
}
|
|
1575
|
+
/* Line/word annotation classes added by the official
|
|
1576
|
+
@shikijs/transformers transformers configured alongside
|
|
1577
|
+
codeBlockTransformer in astro.config.mjs:
|
|
1578
|
+
.line.highlighted - transformerMetaHighlight
|
|
1579
|
+
(```js {1,3-5}) and
|
|
1580
|
+
transformerNotationHighlight
|
|
1581
|
+
(// [!code highlight]/[!code hl])
|
|
1582
|
+
.line.diff.add / .diff.remove - transformerNotationDiff
|
|
1583
|
+
(// [!code ++] / // [!code --])
|
|
1584
|
+
.line.error / .warning / .info - transformerNotationErrorLevel
|
|
1585
|
+
(// [!code error]/[!code warning])
|
|
1586
|
+
(also carries .highlighted)
|
|
1587
|
+
pre.has-focused, .line.focused - transformerNotationFocus
|
|
1588
|
+
(// [!code focus])
|
|
1589
|
+
.highlighted-word - transformerMetaWordHighlight
|
|
1590
|
+
(```js /someWord/) and
|
|
1591
|
+
transformerNotationWordHighlight
|
|
1592
|
+
(// [!code word:someWord])
|
|
1593
|
+
Every .line needs display:inline-block + full width for its
|
|
1594
|
+
highlight background to stretch edge-to-edge (by default a <span>
|
|
1595
|
+
only extends as wide as its own text) - harmless for plain lines,
|
|
1596
|
+
since inline-block with no other styling renders identically to
|
|
1597
|
+
the browser's normal inline flow here. */
|
|
1598
|
+
.astro-code .line {
|
|
1599
|
+
display: inline-block;
|
|
1600
|
+
width: 100%;
|
|
1601
|
+
}
|
|
1602
|
+
.astro-code .line.highlighted {
|
|
1603
|
+
background: color-mix(in srgb, var(--wd-primary) 12%, transparent);
|
|
1604
|
+
margin: 0 calc(-1 * var(--wd-code-pad-x, 1rem));
|
|
1605
|
+
padding: 0 var(--wd-code-pad-x, 1rem);
|
|
1606
|
+
width: calc(100% + 2 * var(--wd-code-pad-x, 1rem));
|
|
1607
|
+
}
|
|
1608
|
+
.astro-code .line.diff {
|
|
1609
|
+
margin: 0 calc(-1 * var(--wd-code-pad-x, 1rem));
|
|
1610
|
+
padding: 0 var(--wd-code-pad-x, 1rem);
|
|
1611
|
+
width: calc(100% + 2 * var(--wd-code-pad-x, 1rem));
|
|
1612
|
+
position: relative;
|
|
1613
|
+
}
|
|
1614
|
+
.astro-code .line.diff.add {
|
|
1615
|
+
background: color-mix(in srgb, #16a34a 15%, transparent);
|
|
1616
|
+
}
|
|
1617
|
+
.astro-code .line.diff.remove {
|
|
1618
|
+
background: color-mix(in srgb, #dc2626 15%, transparent);
|
|
1619
|
+
opacity: 0.85;
|
|
1620
|
+
}
|
|
1621
|
+
.astro-code .line.diff.add::before,
|
|
1622
|
+
.astro-code .line.diff.remove::before {
|
|
1623
|
+
position: absolute;
|
|
1624
|
+
left: 0.3rem;
|
|
1625
|
+
font-weight: 700;
|
|
1626
|
+
}
|
|
1627
|
+
.astro-code .line.diff.add::before {
|
|
1628
|
+
content: "+";
|
|
1629
|
+
color: #16a34a;
|
|
1630
|
+
}
|
|
1631
|
+
.astro-code .line.diff.remove::before {
|
|
1632
|
+
content: "-";
|
|
1633
|
+
color: #dc2626;
|
|
1634
|
+
}
|
|
1635
|
+
.astro-code .line.error {
|
|
1636
|
+
background: color-mix(in srgb, #dc2626 15%, transparent);
|
|
1637
|
+
}
|
|
1638
|
+
.astro-code .line.warning {
|
|
1639
|
+
background: color-mix(in srgb, #d97706 15%, transparent);
|
|
1640
|
+
}
|
|
1641
|
+
.astro-code .line.info {
|
|
1642
|
+
background: color-mix(in srgb, #2563eb 12%, transparent);
|
|
1643
|
+
}
|
|
1644
|
+
pre.astro-code.has-focused .line {
|
|
1645
|
+
opacity: 0.45;
|
|
1646
|
+
filter: blur(0.3px);
|
|
1647
|
+
transition:
|
|
1648
|
+
opacity 0.2s ease,
|
|
1649
|
+
filter 0.2s ease;
|
|
1650
|
+
}
|
|
1651
|
+
pre.astro-code.has-focused .line.focused {
|
|
1652
|
+
opacity: 1;
|
|
1653
|
+
filter: none;
|
|
1654
|
+
}
|
|
1655
|
+
pre.astro-code.has-focused:hover .line {
|
|
1656
|
+
opacity: 1;
|
|
1657
|
+
filter: none;
|
|
1658
|
+
}
|
|
1659
|
+
.astro-code .highlighted-word {
|
|
1660
|
+
background: color-mix(in srgb, var(--wd-primary) 20%, transparent);
|
|
1661
|
+
border-radius: 0.25rem;
|
|
1662
|
+
padding: 0.05rem 0.2rem;
|
|
1663
|
+
margin: -0.05rem -0.15rem;
|
|
1664
|
+
}
|
|
1665
|
+
.wd-article img {
|
|
1666
|
+
max-width: 100%;
|
|
1667
|
+
border-radius: 0.5rem;
|
|
1668
|
+
border: 1px solid var(--wd-border);
|
|
1669
|
+
}
|
|
1670
|
+
/* ```mermaid fenced blocks (rehypeMermaid in astro.config.mjs reshapes
|
|
1671
|
+
them into this plain <div class="mermaid"> container at build time -
|
|
1672
|
+
see mermaid-rehype.js) - mermaid.js (initMermaid() below) replaces
|
|
1673
|
+
the raw source text with a rendered <svg> in place, client-side.
|
|
1674
|
+
overflow-x: auto rather than shrinking the diagram, since a wide
|
|
1675
|
+
flowchart squeezed into the article's ~760px column becomes
|
|
1676
|
+
unreadable; centering only kicks in once the svg fits, via the
|
|
1677
|
+
inline-block + text-align combo below. */
|
|
1678
|
+
.wd-article > div.mermaid {
|
|
1679
|
+
margin: 1.25rem 0;
|
|
1680
|
+
padding: 1rem;
|
|
1681
|
+
overflow-x: auto;
|
|
1682
|
+
text-align: center;
|
|
1683
|
+
background: var(--wd-surface);
|
|
1684
|
+
border: 1px solid var(--wd-border);
|
|
1685
|
+
border-radius: 0.55rem;
|
|
1686
|
+
}
|
|
1687
|
+
.wd-article > div.mermaid svg {
|
|
1688
|
+
display: inline-block;
|
|
1689
|
+
max-width: 100%;
|
|
1690
|
+
}
|
|
1691
|
+
/* Only style links inside actual prose containers - excludes Card
|
|
1692
|
+
(which is itself an <a>) and the prev/next nav links. */
|
|
1693
|
+
.wd-article p a,
|
|
1694
|
+
.wd-article li a,
|
|
1695
|
+
.wd-article td a,
|
|
1696
|
+
.wd-article blockquote a {
|
|
1697
|
+
text-decoration: underline;
|
|
1698
|
+
text-decoration-color: color-mix(in srgb, var(--wd-primary) 40%, transparent);
|
|
1699
|
+
text-underline-offset: 2px;
|
|
1700
|
+
}
|
|
1701
|
+
.wd-article strong {
|
|
1702
|
+
font-weight: 600;
|
|
1703
|
+
}
|
|
1704
|
+
.wd-article > h2 a[href^="#"],
|
|
1705
|
+
.wd-article > h3 a[href^="#"],
|
|
1706
|
+
.wd-article > h4 a[href^="#"] {
|
|
1707
|
+
text-decoration: none;
|
|
1708
|
+
}
|
|
1709
|
+
.wd-heading-anchor {
|
|
1710
|
+
display: inline-block;
|
|
1711
|
+
margin-left: 0.5rem;
|
|
1712
|
+
color: var(--wd-text-muted);
|
|
1713
|
+
opacity: 0;
|
|
1714
|
+
text-decoration: none;
|
|
1715
|
+
font-weight: 400;
|
|
1716
|
+
transition: opacity 0.1s ease;
|
|
1717
|
+
}
|
|
1718
|
+
.wd-article > h2:hover .wd-heading-anchor,
|
|
1719
|
+
.wd-article > h3:hover .wd-heading-anchor,
|
|
1720
|
+
.wd-article > h4:hover .wd-heading-anchor,
|
|
1721
|
+
.wd-heading-anchor:focus {
|
|
1722
|
+
opacity: 1;
|
|
1723
|
+
}
|
|
1724
|
+
/* RequestExample/ResponseExample.astro's own panels, and the
|
|
1725
|
+
.wd-toc-col host initExamplePanels() (see the <script> above) docks
|
|
1726
|
+
them into on desktop - is:global (this whole style block already
|
|
1727
|
+
is) since .wd-toc-col itself is BaseLayout.astro's own markup, a
|
|
1728
|
+
completely different component than this one. Widens .wd-toc-col
|
|
1729
|
+
itself only while it actually contains a non-empty host - the same
|
|
1730
|
+
:has() technique ApiReferencePanel.astro's own identical comment
|
|
1731
|
+
already uses to widen it for its own markup, so a page with neither
|
|
1732
|
+
feature keeps the narrower 230px default from base.css. */
|
|
1733
|
+
.wd-toc-col:has(.wd-example-host:not(:empty)) {
|
|
1734
|
+
width: 340px;
|
|
1735
|
+
}
|
|
1736
|
+
.wd-example-host {
|
|
1737
|
+
position: sticky;
|
|
1738
|
+
top: var(--wd-topbar-offset, 5rem);
|
|
1739
|
+
max-height: calc(100vh - var(--wd-topbar-offset, 5rem));
|
|
1740
|
+
overflow-y: auto;
|
|
1741
|
+
padding: 1.5rem 0 1.5rem 0.5rem;
|
|
1742
|
+
}
|
|
1743
|
+
/* Spacing between multiple docked panels (e.g. Request above
|
|
1744
|
+
Response) is this wrapper's own job only once docked - inline
|
|
1745
|
+
(mobile, no-toc-column, or not-yet-docked), the wrapped
|
|
1746
|
+
.wd-codegroup's own default margin already spaces stacked panels
|
|
1747
|
+
out correctly, so adding a second margin here unscoped would just
|
|
1748
|
+
double it up. */
|
|
1749
|
+
.wd-example-host .wd-example-panel {
|
|
1750
|
+
margin-bottom: 1.25rem;
|
|
1751
|
+
}
|
|
1752
|
+
.wd-example-host .wd-example-panel:last-child {
|
|
1753
|
+
margin-bottom: 0;
|
|
1754
|
+
}
|
|
1755
|
+
.wd-example-host .wd-codegroup {
|
|
1756
|
+
margin: 0;
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
.wd-example-host .astro-code {
|
|
1760
|
+
margin: 0;
|
|
1761
|
+
}
|
|
1762
|
+
</style>
|