aboutsummaryrefslogtreecommitdiff
path: root/website/scripts/prepare-docs.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'website/scripts/prepare-docs.mjs')
-rw-r--r--website/scripts/prepare-docs.mjs20
1 files changed, 13 insertions, 7 deletions
diff --git a/website/scripts/prepare-docs.mjs b/website/scripts/prepare-docs.mjs
index 55a463bb..14d62abc 100644
--- a/website/scripts/prepare-docs.mjs
+++ b/website/scripts/prepare-docs.mjs
@@ -261,24 +261,30 @@ async function writeAgentDocsIndex({
if (configDataPath === repositoryPath) {
throw new Error(`cannot derive config reference path from ${repositoryPath}`);
}
+ const configDataUrl = `${rawRoot}/${configDataPath}`;
const lines = [
`# ${heading}`,
'',
`> ${summary}`,
'',
- 'Open only the pages relevant to the current task. Links return raw MDX from the exact documented source revision. For another topic, return to this index instead of following `/docs/` links inside a page, which serve human-facing HTML.',
+ 'Open only the pages relevant to the current task. Links return raw source files from the exact documented revision. For another topic, return to this index instead of following `/docs/` links inside a page, which serve human-facing HTML.',
'',
'## Documentation',
'',
- ...pages.map(
- ({ title, description, path }) =>
- `- [${title}](${rawBase}/${path})${description ? `: ${description}` : ''}`,
- ),
+ ...pages.map(({ title, description, path }) => {
+ const url = /^config-reference\.mdx?$/.test(path) ? configDataUrl : `${rawBase}/${path}`;
+ return `- [${title}](${url})${description ? `: ${description}` : ''}`;
+ }),
+ '',
+ '## Using the config reference',
'',
- '## Generated reference data',
+ 'The Config reference link above is a large structured JSON file. When command tools are available, fetch and filter it by exact key instead of loading the whole file:',
'',
- `- [Config reference data](${rawRoot}/${configDataPath}): every canonical config.toml key, type, default, and description`,
+ '```sh',
+ `curl -fsSL '${configDataUrl}' | jq --arg key 'ui.sidebar_width' \\`,
+ " '.sections[].keys[] | select(.key == $key)'",
+ '```',
'',
...extraSections,
'',