Skip to content

Latest commit

 

History

History
105 lines (76 loc) · 3.12 KB

File metadata and controls

105 lines (76 loc) · 3.12 KB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

This is the official documentation site for MyBatis-Plus, built with Astro and Starlight. The site supports multi-language documentation (Chinese, English, Japanese) with an integrated translation plugin.

Development Commands

# Start development server
npm run dev
# or
npm start

# Build the site (includes type checking)
npm run build

# Preview the built site
npm run preview

# Check types only
astro check

Translation System

The project includes a custom translation plugin located in translation-plugin/:

# Translate all content to all target languages
npm run translate

# Translate to specific language
npm run translate:en    # English
npm run translate:ja    # Japanese

# Dry run to check what would be translated
npm run translate:check

# Incremental translation (only changed files)
npm run translate:incremental

# Translate specific file
npm run translate:file
npm run translate:en:file
npm run translate:ja:file

Translation configuration is in translation-plugin/config.json. The plugin supports multiple AI providers and maintains translation cache.

Architecture

  • Framework: Astro with Starlight documentation theme
  • Styling: TailwindCSS with custom components
  • Interactive Components: Svelte components for dynamic features
  • Content: Markdown files in src/content/docs/ with frontmatter
  • Localization: Multi-language support with automatic sidebar generation

Key Directories

  • src/content/docs/ - Main documentation content (Chinese)
  • src/content/docs/en/ - English translations
  • src/content/docs/ja/ - Japanese translations
  • src/components/ - Astro and Svelte components
  • translation-plugin/ - Custom translation automation system

Component Structure

Custom Starlight components are overridden in src/components/:

  • Header.astro - Site header
  • Footer.astro - Site footer
  • Sidebar.astro - Navigation sidebar
  • PageSidebar.astro - Page-specific sidebar

Content Organization

Documentation follows Starlight's structure with autogenerated sidebars:

  • getting-started/ - Getting started guides
  • guides/ - User guides
  • plugins/ - Plugin documentation
  • reference/ - API reference
  • resources/ - Additional resources

Configuration Files

  • astro.config.mjs - Main Astro configuration with Starlight setup
  • tailwind.config.mjs - TailwindCSS configuration
  • tsconfig.json - TypeScript configuration
  • translation-plugin/config.json - Translation system configuration

Multi-language Support

The site uses Starlight's built-in i18n with:

  • Default locale: Chinese (root)
  • Supported locales: English (en), Japanese (ja)
  • Translations managed through frontmatter and the translation plugin
  • Edit links point to the GitHub repository

When working with content:

  1. Always update the Chinese (root) version first
  2. Use the translation plugin to generate other language versions
  3. Review generated translations for technical accuracy
  4. Ensure code examples and links work across all languages