@takazudo/zudo-doc 0.2.0-next.7 → 0.2.0-next.8
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/dist/integrations/claude-resources/generate.js +34 -11
- package/dist/integrations/doc-history/index.d.ts +35 -10
- package/dist/integrations/doc-history/index.js +26 -3
- package/dist/integrations/llms-txt/load.d.ts +3 -1
- package/dist/integrations/llms-txt/load.js +3 -1
- package/dist/integrations/llms-txt/types.d.ts +6 -0
- package/dist/integrations/search-index/content-files.d.ts +11 -1
- package/dist/integrations/search-index/content-files.js +1 -1
- package/dist/safelist.css +2 -0
- package/dist/sidebar-tree/build-tree.js +6 -4
- package/dist/sidebar-tree/types.d.ts +14 -0
- package/package.json +5 -3
|
@@ -25,13 +25,16 @@ function listFiles(dir) {
|
|
|
25
25
|
if (!fs.existsSync(dir)) return [];
|
|
26
26
|
return fs.readdirSync(dir, { withFileTypes: true }).filter((d) => d.isFile()).map((d) => d.name).sort();
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
function writeCategoryIndex(outputDir, label, position, description) {
|
|
29
|
+
const mdx = `---
|
|
30
|
+
title: "${escapeTitle(label)}"
|
|
31
|
+
description: "${escapeTitle(description)}"
|
|
32
|
+
sidebar_position: ${position}
|
|
33
|
+
category_no_page: true
|
|
34
|
+
generated: true
|
|
35
|
+
---
|
|
36
|
+
`;
|
|
37
|
+
fs.writeFileSync(path.join(outputDir, "index.mdx"), mdx);
|
|
35
38
|
}
|
|
36
39
|
function findClaudeMdFiles(dir, excludeDirs) {
|
|
37
40
|
const results = [];
|
|
@@ -89,6 +92,11 @@ function generateClaudemdDocs(config) {
|
|
|
89
92
|
});
|
|
90
93
|
const emittedSlugs = /* @__PURE__ */ new Map();
|
|
91
94
|
items.forEach((item, index) => {
|
|
95
|
+
if (item.slug === "index") {
|
|
96
|
+
throw new Error(
|
|
97
|
+
`claude-resources: "${item.relPath}" maps to the reserved slug "index", which is used for the category metadata file. Rename the directory to resolve the conflict.`
|
|
98
|
+
);
|
|
99
|
+
}
|
|
92
100
|
const previous = emittedSlugs.get(item.slug);
|
|
93
101
|
if (previous !== void 0) {
|
|
94
102
|
throw new Error(
|
|
@@ -111,7 +119,7 @@ ${escapeForMdx(content.trim())}
|
|
|
111
119
|
`;
|
|
112
120
|
fs.writeFileSync(path.join(outputDir, `${item.slug}.mdx`), mdx);
|
|
113
121
|
});
|
|
114
|
-
|
|
122
|
+
writeCategoryIndex(outputDir, "CLAUDE.md", 900, "Project-specific instructions");
|
|
115
123
|
return items;
|
|
116
124
|
}
|
|
117
125
|
function generateCommandsDocs(config) {
|
|
@@ -128,6 +136,11 @@ function generateCommandsDocs(config) {
|
|
|
128
136
|
const parsed = parseFrontmatter(content);
|
|
129
137
|
if (!parsed) continue;
|
|
130
138
|
const name = file.replace(/\.md$/, "");
|
|
139
|
+
if (name === "index") {
|
|
140
|
+
throw new Error(
|
|
141
|
+
`claude-resources: ".claude/commands/index.md" uses the reserved name "index", which is used for the category metadata file. Rename the command file to resolve the conflict.`
|
|
142
|
+
);
|
|
143
|
+
}
|
|
131
144
|
const description = parsed.data.description || "";
|
|
132
145
|
items.push({ name, description });
|
|
133
146
|
const mdx = `---
|
|
@@ -142,7 +155,7 @@ ${escapeForMdx(parsed.content.trim())}
|
|
|
142
155
|
fs.writeFileSync(path.join(outputDir, `${name}.mdx`), mdx);
|
|
143
156
|
}
|
|
144
157
|
items.sort((a, b) => a.name.localeCompare(b.name));
|
|
145
|
-
|
|
158
|
+
writeCategoryIndex(outputDir, "Commands", 901, "Custom slash commands");
|
|
146
159
|
return items;
|
|
147
160
|
}
|
|
148
161
|
function getSkillFileTree(skillDir, subDirs) {
|
|
@@ -207,6 +220,11 @@ function generateSkillsDocs(config) {
|
|
|
207
220
|
ensureDir(outputDir);
|
|
208
221
|
const items = [];
|
|
209
222
|
for (const dir of dirs) {
|
|
223
|
+
if (dir === "index") {
|
|
224
|
+
throw new Error(
|
|
225
|
+
`claude-resources: skill directory ".claude/skills/index/" uses the reserved name "index", which is used for the category metadata file. Rename the skill directory to resolve the conflict.`
|
|
226
|
+
);
|
|
227
|
+
}
|
|
210
228
|
const content = fs.readFileSync(
|
|
211
229
|
path.join(skillsDir, dir, "SKILL.md"),
|
|
212
230
|
"utf8"
|
|
@@ -324,7 +342,7 @@ ${escapeForMdx(raw.trim())}
|
|
|
324
342
|
}
|
|
325
343
|
}
|
|
326
344
|
items.sort((a, b) => a.name.localeCompare(b.name));
|
|
327
|
-
|
|
345
|
+
writeCategoryIndex(outputDir, "Skills", 902, "Skill packages");
|
|
328
346
|
return items;
|
|
329
347
|
}
|
|
330
348
|
function generateAgentsDocs(config) {
|
|
@@ -344,6 +362,11 @@ function generateAgentsDocs(config) {
|
|
|
344
362
|
const description = parsed.data.description || "";
|
|
345
363
|
const model = parsed.data.model || "";
|
|
346
364
|
const fileSlug = file.replace(/\.md$/, "");
|
|
365
|
+
if (fileSlug === "index") {
|
|
366
|
+
throw new Error(
|
|
367
|
+
`claude-resources: ".claude/agents/index.md" uses the reserved name "index", which is used for the category metadata file. Rename the agent file to resolve the conflict.`
|
|
368
|
+
);
|
|
369
|
+
}
|
|
347
370
|
items.push({ name, file: fileSlug, description, model });
|
|
348
371
|
const modelBadge = model ? `**Model:** \`${model}\`
|
|
349
372
|
` : "";
|
|
@@ -360,7 +383,7 @@ ${escapeForMdx(parsed.content.trim())}
|
|
|
360
383
|
fs.writeFileSync(path.join(outputDir, `${fileSlug}.mdx`), mdx);
|
|
361
384
|
}
|
|
362
385
|
items.sort((a, b) => a.name.localeCompare(b.name));
|
|
363
|
-
|
|
386
|
+
writeCategoryIndex(outputDir, "Agents", 903, "Custom subagents");
|
|
364
387
|
return items;
|
|
365
388
|
}
|
|
366
389
|
function generateOverviewIndex(config, {
|
|
@@ -87,21 +87,46 @@ interface PostBuildContext {
|
|
|
87
87
|
/** Optional logger; falls back to silent no-ops when omitted. */
|
|
88
88
|
logger?: PostBuildLogger;
|
|
89
89
|
}
|
|
90
|
+
/** Env var that opts a LOCAL build back into postBuild per-page JSON generation. */
|
|
91
|
+
declare const DOC_HISTORY_GEN_ENV = "GEN_DOC_HISTORY";
|
|
92
|
+
/**
|
|
93
|
+
* Decide whether the postBuild hook should generate per-page doc-history JSON.
|
|
94
|
+
*
|
|
95
|
+
* The per-page JSON is redundant on the normal paths: dev reads it live from
|
|
96
|
+
* the standalone `:4322` server, and CI generates it in the dedicated parallel
|
|
97
|
+
* `build-history` job (the CLI directly, NOT this hook). Running it inline
|
|
98
|
+
* during a plain local `pnpm build` issues ~3 serial `git log --follow` calls
|
|
99
|
+
* per content file, which on a large corpus exceeds zfb's 120s postBuild
|
|
100
|
+
* lifecycle-hook budget (#1986). So the default flips to opt-in:
|
|
101
|
+
*
|
|
102
|
+
* - `SKIP_DOC_HISTORY=1` → never generate (highest priority; back-compat).
|
|
103
|
+
* - `GEN_DOC_HISTORY=1` → always generate (explicit local opt-in).
|
|
104
|
+
* - CI → generate (keeps the CI build-site artifact
|
|
105
|
+
* byte-identical to before; D1's async generator
|
|
106
|
+
* keeps it within budget).
|
|
107
|
+
* - otherwise (local) → skip (the #1986 fix).
|
|
108
|
+
*
|
|
109
|
+
* This gates ONLY the postBuild per-page dropdown JSON. The preBuild meta step
|
|
110
|
+
* (the visible Created/Updated/Author block) is unaffected — it keys off
|
|
111
|
+
* `SKIP_DOC_HISTORY` alone — so a plain local build still shows real page
|
|
112
|
+
* metadata; only the per-page history dropdown JSON is absent until opt-in.
|
|
113
|
+
*/
|
|
114
|
+
declare function shouldGeneratePostBuild(env?: NodeJS.ProcessEnv): {
|
|
115
|
+
generate: boolean;
|
|
116
|
+
reason: string;
|
|
117
|
+
};
|
|
90
118
|
/**
|
|
91
119
|
* Post-build hook. Spawns the `doc-history-generate` CLI from
|
|
92
120
|
* `@takazudo/zudo-doc-history-server` to write per-page git history JSON
|
|
93
121
|
* files into `<outDir>/doc-history/`.
|
|
94
122
|
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
* runs leave the flag unset so the inline path is taken.
|
|
123
|
+
* Generation is gated by `shouldGeneratePostBuild` (see its docs): skipped by
|
|
124
|
+
* default on local builds (opt in with `GEN_DOC_HISTORY=1`), run in CI and
|
|
125
|
+
* when explicitly opted in, and always suppressed by `SKIP_DOC_HISTORY=1`.
|
|
99
126
|
*
|
|
100
|
-
* The CLI is spawned
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
* progress and warnings surface in the user's terminal exactly as
|
|
104
|
-
* they do in CI.
|
|
127
|
+
* The CLI is spawned as `node <cli> <args>` (shell: false) so option-derived
|
|
128
|
+
* paths are never interpolated into a command line. Output is inherited so
|
|
129
|
+
* progress and warnings surface in the user's terminal exactly as in CI.
|
|
105
130
|
*/
|
|
106
131
|
declare function runDocHistoryPostBuild(options: DocHistoryOptions, ctx: PostBuildContext): Promise<void>;
|
|
107
132
|
/**
|
|
@@ -134,4 +159,4 @@ declare function buildGenerateCliArgs(options: DocHistoryOptions, outDir: string
|
|
|
134
159
|
*/
|
|
135
160
|
declare function resolveDocHistoryGenerateBin(): string;
|
|
136
161
|
|
|
137
|
-
export { type ConnectMiddleware, DEFAULT_MAX_ENTRIES, DEFAULT_SERVER_PORT, DOC_HISTORY_GENERATE_BIN, DOC_HISTORY_OUTPUT_DIRNAME, DOC_HISTORY_ROUTE_PREFIX, type DocHistoryLocaleConfig, type DocHistoryOptions, type DocHistoryPluginDescriptor, type MiddlewareLogger, type PostBuildContext, type PostBuildLogger, buildGenerateCliArgs, createDocHistoryDevMiddleware, docHistoryPlugin, resolveDocHistoryGenerateBin, runDocHistoryPostBuild };
|
|
162
|
+
export { type ConnectMiddleware, DEFAULT_MAX_ENTRIES, DEFAULT_SERVER_PORT, DOC_HISTORY_GENERATE_BIN, DOC_HISTORY_GEN_ENV, DOC_HISTORY_OUTPUT_DIRNAME, DOC_HISTORY_ROUTE_PREFIX, type DocHistoryLocaleConfig, type DocHistoryOptions, type DocHistoryPluginDescriptor, type MiddlewareLogger, type PostBuildContext, type PostBuildLogger, buildGenerateCliArgs, createDocHistoryDevMiddleware, docHistoryPlugin, resolveDocHistoryGenerateBin, runDocHistoryPostBuild, shouldGeneratePostBuild };
|
|
@@ -46,11 +46,32 @@ function createDocHistoryDevMiddleware(options, logger) {
|
|
|
46
46
|
});
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
+
const DOC_HISTORY_GEN_ENV = "GEN_DOC_HISTORY";
|
|
50
|
+
function shouldGeneratePostBuild(env = process.env) {
|
|
51
|
+
if (env.SKIP_DOC_HISTORY === "1") {
|
|
52
|
+
return { generate: false, reason: "SKIP_DOC_HISTORY=1" };
|
|
53
|
+
}
|
|
54
|
+
if (env[DOC_HISTORY_GEN_ENV] === "1") {
|
|
55
|
+
return { generate: true, reason: `${DOC_HISTORY_GEN_ENV}=1` };
|
|
56
|
+
}
|
|
57
|
+
if (isCiEnv(env)) {
|
|
58
|
+
return { generate: true, reason: "CI" };
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
generate: false,
|
|
62
|
+
reason: `local default \u2014 set ${DOC_HISTORY_GEN_ENV}=1 to generate`
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function isCiEnv(env) {
|
|
66
|
+
return env.CI === "true" || env.CI === "1" || env.GITHUB_ACTIONS === "true";
|
|
67
|
+
}
|
|
49
68
|
async function runDocHistoryPostBuild(options, ctx) {
|
|
50
|
-
|
|
51
|
-
|
|
69
|
+
const { generate, reason } = shouldGeneratePostBuild();
|
|
70
|
+
if (!generate) {
|
|
71
|
+
ctx.logger?.info(`Skipping doc history generation (${reason})`);
|
|
52
72
|
return;
|
|
53
73
|
}
|
|
74
|
+
ctx.logger?.info(`Generating doc history JSON (${reason})`);
|
|
54
75
|
const args = buildGenerateCliArgs(options, ctx.outDir);
|
|
55
76
|
await spawnDocHistoryGenerate(args, ctx.logger);
|
|
56
77
|
}
|
|
@@ -127,6 +148,7 @@ export {
|
|
|
127
148
|
DEFAULT_MAX_ENTRIES,
|
|
128
149
|
DEFAULT_SERVER_PORT,
|
|
129
150
|
DOC_HISTORY_GENERATE_BIN,
|
|
151
|
+
DOC_HISTORY_GEN_ENV,
|
|
130
152
|
DOC_HISTORY_OUTPUT_DIRNAME,
|
|
131
153
|
DOC_HISTORY_ROUTE_PREFIX,
|
|
132
154
|
buildGenerateCliArgs,
|
|
@@ -134,5 +156,6 @@ export {
|
|
|
134
156
|
docHistoryPlugin,
|
|
135
157
|
resolveDocHistoryGenerateBin,
|
|
136
158
|
runDocHistoryMetaStep,
|
|
137
|
-
runDocHistoryPostBuild
|
|
159
|
+
runDocHistoryPostBuild,
|
|
160
|
+
shouldGeneratePostBuild
|
|
138
161
|
};
|
|
@@ -28,7 +28,9 @@ declare function collectMdFiles(dir: string): Array<{
|
|
|
28
28
|
* URL is produced.
|
|
29
29
|
*/
|
|
30
30
|
declare function slugToUrl(slug: string, locale: string | null, base: string, siteUrl?: string): string;
|
|
31
|
-
/** Whether a given doc should be excluded from the llms.txt index.
|
|
31
|
+
/** Whether a given doc should be excluded from the llms.txt index.
|
|
32
|
+
* `category_no_page` index files are metadata-only with no built route, so
|
|
33
|
+
* they are excluded alongside search_exclude / draft / unlisted. */
|
|
32
34
|
declare function isExcluded(data: LlmsTxtFrontmatter): boolean;
|
|
33
35
|
/**
|
|
34
36
|
* Parse a markdown file into frontmatter + body. Returns `null` when
|
|
@@ -34,7 +34,9 @@ function slugToUrl(slug, locale, base, siteUrl) {
|
|
|
34
34
|
return path;
|
|
35
35
|
}
|
|
36
36
|
function isExcluded(data) {
|
|
37
|
-
return Boolean(
|
|
37
|
+
return Boolean(
|
|
38
|
+
data.search_exclude || data.draft || data.unlisted || data.category_no_page
|
|
39
|
+
);
|
|
38
40
|
}
|
|
39
41
|
function parseMarkdownFile(filePath) {
|
|
40
42
|
try {
|
|
@@ -22,6 +22,12 @@ interface LlmsTxtFrontmatter {
|
|
|
22
22
|
* Mirrors the `search_exclude` flag used by the existing project.
|
|
23
23
|
*/
|
|
24
24
|
search_exclude?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* A `category_no_page` index.mdx carries category metadata only and builds
|
|
27
|
+
* no route — so it must NOT appear in llms.txt (the link would 404). Mirrors
|
|
28
|
+
* the route/sitemap/search exclusion in the host project.
|
|
29
|
+
*/
|
|
30
|
+
category_no_page?: boolean;
|
|
25
31
|
[key: string]: unknown;
|
|
26
32
|
}
|
|
27
33
|
/**
|
|
@@ -19,6 +19,12 @@ interface DocFrontmatter {
|
|
|
19
19
|
draft?: boolean;
|
|
20
20
|
unlisted?: boolean;
|
|
21
21
|
search_exclude?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* A `category_no_page` index.mdx carries category metadata only and builds
|
|
24
|
+
* no route — so its slug must NOT enter the search index (the result link
|
|
25
|
+
* would 404). Mirrors the route/sitemap exclusion in the host project.
|
|
26
|
+
*/
|
|
27
|
+
category_no_page?: boolean;
|
|
22
28
|
[key: string]: unknown;
|
|
23
29
|
}
|
|
24
30
|
/** Parse a markdown file. Returns null when the file cannot be read. */
|
|
@@ -26,7 +32,11 @@ declare function parseMarkdownFile(filePath: string): {
|
|
|
26
32
|
data: DocFrontmatter;
|
|
27
33
|
content: string;
|
|
28
34
|
} | null;
|
|
29
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* A page is excluded from indexing when explicitly opted out, drafted,
|
|
37
|
+
* unlisted, or a `category_no_page` metadata-only category index (no built
|
|
38
|
+
* route to link to).
|
|
39
|
+
*/
|
|
30
40
|
declare function isExcluded(data: DocFrontmatter): boolean;
|
|
31
41
|
|
|
32
42
|
export { type DocFrontmatter, collectMdFiles, isExcluded, parseMarkdownFile, slugToUrl, stripMarkdown };
|
|
@@ -40,7 +40,7 @@ function parseMarkdownFile(filePath) {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
function isExcluded(data) {
|
|
43
|
-
return !!(data.search_exclude || data.draft || data.unlisted);
|
|
43
|
+
return !!(data.search_exclude || data.draft || data.unlisted || data.category_no_page);
|
|
44
44
|
}
|
|
45
45
|
export {
|
|
46
46
|
collectMdFiles,
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* generated by gen-safelist.mjs — do not edit by hand */
|
|
2
|
+
@source inline("-mb-px [&::-webkit-details-marker]:hidden [&_a]:text-accent [&_a]:underline [&_nav]:mb-0 [doc-history-meta] [doc-layout] a a2 abbr above absolute active actual after after-breadcrumb after-content after-sidebar after-title against agent agents ai-chat ai-chat-trigger align-top all allow-same-origin allow-scripts already-executed an anchor anchored and announce antialiased any application/json applies apply-css-vars are area arg aria-controls aria-current aria-disabled aria-expanded aria-haspopup aria-hidden aria-label aria-live aria-orientation aria-pressed aria-selected aria-valuemax aria-valuemin aria-valuenow article as asc aside assets assigning assistant async at attach attribute attributes available await away b back backdrop:bg-bg/80 background backtick backticks baked banner bare based be because before below between bg bg-[#fff] bg-accent bg-bg bg-code-bg bg-fg bg-info/10 bg-muted bg-surface bg-transparent bg-warning/10 bg-warning/5 bi bigint bin blob block blockquote blocks blur body body-end-components body-end-scripts boolean bootstrap border border-accent border-b border-b-2 border-b-[5px] border-collapse border-fg border-l border-l-[3px] border-muted border-none border-r border-t border-t-[2px] border-t-[3px] border-transparent border-warning/30 both br breadcrumb:end breadcrumb:start break-words browser browsers btn bundler but button buttons by caller can cancellation cannot canonical caption cases cat-nav- catch category catppuccin-latte checkbox child ci circle cite class class-less claude claude-agents claude-commands claude-md claude-skills cleaned clear clear-css-vars click client clip close code code-block-sr-announce col col-resize colgroup collision color color-scheme color-scheme-changed color-scheme-provider color-tweak colors command commands commit component component:github-link component:language-switcher component:search component:theme-toggle component:version-switcher concrete configuration configure configured consumer container containers content content-type content-wrapper:end content-wrapper:start contents controller converts copy correct covered covers crashes crumb- css cursor cursor-not-allowed cursor-pointer custom dark data-active data-group-id data-header data-header-logo data-header-nav data-header-right data-mermaid-rendered data-nav-item data-nav-item-dropdown data-nav-more data-nav-more-menu data-nav-more-toggle data-sidebar-resizer data-tab-btn data-tab-default data-tab-label data-tab-value data-tabs data-taglist-group data-testid data-theme data-variant data-version-banner data-version-menu data-version-switcher data-version-toggle data-zfb-transition-persist dd decimal declare decoration-muted default defaults del desc description design design-token-panel design-token-trigger desktop desktop-sidebar detached details deterministic dfn diagram diagrams dialog dieser directories directory disc display:none dist div dl doc doc-card- doc-history doc-history-generate does drag draggable dropdown dropdowns dt duration-150 duration-200 during dynamically e2e earlier edge el element elements els else em emit emitting empty en entries entry error escape even eventually every exactly exit expected failed fall fallback falls false fast feed fg fieldset figcaption figure file fill fills finally fire fires first fixed fixtures flex flex-1 flex-col flex-wrap flip flipping flips focus focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2 focus-visible:underline focus:underline font font-bold font-medium font-mono font-semibold footer for form free from frontmatter frontmatter-preview full function further g gap-[clamp(1.5rem,3vw,4rem)] gap-hsp-2xs gap-hsp-sm gap-hsp-xs gap-vsp-lg gap-vsp-xs gap-x-hsp-2xs gap-x-hsp-lg gap-x-hsp-md gap-x-hsp-sm gap-x-hsp-xs gap-y-vsp-2xs gap-y-vsp-lg gap-y-vsp-md gap-y-vsp-xs gaps generate generation geometry get github github-link go got gray-matter grid grid-cols-1 group group-focus-visible:underline group-focus-within:block group-hover:bg-fg group-hover:block group-hover:text-bg group-hover:underline group-open:rotate-90 guard h-[0.5rem] h-[0.875rem] h-[1.575rem] h-[1lh] h-[3.5rem] h-[calc(100vh-3.5rem)] h-icon-sm h-icon-xs h1 h2 h3 h4 h5 h6 hand handle handled handlers has hash-link have head head-links head-scripts header header-call:end header-call:start height here hex hidden highlighter history hit horizontal host hover:bg-[color-mix(in_srgb,var(--color-surface)_80%,var(--color-fg)_20%)] hover:bg-accent-hover hover:bg-accent/10 hover:border-accent hover:border-accent-hover hover:border-fg hover:text-accent hover:text-accent-hover hover:text-fg hover:underline hr html i i2 i3 i4 identical if iframe img import imports in index inherit initial initialised inline inline-block inline-flex input ins inset-0 inside instanceof instructions intent into inverse invoke is it italic item- items items-center items-start itself javascript justify-between justify-center justify-end kbd keep keeps kept keydown khroma label landing language-switcher last:border-b-0 launch leading-relaxed leading-snug leading-tight leaf- leaving left left-0 left:calc legend lg lg:block lg:flex lg:grid-cols-[repeat(auto-fit,minmax(12rem,1fr))] lg:ml-[var(--zd-sidebar-w)] lg:pt-vsp-2xl lg:px-hsp-2xl lg:py-vsp-2xl li li2 light like line link link- list-disc list-none listener literal lives llms llms-txt load local lostpointercapture luminance m m-0 main make maps mark marks matching max-h-[80vh] max-w-[46rem] max-w-[80rem] max-w-[clamp(50rem,75vw,90rem)] max-w-full max-w-none mb-0 mb-vsp-2xs mb-vsp-lg mb-vsp-md mb-vsp-sm mb-vsp-xl mb-vsp-xs menu merged mermaid message meta metadata min-h-[calc(100vh-3.5rem)] min-h-screen min-w-0 min-w-[10rem] min-w-[8rem] mirror missing ml-auto ml-hsp-2xl ml-hsp-lg ml-hsp-sm ml-hsp-xl mod mode mounted mouseenter mouseleave mt-0 mt-vsp-2xs mt-vsp-3xs mt-vsp-lg mt-vsp-sm mt-vsp-xl must mutates mx-auto my-vsp-lg my-vsp-md name named native nav nav-card- navigating navigation navigations near needs new next no-underline node:fs node:module node:os node:path nodes nofollow noindex non-empty non-string none noopener noreferrer normal not not-object note now null number object observe observer of og:description og:image og:title og:type og:url ol older on once one only opacity-60 option or other others out overflow overflow-auto overflow-hidden overflow-x-auto overflow-y-auto overflow-y:auto own p p-0 p-hsp-lg p-hsp-md p-hsp-sm p-hsp-xl packages padding page page-loading-overlay page-loading-spinner page-navigate-end pages paint panel panels parent parse parsed pass path pb-vsp-xl per pi pick picked picks pins pipelines pl-[1.25rem] pl-hsp-lg pl-hsp-sm pl-hsp-xl place pointer-events-none pointercancel pointerdown pointermove pointerup polite polyline populates port position position:fixed pr-hsp-lg pr-hsp-md pr-hsp-xl pre preact preact/hooks preact/jsx-runtime preload pres produced produces production propagating properties property proxy pt-vsp-3xs pt-vsp-md pt-vsp-sm pt-vsp-xl pt-vsp-xs ptag- public purely px px-hsp-lg px-hsp-md px-hsp-sm px-hsp-xl px-hsp-xs py-0 py-hsp-2xs py-hsp-sm py-hsp-xs py-vsp-2xs py-vsp-3xs py-vsp-md py-vsp-sm py-vsp-xl py-vsp-xs q r raw re-render re-run reach reaches reading ready real references regenerates reinit relative remains render rendered renders reorder replaced repopulate requires reserved resize resize-x resolve resolved resolves return returns right- right-0 ro robots role root rotate-180 rotate-90 round round-trip rounded rounded-full rounded-lg running runs runtime s safer samp schema-mismatch schema-missing script script-evaluation scripts scroll scrollbar scrolled scrollend search section section- see sel-bg sel-fg select select-none self-start separator server server-rendered set shadow-[0_1px_3px_color-mix(in_srgb,var(--color-fg)_8%,transparent)] shadow-lg shared shiki ships should show shown shrink-0 sidebar signal single sitemap- size skill skills slash slug sm:flex-row sm:grid-cols-2 sm:items-center sm:justify-between small so solid some source space-y-vsp-2xs spacing span spans spec specifiers sr-only stale state stay sticky still stored stray string strip stroke-linecap stroke-linejoin stroke-width strong style styles stylesheet sub subagents subsequent success summary sup support survives svg synchronous synchronously syntactically syntect tab tab-panel tabindex table tablist tabpanel tabs tabs-container tabs-content tabs-nav tag- tag-item- tbody td temp temp-element template temporary temporary-element test-results text text-accent text-bg text-body text-caption text-center text-code-fg text-fg text-heading text-info text-left text-micro text-muted text-muted/50 text-small text-title text-warning textarea tfoot th that the thead them theme theme-color theme-toggle then these they this through time title to toggle toggle-ai-chat toggle-design-token-panel token tokens tolerates too top-0 top-[3.5rem] top-full total tr tracking-wider trade-off transition-[background,color,border-color] transition-colors transition-transform tree-child- tree-item- tree-top- trick trigger trigger:ai-chat trigger:design-token-panel triggers true try twitter:card twitter:creator twitter:description twitter:image twitter:site twitter:title two u ul unavailable undefined under underline understand unknown unmaintained unobserve unreadable unreleased unreliable unset unsupported up uppercase use used uses utf-8 utf8 utilities v val value values var variable version- version-menu version-switcher vertical via video viewport visible vitesse-dark w w-[0.5rem] w-[0.875rem] w-[1.575rem] w-[16px] w-[280px] w-[var(--zd-sidebar-w)] w-full w-icon-sm w-icon-xs was watching wbr wbr- we when where whereas which while whitespace-nowrap whitespace-pre whole will with without word worktrees would wrap wrapper wrappers written wrote xl:flex xl:hidden y-scrollbar yet z-10 z-30 z-50 zd-content zd-html-preview-code zfb zfb:after-swap zfb:before-preparation zudo-doc-design-tokens/v1 zudo-doc-sidebar-width zudo-doc-theme zudo-doc-theme-bridge zudo-doc-tweak-state zudo-doc-tweak-state-v2");
|
|
@@ -59,7 +59,8 @@ function toSidebarNodes(parent, locale, buildHref, categoryMeta, parentSortOrder
|
|
|
59
59
|
for (const child of parent.children.values()) {
|
|
60
60
|
const doc = child.doc;
|
|
61
61
|
const meta = categoryMeta?.get(child.fullPath);
|
|
62
|
-
const
|
|
62
|
+
const noPage = doc?.data.category_no_page ?? meta?.noPage;
|
|
63
|
+
const sortOrder = doc?.data.category_sort_order ?? meta?.sortOrder ?? "asc";
|
|
63
64
|
const children = toSidebarNodes(
|
|
64
65
|
child,
|
|
65
66
|
locale,
|
|
@@ -67,13 +68,14 @@ function toSidebarNodes(parent, locale, buildHref, categoryMeta, parentSortOrder
|
|
|
67
68
|
categoryMeta,
|
|
68
69
|
sortOrder
|
|
69
70
|
);
|
|
70
|
-
const hasPage = !!doc;
|
|
71
|
+
const hasPage = !!doc && noPage !== true;
|
|
71
72
|
const isCategory = !hasPage && children.length > 0;
|
|
72
73
|
const label = doc?.data.sidebar_label ?? doc?.data.title ?? meta?.label ?? toTitleCase(child.segment);
|
|
73
74
|
const description = doc?.data.description ?? meta?.description;
|
|
74
75
|
const positionRaw = doc?.data.sidebar_position ?? meta?.position;
|
|
75
76
|
const position = positionRaw ?? 999;
|
|
76
|
-
const href =
|
|
77
|
+
const href = noPage ? void 0 : doc || children.length > 0 ? buildHref(child.fullPath, locale) : void 0;
|
|
78
|
+
const hasSortOrder = doc?.data.category_sort_order !== void 0 || meta?.sortOrder !== void 0;
|
|
77
79
|
nodes.push({
|
|
78
80
|
type: isCategory ? "category" : "doc",
|
|
79
81
|
id: child.fullPath,
|
|
@@ -82,7 +84,7 @@ function toSidebarNodes(parent, locale, buildHref, categoryMeta, parentSortOrder
|
|
|
82
84
|
...positionRaw !== void 0 ? { sidebar_position: positionRaw } : {},
|
|
83
85
|
...href !== void 0 ? { href } : {},
|
|
84
86
|
hasPage,
|
|
85
|
-
...
|
|
87
|
+
...hasSortOrder ? { sortOrder } : {},
|
|
86
88
|
children
|
|
87
89
|
});
|
|
88
90
|
Object.defineProperty(nodes[nodes.length - 1], "__sortPosition", {
|
|
@@ -27,6 +27,20 @@ interface SidebarFrontmatter {
|
|
|
27
27
|
* the slug from the entry's id (stripping a trailing `/index`).
|
|
28
28
|
*/
|
|
29
29
|
slug?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Category metadata carried on a directory's `index.mdx` frontmatter — the
|
|
32
|
+
* frontmatter equivalent of `_category_.json`'s `noPage`. When `true`, this
|
|
33
|
+
* index file exists only to label/position the category: it renders as a
|
|
34
|
+
* non-linked sidebar header and is excluded from routes, the sitemap, and
|
|
35
|
+
* the search index. Frontmatter wins over the sidecar when both are present.
|
|
36
|
+
*/
|
|
37
|
+
category_no_page?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Frontmatter equivalent of `_category_.json`'s `sortOrder`. Controls the
|
|
40
|
+
* sort direction of this category's children. Frontmatter wins over the
|
|
41
|
+
* sidecar when both are present.
|
|
42
|
+
*/
|
|
43
|
+
category_sort_order?: "asc" | "desc";
|
|
30
44
|
}
|
|
31
45
|
/**
|
|
32
46
|
* Minimum shape required of a content collection entry. Designed to be a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takazudo/zudo-doc",
|
|
3
|
-
"version": "0.2.0-next.
|
|
3
|
+
"version": "0.2.0-next.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "zudo-doc framework primitives layer that sits on top of zfb's engine — sidebar, theme, TOC, breadcrumb, layouts, head injection, View Transitions, SSR-skip wrappers (per ADR-003).",
|
|
6
6
|
"license": "MIT",
|
|
@@ -150,7 +150,9 @@
|
|
|
150
150
|
"./icons": {
|
|
151
151
|
"types": "./dist/icons/index.d.ts",
|
|
152
152
|
"default": "./dist/icons/index.js"
|
|
153
|
-
}
|
|
153
|
+
},
|
|
154
|
+
"./safelist.css": "./dist/safelist.css",
|
|
155
|
+
"./safelist": "./dist/safelist.css"
|
|
154
156
|
},
|
|
155
157
|
"files": [
|
|
156
158
|
"dist",
|
|
@@ -161,7 +163,7 @@
|
|
|
161
163
|
"@takazudo/zfb": "^0.1.0-next.35",
|
|
162
164
|
"@takazudo/zfb-runtime": "^0.1.0-next.35",
|
|
163
165
|
"@takazudo/zdtp": "^0.2.0-next.2",
|
|
164
|
-
"@takazudo/zudo-doc-history-server": "^0.2.0-next.
|
|
166
|
+
"@takazudo/zudo-doc-history-server": "^0.2.0-next.8"
|
|
165
167
|
},
|
|
166
168
|
"peerDependenciesMeta": {
|
|
167
169
|
"@takazudo/zudo-doc-history-server": {
|