zeekayandHanzo Dev 6556cba1e1 Typecheck on the native compiler, keep 6 for the tools
typescript 7.0.2 is the native compiler and exports no JavaScript API, so next
and jest cannot read it. It comes in aliased as tsgo and does the typechecking;
typescript stays on the 6 line for the tools. website and translator both report
0 diagnostics before and after.

Three settings 7 removed had to move:
- website dropped baseUrl (TS5102); its paths targets were already ./-relative.
- translator went from module commonjs + moduleResolution node10 (TS5108) to
  nodenext, which also lets the CommonJS entry require chalk and inquirer, both
  ESM-only, without TS1479.
- website/global.d.ts declares '*.css' for the side-effect stylesheet imports
  in app/layout.tsx and src/page/index.tsx (TS2882).
All three are neutral on 6 — that compiler reports the same removals and the
same count.

translator had no committed lockfile; one is added here so the pin installs
reproducibly.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-17 10:32:34 -07:00
2026-02-14 04:41:52 -08:00

Zen Code Docs — Multilingual Documentation Builder

A tool for syncing and translating technical documentation into multiple languages, with AI-powered translation via Zen models and a Nextra-based documentation site.

License Node.js Version

Features

  • GitHub sync: Automatically pulls documentation from any GitHub repository
  • AI translation: High-quality technical translation via Zen models (preserves code blocks, links, and formatting)
  • Multi-language: Supports Chinese (zh), German (de), French (fr), Russian (ru), Japanese (ja)
  • Nextra docs site: Generates a modern Next.js documentation site with language switching
  • Parallel processing: Translates multiple languages concurrently
  • Incremental sync: Tracks changes and only retranslates updated files

Installation

npm install -g @zen/code-docs

Quick Start

  1. Initialize a project:

    zen-docs init
    
  2. Configure environment variables:

    cp .env.example .env
    # Edit .env — set ZEN_API_KEY and source repo URL
    
  3. Sync source documentation:

    zen-docs sync
    
  4. Translate:

    zen-docs translate
    
  5. Start the documentation site:

    npm install
    npm run dev
    

Commands

init

Initialize a new translation project. Sets up directory structure, Nextra template, and config files.

sync [options]

Sync documentation from the source GitHub repository.

  • -f, --force — Force sync all documents (ignore previous sync records)

translate [options]

Translate documents to target languages.

  • -l, --language <lang> — Target a specific language (zh, de, fr, ru, ja)
  • -f, --file <file> — Translate a single file

config

View and manage project configuration interactively.

status

Show current project status and environment setup.

Configuration

translation.config.json (created during init):

{
  "name": "my-docs",
  "sourceRepo": "https://github.com/your-org/your-repo.git",
  "docsPath": "docs",
  "sourceLanguage": "en",
  "targetLanguages": ["zh", "de", "fr", "ru", "ja"],
  "outputDir": "content"
}

Environment Variables

# Required: Zen API key
ZEN_API_KEY=your_api_key

# Optional: API endpoint (defaults to local vLLM)
ZEN_BASE_URL=http://localhost:8000/v1
ZEN_MODEL=zenlm/zen-5-coder-gguf
ZEN_MAX_TOKENS=4000

Project Structure

After initialization:

├── content/
│   ├── en/           # Source language (synced from repo)
│   ├── zh/           # Chinese translations
│   ├── de/           # German translations
│   ├── fr/           # French translations
│   └── ru/           # Russian translations
├── app/              # Next.js app directory
│   ├── [lang]/       # Dynamic language routing
│   └── layout.tsx
├── .source-docs/     # Raw synced documentation
├── translation.config.json
├── translation-changelog.json
├── last-sync.json
└── package.json

How It Works

  1. Sync — Clones/updates the source repository and detects changed files
  2. Parse — Markdown is parsed while preserving structure and metadata
  3. Translate — Content is segmented and translated via Zen models, with smart handling of code blocks and technical terms
  4. Generate — Translated content is organized into a Nextra multilingual docs site
  5. Serve — Next.js serves the documentation with language switching
npm install
npm run build
npm run dev   # watch mode
npm test

License

Apache 2.0

S
Description
Zen Code Docs 4B - Documentation generation
Readme Apache-2.0
37 MiB
Languages
TypeScript 79.8%
JavaScript 14.5%
CSS 5.7%