@writedocs/generator 0.10.0 → 0.10.2
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/astro.config.mjs +3 -0
- package/package.json +1 -1
- package/src/cli/dev.js +72 -10
- package/src/cli/page-list-watch.js +66 -0
- package/src/components/ApiReferencePanel.astro +1 -1
- package/src/layout/components/MobileMenu.astro +23 -2
- package/src/layout/components/Sidebar.astro +2 -1
- package/src/layout/components/TopBar.astro +2 -2
- package/src/layout/styles/mobile-menu.css +21 -0
- package/src/layout/styles/topbar.css +1 -1
- package/src/lib/config-reload-integration.js +32 -0
- package/src/lib/config-schema.js +8 -1
- package/src/lib/config-schema.ts +15 -4
- package/src/lib/config.ts +60 -0
- package/src/lib/item-pages.js +71 -0
- package/src/lib/json-schema-descriptions.js +1 -0
- package/src/lib/llms.js +4 -1
- package/src/lib/mcp-index.ts +6 -1
- package/src/lib/selector-placement.js +8 -0
- package/src/pages/[...slug].astro +65 -7
- package/writedocs.schema.json +175 -0
package/astro.config.mjs
CHANGED
|
@@ -37,6 +37,7 @@ import { remarkExtractInlineReactComponents } from './src/lib/mdx-inline-react.j
|
|
|
37
37
|
import { writedocsTempDir, writedocsBuildStagingDir } from './src/lib/writedocs-temp-dir.js';
|
|
38
38
|
import { stylesAssetFallback } from './src/lib/styles-asset-integration.js';
|
|
39
39
|
import { mcpDevServer } from './src/lib/mcp-dev-integration.js';
|
|
40
|
+
import { configReload } from './src/lib/config-reload-integration.js';
|
|
40
41
|
import { canonicalPath } from './src/lib/canonical-path.js';
|
|
41
42
|
import { folderAddresses } from './src/lib/folder-redirects.js';
|
|
42
43
|
import { report } from './src/lib/cli-report.js';
|
|
@@ -324,6 +325,8 @@ export default defineConfig({
|
|
|
324
325
|
// /mcp in `writedocs dev`, as the build's dist/_worker.js serves it -
|
|
325
326
|
// see src/lib/mcp-dev-integration.js.
|
|
326
327
|
mcpDevServer({ version: JSON.parse(fs.readFileSync(path.join(packageRoot, 'package.json'), 'utf-8')).version }),
|
|
328
|
+
// writedocs dev: an edit to writedocs.json reloads the open tab.
|
|
329
|
+
configReload({ configPath: path.join(contentDir, 'writedocs.json') }),
|
|
327
330
|
],
|
|
328
331
|
output: 'static',
|
|
329
332
|
// Dual Shiki themes for fenced code blocks (```) in MDX content, so
|
package/package.json
CHANGED
package/src/cli/dev.js
CHANGED
|
@@ -8,6 +8,7 @@ import { reportApiPages } from './api-pages-output.js';
|
|
|
8
8
|
import { runningPreview, writeLock, removeLock } from './dev-lock.js';
|
|
9
9
|
import { showUpdateNotice } from './update-check.js';
|
|
10
10
|
import { shouldOpenBrowser, openBrowser } from './open-browser.js';
|
|
11
|
+
import { watchPageList } from './page-list-watch.js';
|
|
11
12
|
|
|
12
13
|
// The same problem tends to arrive more than once in a row - Vite and
|
|
13
14
|
// Astro each log a failed page, and a page compiles for more than one
|
|
@@ -39,9 +40,13 @@ export async function runDev({ contentDir, packageRoot, port, verbose = false, o
|
|
|
39
40
|
reportApiPages(api);
|
|
40
41
|
api.warnings.forEach((message) => log.warn(message));
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
let starting = step('Starting local preview');
|
|
43
44
|
let ready = false;
|
|
44
45
|
let browserOpened = false;
|
|
46
|
+
// Restarting after pages were added or removed (see the watcher below):
|
|
47
|
+
// when that restart began, and the port to come back on.
|
|
48
|
+
let restartStarted = null;
|
|
49
|
+
let currentPort = port;
|
|
45
50
|
|
|
46
51
|
const lastShown = new Map();
|
|
47
52
|
const once = (key, print) => {
|
|
@@ -82,11 +87,7 @@ export async function runDev({ contentDir, packageRoot, port, verbose = false, o
|
|
|
82
87
|
|
|
83
88
|
let fatal = null;
|
|
84
89
|
const rawTail = [];
|
|
85
|
-
const
|
|
86
|
-
packageRoot,
|
|
87
|
-
contentDir,
|
|
88
|
-
port,
|
|
89
|
-
onEvent(event) {
|
|
90
|
+
const onEvent = (event) => {
|
|
90
91
|
if (verbose) {
|
|
91
92
|
const line = verboseLine(event);
|
|
92
93
|
if (line !== null) log.line(color.dim(line));
|
|
@@ -94,11 +95,24 @@ export async function runDev({ contentDir, packageRoot, port, verbose = false, o
|
|
|
94
95
|
switch (event.type) {
|
|
95
96
|
case 'ready': {
|
|
96
97
|
ready = true;
|
|
97
|
-
starting.succeed(`Preview ready ${color.dim(`in ${duration(Date.now() - started)}`)}`);
|
|
98
98
|
const [local] = event.urls?.local ?? [];
|
|
99
99
|
writeLock(packageRoot, { contentDir, url: local ?? null });
|
|
100
100
|
const wanted = Number(port ?? 4321);
|
|
101
101
|
const actual = local ? Number(new URL(local).port) : wanted;
|
|
102
|
+
currentPort = actual;
|
|
103
|
+
// Pages changed while it was starting: restart now that it's up.
|
|
104
|
+
if (restartPending) {
|
|
105
|
+
const change = restartPending;
|
|
106
|
+
restartPending = false;
|
|
107
|
+
setTimeout(() => restartForPages(change), 0);
|
|
108
|
+
}
|
|
109
|
+
// Back after a restart: one line - the open tab reloads by itself.
|
|
110
|
+
if (restartStarted !== null) {
|
|
111
|
+
starting.succeed(`Preview updated ${color.dim(`in ${duration(Date.now() - restartStarted)}`)}`);
|
|
112
|
+
restartStarted = null;
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
starting.succeed(`Preview ready ${color.dim(`in ${duration(Date.now() - started)}`)}`);
|
|
102
116
|
log.line();
|
|
103
117
|
log.line(` ${color.bold('Local:')} ${color.cyan(local ?? `http://localhost:${wanted}/`)}`);
|
|
104
118
|
if (actual !== wanted) log.line(color.dim(` Port ${wanted} was in use, so the preview is on ${actual}.`));
|
|
@@ -129,6 +143,14 @@ export async function runDev({ contentDir, packageRoot, port, verbose = false, o
|
|
|
129
143
|
if (rawTail.length > 40) rawTail.shift();
|
|
130
144
|
return;
|
|
131
145
|
case 'astro-log': {
|
|
146
|
+
// A page file just deleted: Astro's list of page modules
|
|
147
|
+
// (.astro/content-modules.mjs) still points at it for a moment -
|
|
148
|
+
// "Failed to load url ... Does the file exist?" - until the restart
|
|
149
|
+
// the page-list watcher starts brings in a fresh list. Noise, not a
|
|
150
|
+
// problem in the site. Every other error still shows, and a
|
|
151
|
+
// preview that can't start still reports through 'fatal'.
|
|
152
|
+
if (event.level === 'error' && /content-modules\.mjs/.test(event.message) && /Does the file exist/.test(event.message)) return;
|
|
153
|
+
if (restartStarted !== null && event.level === 'error') return;
|
|
132
154
|
if (event.level === 'error') {
|
|
133
155
|
showError(describeError(stripAnsi(event.message), contentDir, { root: packageRoot }));
|
|
134
156
|
return;
|
|
@@ -145,7 +167,36 @@ export async function runDev({ contentDir, packageRoot, port, verbose = false, o
|
|
|
145
167
|
return;
|
|
146
168
|
}
|
|
147
169
|
}
|
|
148
|
-
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
// Pages added or removed while the preview runs: its page list is read
|
|
173
|
+
// when it starts, so it restarts - on the same port; the open tab
|
|
174
|
+
// reconnects and reloads by itself. Edits to pages and to writedocs.json
|
|
175
|
+
// don't need this (lib/config-reload-integration.js).
|
|
176
|
+
let child = null;
|
|
177
|
+
let restarting = false;
|
|
178
|
+
let restartPending = false;
|
|
179
|
+
const restartForPages = ({ added, removed }) => {
|
|
180
|
+
const what = [
|
|
181
|
+
...added.slice(0, 3).map((file) => `${file} added`),
|
|
182
|
+
...removed.slice(0, 3).map((file) => `${file} removed`),
|
|
183
|
+
];
|
|
184
|
+
const more = added.length + removed.length - what.length;
|
|
185
|
+
log.info(`${what.join(', ')}${more > 0 ? ` and ${more} more` : ''} - restarting the preview so the page list is current.`);
|
|
186
|
+
restarting = true;
|
|
187
|
+
ready = false;
|
|
188
|
+
restartStarted = Date.now();
|
|
189
|
+
starting = step('Restarting the preview');
|
|
190
|
+
child?.kill();
|
|
191
|
+
};
|
|
192
|
+
const pageWatch = watchPageList(contentDir, (change) => {
|
|
193
|
+
if (stopping || restarting) return;
|
|
194
|
+
// Still starting: restart once it's up, not halfway.
|
|
195
|
+
if (!ready) {
|
|
196
|
+
restartPending = change;
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
restartForPages(change);
|
|
149
200
|
});
|
|
150
201
|
|
|
151
202
|
// Ctrl+C: stop the server quietly. (The child gets the same signal from
|
|
@@ -155,12 +206,23 @@ export async function runDev({ contentDir, packageRoot, port, verbose = false, o
|
|
|
155
206
|
const stop = () => {
|
|
156
207
|
if (stopping) process.exit(130);
|
|
157
208
|
stopping = true;
|
|
158
|
-
|
|
209
|
+
pageWatch.close();
|
|
210
|
+
child?.kill();
|
|
159
211
|
};
|
|
160
212
|
process.on('SIGINT', stop);
|
|
161
213
|
process.on('SIGTERM', stop);
|
|
162
214
|
|
|
163
|
-
|
|
215
|
+
let code;
|
|
216
|
+
for (;;) {
|
|
217
|
+
fatal = null;
|
|
218
|
+
rawTail.length = 0;
|
|
219
|
+
const run = runAstro('dev', { packageRoot, contentDir, port: currentPort, onEvent });
|
|
220
|
+
child = run.child;
|
|
221
|
+
code = await run.exited;
|
|
222
|
+
if (stopping || !restarting) break;
|
|
223
|
+
restarting = false;
|
|
224
|
+
}
|
|
225
|
+
pageWatch.close();
|
|
164
226
|
if (stopping) {
|
|
165
227
|
if (ready) log.line(color.dim('Preview stopped.'));
|
|
166
228
|
return;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// `writedocs dev`: noticing pages added or removed. The preview's list of page
|
|
2
|
+
// files is read once, when it starts (content.config.ts hands findAllPages()'s
|
|
3
|
+
// list to Astro) - an edit to a page shows up at once, but a new page stays
|
|
4
|
+
// "not found" and a deleted one keeps being served. So this watches the
|
|
5
|
+
// content folder, and when the list findAllPages() gives changes, calls
|
|
6
|
+
// `onChange` - cli/dev.js restarts the preview then.
|
|
7
|
+
//
|
|
8
|
+
// It compares the list itself, not file events: a Markdown file that isn't
|
|
9
|
+
// a page (no frontmatter, not in the navigation), an edit to a page, or a
|
|
10
|
+
// save that writes a file twice doesn't restart anything.
|
|
11
|
+
import fs from 'node:fs';
|
|
12
|
+
import { findAllPages, EXCLUDED_TOP_LEVEL_DIRS } from '../lib/pages.js';
|
|
13
|
+
|
|
14
|
+
/** Wait this long after the last file event before checking - a rename, a
|
|
15
|
+
* copy of several files or an editor's save arrive as a burst of events. */
|
|
16
|
+
export const SETTLE_MS = 400;
|
|
17
|
+
|
|
18
|
+
/** Whether a changed file can change the page list: a .md/.mdx file, or
|
|
19
|
+
* writedocs.json (it lists pages that have no frontmatter), outside the
|
|
20
|
+
* folders findAllPages() never looks in. */
|
|
21
|
+
export function mayChangePages(relative) {
|
|
22
|
+
if (!relative) return true;
|
|
23
|
+
const parts = String(relative).split(/[\\/]/);
|
|
24
|
+
if (EXCLUDED_TOP_LEVEL_DIRS.has(parts[0]) || parts.some((part) => part.startsWith('.'))) return false;
|
|
25
|
+
const name = parts[parts.length - 1];
|
|
26
|
+
return /\.mdx?$/i.test(name) || name === 'writedocs.json';
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Starts watching; returns `{ close }`. `onChange({ added, removed })` gets
|
|
30
|
+
* the page files (relative paths) that came and went. */
|
|
31
|
+
export function watchPageList(contentDir, onChange, { settleMs = SETTLE_MS } = {}) {
|
|
32
|
+
let current = new Set(findAllPages(contentDir));
|
|
33
|
+
let timer = null;
|
|
34
|
+
const check = () => {
|
|
35
|
+
let next;
|
|
36
|
+
try {
|
|
37
|
+
next = new Set(findAllPages(contentDir));
|
|
38
|
+
} catch {
|
|
39
|
+
return; // mid-save, or a folder being moved - the next event checks again
|
|
40
|
+
}
|
|
41
|
+
const added = [...next].filter((file) => !current.has(file));
|
|
42
|
+
const removed = [...current].filter((file) => !next.has(file));
|
|
43
|
+
if (!added.length && !removed.length) return;
|
|
44
|
+
current = next;
|
|
45
|
+
onChange({ added, removed });
|
|
46
|
+
};
|
|
47
|
+
let watcher;
|
|
48
|
+
try {
|
|
49
|
+
watcher = fs.watch(contentDir, { recursive: true }, (_event, filename) => {
|
|
50
|
+
if (!mayChangePages(filename)) return;
|
|
51
|
+
clearTimeout(timer);
|
|
52
|
+
timer = setTimeout(check, settleMs);
|
|
53
|
+
});
|
|
54
|
+
watcher.on('error', () => {});
|
|
55
|
+
} catch {
|
|
56
|
+
// A file system without recursive watching: pages added while `dev`
|
|
57
|
+
// runs need a restart, as before.
|
|
58
|
+
return { close() {} };
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
close() {
|
|
62
|
+
clearTimeout(timer);
|
|
63
|
+
watcher.close();
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
}
|
|
@@ -426,7 +426,7 @@ const securityJson = JSON.stringify(op?.security ?? []);
|
|
|
426
426
|
.wd-api-panel {
|
|
427
427
|
position: sticky;
|
|
428
428
|
top: var(--wd-topbar-offset, 5rem);
|
|
429
|
-
padding: 1.5rem
|
|
429
|
+
padding: 1.5rem 0 1.5rem 1rem;
|
|
430
430
|
max-height: calc(100vh - var(--wd-topbar-offset, 5rem));
|
|
431
431
|
overflow-y: auto;
|
|
432
432
|
display: flex;
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
// comment for the fuller rationale.
|
|
32
32
|
import { isExternalHref, type DocsConfig, type Selector, type GlobalDropdownView } from '../../lib/config';
|
|
33
33
|
import AppIcon from '../../components/AppIcon.astro';
|
|
34
|
-
import { hasMobileMenu } from '../../lib/selector-placement.js';
|
|
34
|
+
import { hasMobileMenu, currentOption } from '../../lib/selector-placement.js';
|
|
35
35
|
import '../styles/dropdown.css';
|
|
36
36
|
import '../styles/topbar.css';
|
|
37
37
|
import '../styles/mobile-menu.css';
|
|
@@ -101,7 +101,28 @@ const showMenu = hasMobileMenu({ sidebar: showSidebarCol, selectors, globalDropd
|
|
|
101
101
|
{(selectors.some((sel) => !sel.hidden) || globalDropdowns.length > 0) && (
|
|
102
102
|
<div class="wd-mobile-menu-selectors">
|
|
103
103
|
{selectors.filter((sel) => !sel.hidden).map((sel) => {
|
|
104
|
-
|
|
104
|
+
// The level under an item whose own page this is, with nothing
|
|
105
|
+
// chosen yet (landingSelectors() in lib/config.ts): its options
|
|
106
|
+
// as an open list - a closed one would repeat the item's name,
|
|
107
|
+
// already on the level above.
|
|
108
|
+
if (sel.placeholder && !sel.options.some((opt) => opt.active)) {
|
|
109
|
+
return (
|
|
110
|
+
<nav class="wd-mobile-menu-choices" aria-label={sel.placeholder.label}>
|
|
111
|
+
{sel.options.map((opt) => (
|
|
112
|
+
<a
|
|
113
|
+
href={opt.href}
|
|
114
|
+
target={isExternalHref(opt.href) ? '_blank' : undefined}
|
|
115
|
+
rel={isExternalHref(opt.href) ? 'noopener noreferrer' : undefined}
|
|
116
|
+
>
|
|
117
|
+
<AppIcon icon={opt.icon} class="wd-tab-icon" />
|
|
118
|
+
<span class="wd-mobile-accordion-option-label">{opt.label}</span>
|
|
119
|
+
{opt.tag && <span class="wd-selector-tag">{opt.tag}</span>}
|
|
120
|
+
</a>
|
|
121
|
+
))}
|
|
122
|
+
</nav>
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
const current = currentOption(sel);
|
|
105
126
|
return (
|
|
106
127
|
<details class="wd-mobile-accordion" name="wd-mobile-accordion">
|
|
107
128
|
<summary class="wd-mobile-accordion-trigger">
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { isExternalHref, type NavTreeNode, type Selector } from "../../lib/config";
|
|
3
3
|
import NavTree from "./NavTree.astro";
|
|
4
|
+
import { currentOption } from "../../lib/selector-placement.js";
|
|
4
5
|
import AppIcon from "../../components/AppIcon.astro";
|
|
5
6
|
// Two colorways of the same "Powered by writedocs" mark, not a
|
|
6
7
|
// theme-matched pair in the wd-logo-light/wd-logo-dark sense (that
|
|
@@ -42,7 +43,7 @@ const { navTree, hrefForSlug, currentSlug, switchers = [] } = Astro.props as Pro
|
|
|
42
43
|
|
|
43
44
|
<nav class="wd-sidebar">
|
|
44
45
|
{switchers.map((sel) => {
|
|
45
|
-
const current = sel
|
|
46
|
+
const current = currentOption(sel);
|
|
46
47
|
return (
|
|
47
48
|
<div class="wd-dropdown wd-sidebar-switcher" data-selector-kind={sel.kind}>
|
|
48
49
|
<button type="button" class="wd-dropdown-trigger wd-sidebar-switcher-trigger" aria-expanded="false">
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
// comment for the fuller rationale.
|
|
14
14
|
import { isExternalHref, type DocsConfig, type Selector, type GlobalDropdownView } from '../../lib/config';
|
|
15
15
|
import AppIcon from '../../components/AppIcon.astro';
|
|
16
|
-
import { selectorPlacements, hasMobileMenu } from '../../lib/selector-placement.js';
|
|
16
|
+
import { selectorPlacements, hasMobileMenu, currentOption } from '../../lib/selector-placement.js';
|
|
17
17
|
import '../styles/dropdown.css';
|
|
18
18
|
import '../styles/topbar.css';
|
|
19
19
|
|
|
@@ -105,7 +105,7 @@ const tabRows = tabSelectors.length > 0 ? tabSelectors : globalDropdowns.length
|
|
|
105
105
|
// trigger shows the *current* option, the menu lists the
|
|
106
106
|
// alternatives - unlike tabs, where every option is its own
|
|
107
107
|
// always-visible pill in the row below.
|
|
108
|
-
const current = sel
|
|
108
|
+
const current = currentOption(sel);
|
|
109
109
|
return (
|
|
110
110
|
<div class="wd-dropdown" data-selector-kind={sel.kind}>
|
|
111
111
|
<button type="button" class="wd-dropdown-trigger wd-switcher-trigger" aria-expanded="false">
|
|
@@ -258,6 +258,27 @@
|
|
|
258
258
|
font-size: 0.9rem;
|
|
259
259
|
}
|
|
260
260
|
.wd-mobile-menu-link:hover { background: var(--wd-surface); }
|
|
261
|
+
/* An item's options with none chosen (MobileMenu.astro) - an open list, in
|
|
262
|
+
one box like a closed level's row. */
|
|
263
|
+
.wd-mobile-menu-choices {
|
|
264
|
+
display: flex;
|
|
265
|
+
flex-direction: column;
|
|
266
|
+
gap: 0.15rem;
|
|
267
|
+
padding: 0.3rem;
|
|
268
|
+
border: 1px solid var(--wd-border);
|
|
269
|
+
border-radius: 0.5rem;
|
|
270
|
+
}
|
|
271
|
+
.wd-mobile-menu-choices a {
|
|
272
|
+
display: flex;
|
|
273
|
+
align-items: center;
|
|
274
|
+
gap: 0.5rem;
|
|
275
|
+
padding: 0.5rem 0.45rem;
|
|
276
|
+
border-radius: 0.4rem;
|
|
277
|
+
text-decoration: none;
|
|
278
|
+
color: var(--wd-navbar-foreground);
|
|
279
|
+
font-size: 0.9rem;
|
|
280
|
+
}
|
|
281
|
+
.wd-mobile-menu-choices a:hover { background: var(--wd-surface); }
|
|
261
282
|
/* The sidebar copy living in here needs none of .wd-sidebar-col's own
|
|
262
283
|
column sizing (width/border/min-height) - it's just flowing content
|
|
263
284
|
inside an already-padded, already-scrollable panel. */
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// `writedocs dev`: an edit to writedocs.json reloads the open tab. The server
|
|
2
|
+
// already renders with the new file on the next request (lib/config.ts reads
|
|
3
|
+
// it each time), but nothing told the browser - the tab kept the old
|
|
4
|
+
// navigation until reloaded by hand. writedocs.json sits in the content
|
|
5
|
+
// folder, outside what Vite watches, so it's added to the watcher here, and
|
|
6
|
+
// a change sends Vite's full-reload.
|
|
7
|
+
//
|
|
8
|
+
// Pages added or removed need more than a reload - see cli/page-list-watch.js.
|
|
9
|
+
import path from 'node:path';
|
|
10
|
+
|
|
11
|
+
/** Wait this long after the last change before reloading - an editor's save
|
|
12
|
+
* can arrive as more than one write. */
|
|
13
|
+
export const RELOAD_DELAY_MS = 150;
|
|
14
|
+
|
|
15
|
+
export function configReload({ configPath }) {
|
|
16
|
+
return {
|
|
17
|
+
name: 'writedocs-config-reload',
|
|
18
|
+
hooks: {
|
|
19
|
+
'astro:server:setup': ({ server }) => {
|
|
20
|
+
const target = path.resolve(configPath);
|
|
21
|
+
const same = (file) => path.resolve(file).toLowerCase() === target.toLowerCase();
|
|
22
|
+
server.watcher.add(target);
|
|
23
|
+
let timer = null;
|
|
24
|
+
server.watcher.on('change', (file) => {
|
|
25
|
+
if (!same(file)) return;
|
|
26
|
+
clearTimeout(timer);
|
|
27
|
+
timer = setTimeout(() => server.ws.send({ type: 'full-reload', path: '*' }), RELOAD_DELAY_MS);
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
package/src/lib/config-schema.js
CHANGED
|
@@ -33,7 +33,7 @@ const navItemSchema = z.lazy(
|
|
|
33
33
|
() => z.union([navPageSchema, navGroupSchema, navLinkSchema])
|
|
34
34
|
);
|
|
35
35
|
function withChildren(ownFields) {
|
|
36
|
-
const base = { ...ownFields, hidden: z.boolean().optional(), searchPublic: z.boolean().optional() };
|
|
36
|
+
const base = { ...ownFields, hidden: z.boolean().optional(), searchPublic: z.boolean().optional(), page: z.string().optional() };
|
|
37
37
|
return z.union([
|
|
38
38
|
z.object({ ...base, pages: z.array(navItemSchema) }).strict(),
|
|
39
39
|
z.object({ ...base, tabs: z.array(tabSchema).min(1) }).strict(),
|
|
@@ -99,6 +99,13 @@ const navigationSchema = z.union([
|
|
|
99
99
|
}
|
|
100
100
|
items.forEach((item, i) => {
|
|
101
101
|
const own2 = item;
|
|
102
|
+
if (own2?.page !== void 0 && own2.href !== void 0) {
|
|
103
|
+
ctx.addIssue({
|
|
104
|
+
code: "custom",
|
|
105
|
+
path: [...path, key, i, "page"],
|
|
106
|
+
message: "An item with `href` is a link, so it has no page of its own - remove `page`, or `href`."
|
|
107
|
+
});
|
|
108
|
+
}
|
|
102
109
|
if (own2?.searchPublic === true && own2.hidden !== true) {
|
|
103
110
|
ctx.addIssue({
|
|
104
111
|
code: "custom",
|
package/src/lib/config-schema.ts
CHANGED
|
@@ -132,8 +132,12 @@ export type NavChildren =
|
|
|
132
132
|
/** Any navigation item can be hidden: reachable only by its address - no
|
|
133
133
|
* switcher, tab or menu lists it, and its pages search only among
|
|
134
134
|
* themselves (plus the public ones, with `searchPublic`). See
|
|
135
|
-
* lib/hidden-sections.js.
|
|
136
|
-
|
|
135
|
+
* lib/hidden-sections.js.
|
|
136
|
+
* And any can have a `page` of its own: where choosing the item leads, in
|
|
137
|
+
* place of its first page - an overview of what's in it. In a sidebar too,
|
|
138
|
+
* it opens there; otherwise it opens inside the item (resolveLandings() in
|
|
139
|
+
* lib/config.ts). */
|
|
140
|
+
export type Hideable = { hidden?: boolean; searchPublic?: boolean; page?: string };
|
|
137
141
|
|
|
138
142
|
export type TabItem = { tab: string; icon?: string } & Hideable & NavChildren;
|
|
139
143
|
export type VersionItem = { version: string; label?: string; tag?: string; default?: boolean } & Hideable & NavChildren;
|
|
@@ -149,7 +153,7 @@ export type ProductItem = { product: string; icon?: string; description?: string
|
|
|
149
153
|
// rule this schema exists to enforce (mirroring Mintlify's own "a tab
|
|
150
154
|
// cannot contain both anchors and groups at the same level").
|
|
151
155
|
function withChildren<Base extends z.ZodRawShape>(ownFields: Base) {
|
|
152
|
-
const base = { ...ownFields, hidden: z.boolean().optional(), searchPublic: z.boolean().optional() };
|
|
156
|
+
const base = { ...ownFields, hidden: z.boolean().optional(), searchPublic: z.boolean().optional(), page: z.string().optional() };
|
|
153
157
|
return z.union([
|
|
154
158
|
z.object({ ...base, pages: z.array(navItemSchema) }).strict(),
|
|
155
159
|
z.object({ ...base, tabs: z.array(tabSchema).min(1) }).strict(),
|
|
@@ -254,7 +258,14 @@ const navigationSchema = z.union([
|
|
|
254
258
|
continue;
|
|
255
259
|
}
|
|
256
260
|
items.forEach((item, i) => {
|
|
257
|
-
const own = item as { hidden?: unknown; searchPublic?: unknown };
|
|
261
|
+
const own = item as { hidden?: unknown; searchPublic?: unknown; page?: unknown; href?: unknown };
|
|
262
|
+
if (own?.page !== undefined && own.href !== undefined) {
|
|
263
|
+
ctx.addIssue({
|
|
264
|
+
code: 'custom',
|
|
265
|
+
path: [...path, key, i, 'page'],
|
|
266
|
+
message: 'An item with `href` is a link, so it has no page of its own - remove `page`, or `href`.',
|
|
267
|
+
});
|
|
268
|
+
}
|
|
258
269
|
if (own?.searchPublic === true && own.hidden !== true) {
|
|
259
270
|
ctx.addIssue({
|
|
260
271
|
code: 'custom',
|
package/src/lib/config.ts
CHANGED
|
@@ -2,6 +2,7 @@ import fs from 'node:fs';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { EXCLUDED_TOP_LEVEL_DIRS, navPageId } from './pages.js';
|
|
4
4
|
import { isHidden } from './hidden-sections.js';
|
|
5
|
+
import { itemPage, childLevel, resolveLandings as resolveLandingsJs } from './item-pages.js';
|
|
5
6
|
import matter from 'gray-matter';
|
|
6
7
|
import { writedocsTempDir } from './writedocs-temp-dir.js';
|
|
7
8
|
import { readableTextOn } from './color.js';
|
|
@@ -758,6 +759,58 @@ export function resolveSections(navigation: NavigationConfig): Section[] {
|
|
|
758
759
|
return sections;
|
|
759
760
|
}
|
|
760
761
|
|
|
762
|
+
// --- An item's own page ------------------------------------------------
|
|
763
|
+
//
|
|
764
|
+
// A tab, version, language, dropdown or product can have a `page`: choosing
|
|
765
|
+
// the item opens it (firstSlugOf() above). How such a page is shown when no
|
|
766
|
+
// sidebar lists it - inside its item - is lib/item-pages.js; the route is
|
|
767
|
+
// landingRoutes in [...slug].astro.
|
|
768
|
+
|
|
769
|
+
export interface Landing {
|
|
770
|
+
/** The page's id. */
|
|
771
|
+
slug: string;
|
|
772
|
+
/** The levels down to the item, the item last. */
|
|
773
|
+
path: PathSegment[];
|
|
774
|
+
/** The item's own sidebar - empty when it holds tabs, products, ... */
|
|
775
|
+
pages: NavItem[];
|
|
776
|
+
item: NamedContainer;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
export function resolveLandings(navigation: NavigationConfig): Landing[] {
|
|
780
|
+
return resolveLandingsJs(navigation) as Landing[];
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
/** The selectors for an item's own page shown inside the item: the levels
|
|
784
|
+
* down to the item, as for any page, plus the item's own options with none
|
|
785
|
+
* chosen - the switcher shows the item's name until the reader picks one
|
|
786
|
+
* (`placeholder`, currentOption() in lib/selector-placement.js). */
|
|
787
|
+
export function landingSelectors(landing: Landing, hrefForSlug: (slug: string) => string): Selector[] {
|
|
788
|
+
const selectors = buildSelectors(landing.path, hrefForSlug);
|
|
789
|
+
const level = childLevel(landing.item) as { kind: PathSegment['kind']; items: NamedContainer[] } | null;
|
|
790
|
+
if (!level) return selectors;
|
|
791
|
+
selectors.push({
|
|
792
|
+
kind: level.kind,
|
|
793
|
+
placeholder: {
|
|
794
|
+
label: labelOf(landing.item),
|
|
795
|
+
icon: iconOf(landing.item),
|
|
796
|
+
description: 'description' in landing.item ? landing.item.description : undefined,
|
|
797
|
+
},
|
|
798
|
+
options: level.items.flatMap((child) => {
|
|
799
|
+
if (isHidden(child)) return [];
|
|
800
|
+
return {
|
|
801
|
+
label: labelOf(child),
|
|
802
|
+
icon: iconOf(child),
|
|
803
|
+
tag: 'tag' in child ? child.tag : undefined,
|
|
804
|
+
description: 'description' in child ? child.description : undefined,
|
|
805
|
+
href: 'href' in child ? child.href : hrefForSlug(firstSlugOf(child as Container) ?? 'index'),
|
|
806
|
+
active: false,
|
|
807
|
+
dropdown: dropdownMenuOf(child as Container, hrefForSlug, undefined),
|
|
808
|
+
};
|
|
809
|
+
}),
|
|
810
|
+
});
|
|
811
|
+
return selectors;
|
|
812
|
+
}
|
|
813
|
+
|
|
761
814
|
/** Which Section (by index into resolveSections()'s result) a page belongs to. */
|
|
762
815
|
export function findSectionIndexForSlug(sections: Section[], slug: string): number {
|
|
763
816
|
const index = sections.findIndex((s) => flattenNav(s.pages).some((entry) => entry.slug === slug));
|
|
@@ -797,6 +850,9 @@ function firstSlugAmong(items: Container[]): string | null {
|
|
|
797
850
|
}
|
|
798
851
|
|
|
799
852
|
export function firstSlugOf(node: Container): string | null {
|
|
853
|
+
// An item with a `page` of its own opens there (lib/item-pages.js).
|
|
854
|
+
const own = itemPage(node);
|
|
855
|
+
if (own !== null) return own;
|
|
800
856
|
if ('pages' in node) return flattenNav(node.pages)[0]?.slug ?? null;
|
|
801
857
|
if ('href' in node) return null;
|
|
802
858
|
if ('tabs' in node) return firstSlugAmong(node.tabs);
|
|
@@ -952,6 +1008,10 @@ export interface Selector {
|
|
|
952
1008
|
// not dropped, so the levels after it are placed by their real parent
|
|
953
1009
|
// (lib/selector-placement.js).
|
|
954
1010
|
hidden?: boolean;
|
|
1011
|
+
// No option is chosen on this level - the page is an item's own page,
|
|
1012
|
+
// shown above its options (landingSelectors()). A switcher shows this
|
|
1013
|
+
// instead of a current option (currentOption() in lib/selector-placement.js).
|
|
1014
|
+
placeholder?: { label: string; icon?: string; description?: string };
|
|
955
1015
|
}
|
|
956
1016
|
|
|
957
1017
|
/** An option's own `dropdowns` menu, if it has one (see SelectorOption.dropdown
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// An item's own page: a tab, version, language, dropdown or product with a
|
|
2
|
+
// `page` opens that page when it's chosen, in place of its first page - an
|
|
3
|
+
// overview of what's in it.
|
|
4
|
+
//
|
|
5
|
+
// - The page is also in a sidebar: it's shown there, like any page.
|
|
6
|
+
// - It isn't: it's shown inside the item. The item is the current one on its
|
|
7
|
+
// level, the level under it (when the item holds tabs, products, ...) lists
|
|
8
|
+
// its options with none chosen, and the sidebar is the item's own `pages`,
|
|
9
|
+
// when it has them (landingSelectors() in lib/config.ts, landingRoutes in
|
|
10
|
+
// src/pages/[...slug].astro).
|
|
11
|
+
//
|
|
12
|
+
// Plain JavaScript, so scripts/item-pages.test.js can import it.
|
|
13
|
+
|
|
14
|
+
/** Each kind of list an item can hold, with the field naming its items. */
|
|
15
|
+
export const CHILD_KINDS = [
|
|
16
|
+
['tabs', 'tab'],
|
|
17
|
+
['versions', 'version'],
|
|
18
|
+
['languages', 'language'],
|
|
19
|
+
['dropdowns', 'dropdown'],
|
|
20
|
+
['products', 'product'],
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
/** The item's own page id, or null - an `href` item is a link, with none. */
|
|
24
|
+
export function itemPage(item) {
|
|
25
|
+
if (!item || typeof item !== 'object' || 'href' in item) return null;
|
|
26
|
+
return typeof item.page === 'string' ? item.page : null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** The list of items an item holds - `{ kind, items }` - or null when it
|
|
30
|
+
* holds `pages` (a sidebar) or is a link. */
|
|
31
|
+
export function childLevel(item) {
|
|
32
|
+
if (!item || typeof item !== 'object') return null;
|
|
33
|
+
for (const [key, kind] of CHILD_KINDS) {
|
|
34
|
+
if (Array.isArray(item[key])) return { kind, items: item[key] };
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** The name an item shows: a version's or language's `label` when it has one. */
|
|
40
|
+
export function itemLabel(item) {
|
|
41
|
+
if ('tab' in item) return item.tab;
|
|
42
|
+
if ('version' in item) return item.label ?? item.version;
|
|
43
|
+
if ('language' in item) return item.label ?? item.language;
|
|
44
|
+
if ('dropdown' in item) return item.dropdown;
|
|
45
|
+
return item.product;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Every item with a page of its own, in navigation order:
|
|
49
|
+
* `{ slug, path, pages, item }`, where `path` is the levels down to the item
|
|
50
|
+
* (the same `{ kind, items, index }` segments resolveSections() builds),
|
|
51
|
+
* and `pages` the item's own sidebar - empty when it holds a list instead.
|
|
52
|
+
* When two items name the same page, the first one keeps it. */
|
|
53
|
+
export function resolveLandings(navigation) {
|
|
54
|
+
const out = [];
|
|
55
|
+
const seen = new Set();
|
|
56
|
+
const walk = (node, path) => {
|
|
57
|
+
const level = childLevel(node);
|
|
58
|
+
if (!level) return;
|
|
59
|
+
level.items.forEach((item, index) => {
|
|
60
|
+
const itemPath = [...path, { kind: level.kind, items: level.items, index }];
|
|
61
|
+
const slug = itemPage(item);
|
|
62
|
+
if (slug !== null && !seen.has(slug)) {
|
|
63
|
+
seen.add(slug);
|
|
64
|
+
out.push({ slug, path: itemPath, pages: Array.isArray(item.pages) ? item.pages : [], item });
|
|
65
|
+
}
|
|
66
|
+
walk(item, itemPath);
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
if (navigation && !Array.isArray(navigation)) walk(navigation, []);
|
|
70
|
+
return out;
|
|
71
|
+
}
|
|
@@ -46,6 +46,7 @@ const CONTAINERS = {
|
|
|
46
46
|
const HIDDEN = {
|
|
47
47
|
hidden: 'Reachable only by its address: no tab, switcher or menu lists it, and inside it this level isn\'t shown. Its pages search only among themselves.',
|
|
48
48
|
searchPublic: 'For a hidden item: its search also finds the site\'s public pages.',
|
|
49
|
+
page: 'A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.',
|
|
49
50
|
};
|
|
50
51
|
|
|
51
52
|
const containerEntries = Object.entries(CONTAINERS).flatMap(([type, fields]) => [
|
package/src/lib/llms.js
CHANGED
|
@@ -73,7 +73,10 @@ export function buildLlmsTree(navigation, pageFor, unlisted = []) {
|
|
|
73
73
|
.filter((child) => child && typeof child === 'object' && !('href' in child))
|
|
74
74
|
.map((child) => {
|
|
75
75
|
const label = labelKey === 'version' || labelKey === 'language' ? child.label ?? child[labelKey] : child[labelKey];
|
|
76
|
-
|
|
76
|
+
// An item's own `page` (an overview) comes first, like a group's.
|
|
77
|
+
const own = typeof child.page === 'string' ? page(child.page) : null;
|
|
78
|
+
const inner = fromContainer(child);
|
|
79
|
+
return { label: String(label), ...inner, items: own ? [own, ...inner.items] : inner.items };
|
|
77
80
|
})
|
|
78
81
|
.filter(prune);
|
|
79
82
|
return { items: [], sections };
|
package/src/lib/mcp-index.ts
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
resolveSiteUrl,
|
|
15
15
|
fileIdForEntry,
|
|
16
16
|
resolveSections,
|
|
17
|
+
resolveLandings,
|
|
17
18
|
flattenNav,
|
|
18
19
|
} from './config';
|
|
19
20
|
import { pageMarkdown } from './openapi-markdown';
|
|
@@ -53,9 +54,13 @@ export async function mcpIndex(): Promise<McpIndex> {
|
|
|
53
54
|
|
|
54
55
|
// The version and language each page sits under, from its section's path
|
|
55
56
|
// through the navigation (tabs > versions > languages > ...).
|
|
57
|
+
// An item's own page that no sidebar lists sits under that item.
|
|
56
58
|
const sections = resolveSections(config.navigation);
|
|
59
|
+
const landings = resolveLandings(config.navigation);
|
|
57
60
|
const placeOf = (fileId: string) => {
|
|
58
|
-
const section =
|
|
61
|
+
const section =
|
|
62
|
+
sections.find((s) => flattenNav(s.pages).some((e) => e.slug === fileId)) ??
|
|
63
|
+
landings.find((landing) => landing.slug === fileId);
|
|
59
64
|
const place = { version: '', language: '' };
|
|
60
65
|
for (const segment of section?.path ?? []) {
|
|
61
66
|
const item = segment.items[segment.index] as { version?: string; language?: string };
|
|
@@ -31,3 +31,11 @@ export function selectorPlacements(selectors, { sidebar = true } = {}) {
|
|
|
31
31
|
export function hasMobileMenu({ sidebar, selectors = [], globalDropdowns = [] }) {
|
|
32
32
|
return sidebar || selectors.some((sel) => !sel.hidden) || globalDropdowns.length > 0;
|
|
33
33
|
}
|
|
34
|
+
|
|
35
|
+
/** What a switcher's button shows: the chosen option - or, on the level
|
|
36
|
+
* under an item whose own page the reader is on, where none is chosen, the
|
|
37
|
+
* selector's `placeholder` (the item's name - landingSelectors() in
|
|
38
|
+
* lib/config.ts). Falls back to the first option. */
|
|
39
|
+
export function currentOption(selector) {
|
|
40
|
+
return selector.options.find((option) => option.active) ?? selector.placeholder ?? selector.options[0];
|
|
41
|
+
}
|
|
@@ -19,6 +19,8 @@ import {
|
|
|
19
19
|
contextMenuOptions,
|
|
20
20
|
resolveSiteUrl,
|
|
21
21
|
findAllPages,
|
|
22
|
+
resolveLandings,
|
|
23
|
+
landingSelectors,
|
|
22
24
|
} from "../lib/config";
|
|
23
25
|
import { writedocsTempDir } from "../lib/writedocs-temp-dir.js";
|
|
24
26
|
import { parseOpenApiRef } from "../lib/openapi-ref.js";
|
|
@@ -72,6 +74,7 @@ import ApiReferencePanel from "../components/ApiReferencePanel.astro";
|
|
|
72
74
|
import { searchScope, sectionTrail, ALL_SCOPES } from "../lib/search-scope.js";
|
|
73
75
|
import { selectorPlacements } from "../lib/selector-placement.js";
|
|
74
76
|
import { spaceOf } from "../lib/hidden-sections.js";
|
|
77
|
+
import { navigationPageOrder } from "../lib/pages.js";
|
|
75
78
|
import { folderRedirects } from "../lib/folder-redirects.js";
|
|
76
79
|
|
|
77
80
|
// A page is hand-written (the `pages` collection, sourced from anywhere
|
|
@@ -231,6 +234,36 @@ export async function getStaticPaths() {
|
|
|
231
234
|
});
|
|
232
235
|
});
|
|
233
236
|
|
|
237
|
+
// An item's own page (a tab's, a dropdown's, ... `page` - resolveLandings()
|
|
238
|
+
// in lib/config.ts) that no sidebar lists: shown inside its item. One the
|
|
239
|
+
// sidebar does list was routed above, in its sidebar. Its Next is the
|
|
240
|
+
// item's first sidebar page, if the item has a sidebar of its own.
|
|
241
|
+
const landings = resolveLandings(config.navigation);
|
|
242
|
+
const landingRoutes = landings.flatMap((landing, landingIndex) => {
|
|
243
|
+
if (claimedFileIds.has(landing.slug)) return [];
|
|
244
|
+
const entry = entryByFileId.get(landing.slug);
|
|
245
|
+
if (!entry) {
|
|
246
|
+
const last = landing.path[landing.path.length - 1];
|
|
247
|
+
const item = landing.item as Record<string, unknown>;
|
|
248
|
+
const name = (item.tab ?? item.version ?? item.language ?? item.dropdown ?? item.product) as string;
|
|
249
|
+
throw new Error(
|
|
250
|
+
`[writedocs] writedocs.json's ${last.kind} "${name}" names page "${landing.slug}" as its own page,` +
|
|
251
|
+
` but no matching file was found`,
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
claimedFileIds.add(landing.slug);
|
|
255
|
+
const next =
|
|
256
|
+
flattenNav(landing.pages).find((e) => {
|
|
257
|
+
const data = entryByFileId.get(e.slug)?.data;
|
|
258
|
+
return Boolean(data) && !data!.hidden && !data!.url;
|
|
259
|
+
}) ?? null;
|
|
260
|
+
const urlSlug = normalizeEntryId(entry.id);
|
|
261
|
+
if (entry.data.url) {
|
|
262
|
+
return [{ params: { slug: urlSlug === "index" ? undefined : urlSlug }, props: { redirectTo: entry.data.url } }];
|
|
263
|
+
}
|
|
264
|
+
return [{ params: { slug: urlSlug === "index" ? undefined : urlSlug }, props: { entry, prev: null, next, landingIndex } }];
|
|
265
|
+
});
|
|
266
|
+
|
|
234
267
|
// "Hidden" pages: any file the `pages`/`generatedDocs` collections
|
|
235
268
|
// picked up that writedocs.json's navigation never references (see
|
|
236
269
|
// claimedFileIds above) still gets a real route here - just with no
|
|
@@ -264,13 +297,24 @@ export async function getStaticPaths() {
|
|
|
264
297
|
const slugOf = (route: { params: { slug?: string } }) => route.params.slug ?? "index";
|
|
265
298
|
const inHiddenSection = sections.map((section) => spaceOf(section.path) !== null);
|
|
266
299
|
const contentRoutes = pageRoutes.filter((route) => !("redirectTo" in route.props));
|
|
300
|
+
// An item's own page counts where the navigation names it: before the
|
|
301
|
+
// item's sidebar (navigationPageOrder()), so `/guides/` opens the Guides
|
|
302
|
+
// tab's own page rather than its first sidebar page.
|
|
303
|
+
type ContentRoute = { params: { slug?: string }; props: { entry?: DocsEntry; sectionIndex?: number; landingIndex?: number } };
|
|
304
|
+
const navOrder = new Map(navigationPageOrder(config.navigation).map((id, i) => [id, i]));
|
|
305
|
+
const orderOf = (route: ContentRoute) => navOrder.get(fileIdForEntry(contentDir, packageRoot, route.props.entry!)) ?? Infinity;
|
|
306
|
+
const inHiddenItem = (route: ContentRoute) =>
|
|
307
|
+
route.props.landingIndex !== undefined
|
|
308
|
+
? spaceOf(landings[route.props.landingIndex].path) !== null
|
|
309
|
+
: inHiddenSection[route.props.sectionIndex!];
|
|
310
|
+
const navContent = [...contentRoutes, ...landingRoutes.filter((route) => !("redirectTo" in route.props))] as ContentRoute[];
|
|
267
311
|
const folderTargets = [
|
|
268
|
-
...
|
|
269
|
-
...
|
|
312
|
+
...navContent.filter((route) => !inHiddenItem(route)).sort((a, b) => orderOf(a) - orderOf(b)).map(slugOf),
|
|
313
|
+
...navContent.filter(inHiddenItem).sort((a, b) => orderOf(a) - orderOf(b)).map(slugOf),
|
|
270
314
|
...hiddenRoutes.map(slugOf),
|
|
271
315
|
];
|
|
272
316
|
const takenAddresses = new Set([
|
|
273
|
-
...[...pageRoutes, ...hiddenRoutes].map(slugOf),
|
|
317
|
+
...[...pageRoutes, ...landingRoutes, ...hiddenRoutes].map(slugOf),
|
|
274
318
|
...(config.redirects ?? []).map((r) => r.source.replace(/^\/+|\/+$/g, "")),
|
|
275
319
|
]);
|
|
276
320
|
const folderRoutes = [...folderRedirects(folderTargets, takenAddresses)].map(([folder, target]) => ({
|
|
@@ -278,7 +322,7 @@ export async function getStaticPaths() {
|
|
|
278
322
|
props: { redirectTo: `/${target}/`, temporary: true },
|
|
279
323
|
}));
|
|
280
324
|
|
|
281
|
-
return [...rootRedirect, ...pageRoutes, ...hiddenRoutes, ...folderRoutes];
|
|
325
|
+
return [...rootRedirect, ...pageRoutes, ...landingRoutes, ...hiddenRoutes, ...folderRoutes];
|
|
282
326
|
}
|
|
283
327
|
|
|
284
328
|
interface Props {
|
|
@@ -296,6 +340,9 @@ interface Props {
|
|
|
296
340
|
// section's sidebar contents, which would misleadingly suggest the page
|
|
297
341
|
// belongs there.
|
|
298
342
|
isHidden?: boolean;
|
|
343
|
+
// Set by landingRoutes in getStaticPaths above - an item's own page that
|
|
344
|
+
// no sidebar lists, shown inside that item (index into resolveLandings()).
|
|
345
|
+
landingIndex?: number;
|
|
299
346
|
}
|
|
300
347
|
|
|
301
348
|
const rawProps = Astro.props as Props;
|
|
@@ -316,6 +363,7 @@ const {
|
|
|
316
363
|
next = null,
|
|
317
364
|
sectionIndex = 0,
|
|
318
365
|
isHidden = false,
|
|
366
|
+
landingIndex,
|
|
319
367
|
} = rawProps as Required<Props>;
|
|
320
368
|
|
|
321
369
|
const contentDir = process.env.WRITEDOCS_CONTENT_DIR || process.cwd();
|
|
@@ -327,7 +375,10 @@ const sections = resolveSections(config.navigation);
|
|
|
327
375
|
// getStaticPaths above) on a site whose writedocs.json has no navigation
|
|
328
376
|
// sections at all, which previously could never produce a route to
|
|
329
377
|
// render in the first place.
|
|
330
|
-
|
|
378
|
+
// An item's own page shown inside its item (landingRoutes above): the item's
|
|
379
|
+
// path, and its own sidebar if it has one.
|
|
380
|
+
const landing = landingIndex === undefined ? undefined : resolveLandings(config.navigation)[landingIndex];
|
|
381
|
+
const activeSection = landing ? { pages: landing.pages, path: landing.path } : sections[sectionIndex] ?? { pages: [], path: [] };
|
|
331
382
|
|
|
332
383
|
const { Content, headings } = await render(entry);
|
|
333
384
|
const tocHeadings = headings.filter((h) => h.depth === 2 || h.depth === 3);
|
|
@@ -401,7 +452,8 @@ const activePagePosition = flattenNav(activeSection.pages).findIndex((e) => e.sl
|
|
|
401
452
|
// versions, languages, products, or a dropdown nested partway down),
|
|
402
453
|
// plus the always-visible global dropdown list - see BaseLayout.astro
|
|
403
454
|
// for how each renders.
|
|
404
|
-
|
|
455
|
+
// An item's own page also gets the level under the item, with nothing chosen.
|
|
456
|
+
const selectors = landing ? landingSelectors(landing, hrefForSlug) : buildSelectors(activeSection.path, hrefForSlug, activePagePosition);
|
|
405
457
|
// <html lang>: the `language` of the navigation level this page sits under,
|
|
406
458
|
// if any. A hidden page has no level of its own (activeSection is only a
|
|
407
459
|
// fallback for its chrome), so it keeps the default.
|
|
@@ -445,7 +497,13 @@ const currentPath = hrefForSlug(currentFileId);
|
|
|
445
497
|
// the sidebar (and ToC) while keeping the topbar and normal article
|
|
446
498
|
// styling. Only a *default*: a hidden page's own frontmatter mode, if
|
|
447
499
|
// it set one explicitly, still wins.
|
|
448
|
-
|
|
500
|
+
// An item's own page with nothing for a sidebar - the item holds tabs, or
|
|
501
|
+
// versions, ... that switch elsewhere - is laid out the same way.
|
|
502
|
+
const landingWithoutSidebar =
|
|
503
|
+
landing !== undefined &&
|
|
504
|
+
flattenNav(landing.pages).length === 0 &&
|
|
505
|
+
!selectorPlacements(selectors, { sidebar: true }).includes("sidebar");
|
|
506
|
+
const pageMode = (isHidden || landingWithoutSidebar) && entry.data.mode === "default" ? "frame" : entry.data.mode;
|
|
449
507
|
const showSidebar = pageMode === "default" || pageMode === "wide";
|
|
450
508
|
// Products inside a tab or dropdown switch at the top of the sidebar, not in
|
|
451
509
|
// the top bar (lib/selector-placement.js - TopBar.astro applies the same rule).
|
package/writedocs.schema.json
CHANGED
|
@@ -1210,6 +1210,11 @@
|
|
|
1210
1210
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
1211
1211
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
1212
1212
|
},
|
|
1213
|
+
"page": {
|
|
1214
|
+
"type": "string",
|
|
1215
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
1216
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
1217
|
+
},
|
|
1213
1218
|
"pages": {
|
|
1214
1219
|
"type": "array",
|
|
1215
1220
|
"items": {
|
|
@@ -1248,6 +1253,11 @@
|
|
|
1248
1253
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
1249
1254
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
1250
1255
|
},
|
|
1256
|
+
"page": {
|
|
1257
|
+
"type": "string",
|
|
1258
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
1259
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
1260
|
+
},
|
|
1251
1261
|
"tabs": {
|
|
1252
1262
|
"minItems": 1,
|
|
1253
1263
|
"type": "array",
|
|
@@ -1287,6 +1297,11 @@
|
|
|
1287
1297
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
1288
1298
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
1289
1299
|
},
|
|
1300
|
+
"page": {
|
|
1301
|
+
"type": "string",
|
|
1302
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
1303
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
1304
|
+
},
|
|
1290
1305
|
"versions": {
|
|
1291
1306
|
"minItems": 1,
|
|
1292
1307
|
"type": "array",
|
|
@@ -1326,6 +1341,11 @@
|
|
|
1326
1341
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
1327
1342
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
1328
1343
|
},
|
|
1344
|
+
"page": {
|
|
1345
|
+
"type": "string",
|
|
1346
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
1347
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
1348
|
+
},
|
|
1329
1349
|
"languages": {
|
|
1330
1350
|
"minItems": 1,
|
|
1331
1351
|
"type": "array",
|
|
@@ -1365,6 +1385,11 @@
|
|
|
1365
1385
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
1366
1386
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
1367
1387
|
},
|
|
1388
|
+
"page": {
|
|
1389
|
+
"type": "string",
|
|
1390
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
1391
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
1392
|
+
},
|
|
1368
1393
|
"dropdowns": {
|
|
1369
1394
|
"minItems": 1,
|
|
1370
1395
|
"type": "array",
|
|
@@ -1404,6 +1429,11 @@
|
|
|
1404
1429
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
1405
1430
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
1406
1431
|
},
|
|
1432
|
+
"page": {
|
|
1433
|
+
"type": "string",
|
|
1434
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
1435
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
1436
|
+
},
|
|
1407
1437
|
"products": {
|
|
1408
1438
|
"minItems": 1,
|
|
1409
1439
|
"type": "array",
|
|
@@ -1443,6 +1473,11 @@
|
|
|
1443
1473
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
1444
1474
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
1445
1475
|
},
|
|
1476
|
+
"page": {
|
|
1477
|
+
"type": "string",
|
|
1478
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
1479
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
1480
|
+
},
|
|
1446
1481
|
"href": {
|
|
1447
1482
|
"type": "string",
|
|
1448
1483
|
"description": "Makes this a link to another address instead of a section with pages of its own.",
|
|
@@ -1484,6 +1519,11 @@
|
|
|
1484
1519
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
1485
1520
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
1486
1521
|
},
|
|
1522
|
+
"page": {
|
|
1523
|
+
"type": "string",
|
|
1524
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
1525
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
1526
|
+
},
|
|
1487
1527
|
"pages": {
|
|
1488
1528
|
"type": "array",
|
|
1489
1529
|
"items": {
|
|
@@ -1522,6 +1562,11 @@
|
|
|
1522
1562
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
1523
1563
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
1524
1564
|
},
|
|
1565
|
+
"page": {
|
|
1566
|
+
"type": "string",
|
|
1567
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
1568
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
1569
|
+
},
|
|
1525
1570
|
"tabs": {
|
|
1526
1571
|
"minItems": 1,
|
|
1527
1572
|
"type": "array",
|
|
@@ -1561,6 +1606,11 @@
|
|
|
1561
1606
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
1562
1607
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
1563
1608
|
},
|
|
1609
|
+
"page": {
|
|
1610
|
+
"type": "string",
|
|
1611
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
1612
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
1613
|
+
},
|
|
1564
1614
|
"versions": {
|
|
1565
1615
|
"minItems": 1,
|
|
1566
1616
|
"type": "array",
|
|
@@ -1600,6 +1650,11 @@
|
|
|
1600
1650
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
1601
1651
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
1602
1652
|
},
|
|
1653
|
+
"page": {
|
|
1654
|
+
"type": "string",
|
|
1655
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
1656
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
1657
|
+
},
|
|
1603
1658
|
"languages": {
|
|
1604
1659
|
"minItems": 1,
|
|
1605
1660
|
"type": "array",
|
|
@@ -1639,6 +1694,11 @@
|
|
|
1639
1694
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
1640
1695
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
1641
1696
|
},
|
|
1697
|
+
"page": {
|
|
1698
|
+
"type": "string",
|
|
1699
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
1700
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
1701
|
+
},
|
|
1642
1702
|
"dropdowns": {
|
|
1643
1703
|
"minItems": 1,
|
|
1644
1704
|
"type": "array",
|
|
@@ -1678,6 +1738,11 @@
|
|
|
1678
1738
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
1679
1739
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
1680
1740
|
},
|
|
1741
|
+
"page": {
|
|
1742
|
+
"type": "string",
|
|
1743
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
1744
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
1745
|
+
},
|
|
1681
1746
|
"products": {
|
|
1682
1747
|
"minItems": 1,
|
|
1683
1748
|
"type": "array",
|
|
@@ -1717,6 +1782,11 @@
|
|
|
1717
1782
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
1718
1783
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
1719
1784
|
},
|
|
1785
|
+
"page": {
|
|
1786
|
+
"type": "string",
|
|
1787
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
1788
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
1789
|
+
},
|
|
1720
1790
|
"href": {
|
|
1721
1791
|
"type": "string",
|
|
1722
1792
|
"description": "Makes this a link to another address instead of a section with pages of its own.",
|
|
@@ -1768,6 +1838,11 @@
|
|
|
1768
1838
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
1769
1839
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
1770
1840
|
},
|
|
1841
|
+
"page": {
|
|
1842
|
+
"type": "string",
|
|
1843
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
1844
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
1845
|
+
},
|
|
1771
1846
|
"pages": {
|
|
1772
1847
|
"type": "array",
|
|
1773
1848
|
"items": {
|
|
@@ -1816,6 +1891,11 @@
|
|
|
1816
1891
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
1817
1892
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
1818
1893
|
},
|
|
1894
|
+
"page": {
|
|
1895
|
+
"type": "string",
|
|
1896
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
1897
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
1898
|
+
},
|
|
1819
1899
|
"tabs": {
|
|
1820
1900
|
"minItems": 1,
|
|
1821
1901
|
"type": "array",
|
|
@@ -1865,6 +1945,11 @@
|
|
|
1865
1945
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
1866
1946
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
1867
1947
|
},
|
|
1948
|
+
"page": {
|
|
1949
|
+
"type": "string",
|
|
1950
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
1951
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
1952
|
+
},
|
|
1868
1953
|
"versions": {
|
|
1869
1954
|
"minItems": 1,
|
|
1870
1955
|
"type": "array",
|
|
@@ -1914,6 +1999,11 @@
|
|
|
1914
1999
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
1915
2000
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
1916
2001
|
},
|
|
2002
|
+
"page": {
|
|
2003
|
+
"type": "string",
|
|
2004
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
2005
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
2006
|
+
},
|
|
1917
2007
|
"languages": {
|
|
1918
2008
|
"minItems": 1,
|
|
1919
2009
|
"type": "array",
|
|
@@ -1963,6 +2053,11 @@
|
|
|
1963
2053
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
1964
2054
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
1965
2055
|
},
|
|
2056
|
+
"page": {
|
|
2057
|
+
"type": "string",
|
|
2058
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
2059
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
2060
|
+
},
|
|
1966
2061
|
"dropdowns": {
|
|
1967
2062
|
"minItems": 1,
|
|
1968
2063
|
"type": "array",
|
|
@@ -2012,6 +2107,11 @@
|
|
|
2012
2107
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
2013
2108
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
2014
2109
|
},
|
|
2110
|
+
"page": {
|
|
2111
|
+
"type": "string",
|
|
2112
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
2113
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
2114
|
+
},
|
|
2015
2115
|
"products": {
|
|
2016
2116
|
"minItems": 1,
|
|
2017
2117
|
"type": "array",
|
|
@@ -2061,6 +2161,11 @@
|
|
|
2061
2161
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
2062
2162
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
2063
2163
|
},
|
|
2164
|
+
"page": {
|
|
2165
|
+
"type": "string",
|
|
2166
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
2167
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
2168
|
+
},
|
|
2064
2169
|
"href": {
|
|
2065
2170
|
"type": "string",
|
|
2066
2171
|
"description": "Makes this a link to another address instead of a section with pages of its own.",
|
|
@@ -2102,6 +2207,11 @@
|
|
|
2102
2207
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
2103
2208
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
2104
2209
|
},
|
|
2210
|
+
"page": {
|
|
2211
|
+
"type": "string",
|
|
2212
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
2213
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
2214
|
+
},
|
|
2105
2215
|
"pages": {
|
|
2106
2216
|
"type": "array",
|
|
2107
2217
|
"items": {
|
|
@@ -2140,6 +2250,11 @@
|
|
|
2140
2250
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
2141
2251
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
2142
2252
|
},
|
|
2253
|
+
"page": {
|
|
2254
|
+
"type": "string",
|
|
2255
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
2256
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
2257
|
+
},
|
|
2143
2258
|
"tabs": {
|
|
2144
2259
|
"minItems": 1,
|
|
2145
2260
|
"type": "array",
|
|
@@ -2179,6 +2294,11 @@
|
|
|
2179
2294
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
2180
2295
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
2181
2296
|
},
|
|
2297
|
+
"page": {
|
|
2298
|
+
"type": "string",
|
|
2299
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
2300
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
2301
|
+
},
|
|
2182
2302
|
"versions": {
|
|
2183
2303
|
"minItems": 1,
|
|
2184
2304
|
"type": "array",
|
|
@@ -2218,6 +2338,11 @@
|
|
|
2218
2338
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
2219
2339
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
2220
2340
|
},
|
|
2341
|
+
"page": {
|
|
2342
|
+
"type": "string",
|
|
2343
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
2344
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
2345
|
+
},
|
|
2221
2346
|
"languages": {
|
|
2222
2347
|
"minItems": 1,
|
|
2223
2348
|
"type": "array",
|
|
@@ -2257,6 +2382,11 @@
|
|
|
2257
2382
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
2258
2383
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
2259
2384
|
},
|
|
2385
|
+
"page": {
|
|
2386
|
+
"type": "string",
|
|
2387
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
2388
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
2389
|
+
},
|
|
2260
2390
|
"dropdowns": {
|
|
2261
2391
|
"minItems": 1,
|
|
2262
2392
|
"type": "array",
|
|
@@ -2296,6 +2426,11 @@
|
|
|
2296
2426
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
2297
2427
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
2298
2428
|
},
|
|
2429
|
+
"page": {
|
|
2430
|
+
"type": "string",
|
|
2431
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
2432
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
2433
|
+
},
|
|
2299
2434
|
"products": {
|
|
2300
2435
|
"minItems": 1,
|
|
2301
2436
|
"type": "array",
|
|
@@ -2335,6 +2470,11 @@
|
|
|
2335
2470
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
2336
2471
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
2337
2472
|
},
|
|
2473
|
+
"page": {
|
|
2474
|
+
"type": "string",
|
|
2475
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
2476
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
2477
|
+
},
|
|
2338
2478
|
"href": {
|
|
2339
2479
|
"type": "string",
|
|
2340
2480
|
"description": "Makes this a link to another address instead of a section with pages of its own.",
|
|
@@ -2381,6 +2521,11 @@
|
|
|
2381
2521
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
2382
2522
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
2383
2523
|
},
|
|
2524
|
+
"page": {
|
|
2525
|
+
"type": "string",
|
|
2526
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
2527
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
2528
|
+
},
|
|
2384
2529
|
"pages": {
|
|
2385
2530
|
"type": "array",
|
|
2386
2531
|
"items": {
|
|
@@ -2424,6 +2569,11 @@
|
|
|
2424
2569
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
2425
2570
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
2426
2571
|
},
|
|
2572
|
+
"page": {
|
|
2573
|
+
"type": "string",
|
|
2574
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
2575
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
2576
|
+
},
|
|
2427
2577
|
"tabs": {
|
|
2428
2578
|
"minItems": 1,
|
|
2429
2579
|
"type": "array",
|
|
@@ -2468,6 +2618,11 @@
|
|
|
2468
2618
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
2469
2619
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
2470
2620
|
},
|
|
2621
|
+
"page": {
|
|
2622
|
+
"type": "string",
|
|
2623
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
2624
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
2625
|
+
},
|
|
2471
2626
|
"versions": {
|
|
2472
2627
|
"minItems": 1,
|
|
2473
2628
|
"type": "array",
|
|
@@ -2512,6 +2667,11 @@
|
|
|
2512
2667
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
2513
2668
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
2514
2669
|
},
|
|
2670
|
+
"page": {
|
|
2671
|
+
"type": "string",
|
|
2672
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
2673
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
2674
|
+
},
|
|
2515
2675
|
"languages": {
|
|
2516
2676
|
"minItems": 1,
|
|
2517
2677
|
"type": "array",
|
|
@@ -2556,6 +2716,11 @@
|
|
|
2556
2716
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
2557
2717
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
2558
2718
|
},
|
|
2719
|
+
"page": {
|
|
2720
|
+
"type": "string",
|
|
2721
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
2722
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
2723
|
+
},
|
|
2559
2724
|
"dropdowns": {
|
|
2560
2725
|
"minItems": 1,
|
|
2561
2726
|
"type": "array",
|
|
@@ -2600,6 +2765,11 @@
|
|
|
2600
2765
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
2601
2766
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
2602
2767
|
},
|
|
2768
|
+
"page": {
|
|
2769
|
+
"type": "string",
|
|
2770
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
2771
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
2772
|
+
},
|
|
2603
2773
|
"products": {
|
|
2604
2774
|
"minItems": 1,
|
|
2605
2775
|
"type": "array",
|
|
@@ -2644,6 +2814,11 @@
|
|
|
2644
2814
|
"description": "For a hidden item: its search also finds the site's public pages.",
|
|
2645
2815
|
"markdownDescription": "For a hidden item: its search also finds the site's public pages."
|
|
2646
2816
|
},
|
|
2817
|
+
"page": {
|
|
2818
|
+
"type": "string",
|
|
2819
|
+
"description": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there.",
|
|
2820
|
+
"markdownDescription": "A page of its own - an overview - that choosing this item opens, in place of its first page. Shown inside the item; in a sidebar too, it opens there."
|
|
2821
|
+
},
|
|
2647
2822
|
"href": {
|
|
2648
2823
|
"type": "string",
|
|
2649
2824
|
"description": "Makes this a link to another address instead of a section with pages of its own.",
|