mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-22 00:31:17 +00:00
fix(wiki): module label keys is created in English ot avoid inconsistent slugs between runs
This commit is contained in:
parent
93c7a3b34c
commit
b849743dbc
1 changed files with 6 additions and 3 deletions
|
|
@ -186,7 +186,7 @@ export class WikiGenerator {
|
|||
private buildSystemPrompt(base: string): string {
|
||||
if (!this.options.lang) return base;
|
||||
const lang = this.options.lang.trim();
|
||||
return `${base}\n\nIMPORTANT: Write ALL documentation content in ${lang}. This includes headings, prose, code comments in examples, and diagram labels.`;
|
||||
return `${base}\n\nIMPORTANT: Write ALL documentation content in ${lang}. This includes prose, code comments in examples, and diagram labels. Note: page titles (H1 headings) are generated separately and will remain in English.`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -437,9 +437,12 @@ export class WikiGenerator {
|
|||
DIRECTORY_TREE: dirTree,
|
||||
});
|
||||
|
||||
// Grouping is a structured-data phase (JSON output), not documentation.
|
||||
// Do NOT apply buildSystemPrompt here — a language instruction would risk
|
||||
// translating module-name keys, breaking slug stability and JSON parsing.
|
||||
const response = await this.invokeLLM(
|
||||
prompt,
|
||||
this.buildSystemPrompt(GROUPING_SYSTEM_PROMPT),
|
||||
GROUPING_SYSTEM_PROMPT,
|
||||
this.streamOpts('Grouping files', 15, 13),
|
||||
);
|
||||
const grouping = this.parseGroupingResponse(response.content, files);
|
||||
|
|
@ -617,7 +620,7 @@ export class WikiGenerator {
|
|||
this.streamOpts(node.name),
|
||||
);
|
||||
|
||||
// Write page with front matter
|
||||
// H1 uses the English module name (stable slug source); body is LLM-translated.
|
||||
const pageContent = sanitizeMermaidMarkdown(`# ${node.name}\n\n${response.content}`);
|
||||
await fs.writeFile(path.join(this.wikiDir, `${node.slug}.md`), pageContent, 'utf-8');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue