feat(wiki): add --language option for multilingual wiki generation#196
feat(wiki): add --language option for multilingual wiki generation#196jnMetaCode wants to merge 1 commit into
Conversation
|
@jnMetaCode is attempting to deploy a commit to the NexusCore Team on Vercel. A member of the Team first needs to authorize it. |
Add a --language flag to the wiki command that instructs the LLM to generate documentation in the specified language (e.g. zh-CN, ja, ko). Code identifiers, file paths, and Mermaid labels stay in their original form — only prose headings and descriptions are translated. The grouping step is unaffected since it must output structured JSON. Closes abhigyanpatwari#95
0b2ae0d to
c341a7b
Compare
reversTeam
left a comment
There was a problem hiding this comment.
Clean and well-scoped PR, @jnMetaCode. This is a nice feature addition. Approving.
What looks good:
- The
withLanguage()helper is a simple, elegant approach — appending a language instruction to the system prompt keeps the change minimal and non-invasive. - Correctly applied to leaf modules, parent modules, and overview generation, but not to the grouping step (which needs structured JSON output). Good judgment call.
- The instruction to keep code identifiers, file paths, and Mermaid node labels in their original form is important and well-worded.
- CLI option, interface types, and README docs are all updated consistently.
One minor thought (non-blocking):
- The language value is passed as a free-form string (e.g.,
zh-CN,ja). This is fine and flexible, but the LLM prompt says "Write ALL documentation output in zh-CN" — for some models, a human-readable language name ("Chinese", "Japanese") might produce better results than a locale code. You could consider a small mapping for common codes, but this is a nice-to-have and not a blocker.
Well done — this pairs nicely with the Chinese README PR (#197).
|
|
Please submit a new PR if this is still relevant |
Summary
Closes #95
Adds a
--language <lang>flag to the wiki command so users can generate documentation in their preferred language.How it works
When
--languageis set, a language instruction is appended to the LLM system prompts for module pages, parent pages, and the overview page. The grouping step is unaffected since it must output structured JSON.Code identifiers, file paths, and Mermaid diagram labels stay in their original form — only the prose (headings, descriptions, explanations) is written in the target language.
Changes
cli/index.ts— register--language <lang>CLI optioncli/wiki.ts— passlanguagethroughWikiCommandOptions→WikiOptionscore/wiki/generator.ts—withLanguage()helper appends language instruction to system prompts; applied to leaf, parent, and overview generationREADME.md— document the new flagTest plan
gitnexus wiki --helpshows the new--languageoptiongitnexus wikiwithout--languageworks as before (no change to prompts)gitnexus wiki --language zh-CNgenerates Chinese documentation with original code identifiers preserved