Файли
openidea/scripts/theme/gen-docs.ts
T
l0ng-ai 805d588303 docs: move plugin docs next to plugins/README.md
docs/plugins/themes.md and indexing.md move to plugins/. Update the
theme doc generator, its test, the plugin template, AGENTS.md and every
link to the new paths.
2026-11-10 16:13:06 +08:00

15 рядки
661 B
TypeScript

/**
* Regenerates the token reference in plugins/themes.md from
* src/styles/tokens.css (`pnpm gen:theme-docs`). scripts/theme/theme.test.ts
* fails when the checked-in reference is stale.
*/
import { readFileSync, writeFileSync } from "node:fs";
import { referenceMarkdown, themeTokenGroups, withReference } from "./tokens.ts";
const DOC = "plugins/themes.md";
const groups = themeTokenGroups(readFileSync("src/styles/tokens.css", "utf8"));
const doc = readFileSync(DOC, "utf8");
const next = withReference(doc, referenceMarkdown(groups));
if (next !== doc) writeFileSync(DOC, next);
console.log(next === doc ? `${DOC} is up to date` : `updated ${DOC}`);