惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Engineering at Meta
Engineering at Meta
D
Docker
IT之家
IT之家
博客园_首页
罗磊的独立博客
V
V2EX
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
美团技术团队
Y
Y Combinator Blog
博客园 - 聂微东
量子位
阮一峰的网络日志
阮一峰的网络日志
GbyAI
GbyAI
Microsoft Security Blog
Microsoft Security Blog
博客园 - Franky
Martin Fowler
Martin Fowler
Jina AI
Jina AI
大猫的无限游戏
大猫的无限游戏
C
Check Point Blog
月光博客
月光博客
G
Google Developers Blog
B
Blog
T
The Blog of Author Tim Ferriss
爱范儿
爱范儿

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix: repair generated docs accordion indentation · opencl...
steipete · 2026-04-24 · via Recent Commits to openclaw:main

@@ -167,6 +167,28 @@ function ensureDir(dirPath) {

167167

fs.mkdirSync(dirPath, { recursive: true });

168168

}

169169170+

function walkMarkdownFiles(entryPath, out = []) {

171+

if (!fs.existsSync(entryPath)) {

172+

return out;

173+

}

174+175+

const stat = fs.statSync(entryPath);

176+

if (stat.isFile()) {

177+

if (/\.mdx?$/i.test(entryPath)) {

178+

out.push(entryPath);

179+

}

180+

return out;

181+

}

182+183+

for (const entry of fs.readdirSync(entryPath, { withFileTypes: true })) {

184+

if (entry.name === "node_modules" || entry.name === ".git") {

185+

continue;

186+

}

187+

walkMarkdownFiles(path.join(entryPath, entry.name), out);

188+

}

189+

return out;

190+

}

191+170192

function readJson(filePath) {

171193

return JSON.parse(fs.readFileSync(filePath, "utf8"));

172194

}

@@ -262,6 +284,75 @@ function composeDocsConfig() {

262284

};

263285

}

264286287+

function repairMintlifyAccordionIndentation(raw) {

288+

const lines = raw.split(/\r?\n/u);

289+

const accordionStack = [];

290+

let inCodeFence = false;

291+

let changed = false;

292+293+

for (let index = 0; index < lines.length; index += 1) {

294+

const line = lines[index];

295+

if (/^\s*(```|~~~)/u.test(line)) {

296+

inCodeFence = !inCodeFence;

297+

continue;

298+

}

299+

if (inCodeFence) {

300+

continue;

301+

}

302+303+

const openAccordion = line.match(/^(\s*)<Accordion\b/u);

304+

if (openAccordion) {

305+

accordionStack.push({

306+

indent: openAccordion[1].length,

307+

hasOutdentedListItem: false,

308+

});

309+

continue;

310+

}

311+312+

const listItem = line.match(/^(\s*)[-*+]\s+/u);

313+

if (listItem) {

314+

for (const accordion of accordionStack) {

315+

if (listItem[1].length < accordion.indent) {

316+

accordion.hasOutdentedListItem = true;

317+

}

318+

}

319+

}

320+321+

const closeAccordion = line.match(/^(\s*)<\/Accordion>/u);

322+

if (!closeAccordion) {

323+

continue;

324+

}

325+326+

const opening = accordionStack.pop();

327+

if (opening && opening.hasOutdentedListItem && closeAccordion[1].length > opening.indent) {

328+

lines[index] = `${" ".repeat(opening.indent)}${line.slice(closeAccordion[1].length)}`;

329+

changed = true;

330+

}

331+

}

332+333+

return changed ? lines.join("\n") : raw;

334+

}

335+336+

function repairGeneratedLocaleDocs(targetDocsDir) {

337+

let repaired = 0;

338+

for (const locale of GENERATED_LOCALES) {

339+

const localeDir = path.join(targetDocsDir, locale.dir);

340+

for (const filePath of walkMarkdownFiles(localeDir)) {

341+

const raw = fs.readFileSync(filePath, "utf8");

342+

const repairedRaw = repairMintlifyAccordionIndentation(raw);

343+

if (repairedRaw === raw) {

344+

continue;

345+

}

346+

fs.writeFileSync(filePath, repairedRaw);

347+

repaired += 1;

348+

}

349+

}

350+351+

if (repaired > 0) {

352+

console.log(`Repaired Mintlify accordion indentation in ${repaired} generated locale doc(s).`);

353+

}

354+

}

355+265356

function syncDocsTree(targetRoot) {

266357

const targetDocsDir = path.join(targetRoot, "docs");

267358

ensureDir(targetDocsDir);

@@ -298,6 +389,7 @@ function syncDocsTree(targetRoot) {

298389

}

299390

}

300391392+

repairGeneratedLocaleDocs(targetDocsDir);

301393

writeJson(path.join(targetDocsDir, "docs.json"), composeDocsConfig());

302394

}

303395