Skip to content

Conversation

Copy link

Copilot AI commented Aug 19, 2025

Implements the requested feature "为文档新增 json-schema 生成到 Config Reference 页的脚本" (Add a script to generate json-schema to the Config Reference page in the documentation).

What this adds

This PR adds automated JSON schema documentation generation for rabbit-digger-pro configuration files:

  • New Config Reference page at /docs/config/reference that displays comprehensive schema documentation
  • Automated script that generates the documentation from the existing schema generation capability
  • Build integration so the documentation stays up-to-date automatically

Implementation details

Files added:

  • docs/scripts/generate-schema-docs.js - Main Node.js script that generates the documentation
  • docs/scripts/README.md - Documentation for the script
  • docs/docs/config/reference.md - Generated Config Reference page

Package.json changes:

  • Added generate-schema-docs npm script
  • Integrated schema generation into the build process (npm run build)
  • Fixed mermaid theme version compatibility issue

How it works

  1. Reuses existing functionality: The script calls the existing rabbit-digger-pro generate-schema CLI command
  2. Converts to documentation: Parses the JSON schema and converts it to well-formatted Chinese markdown
  3. Extracts types automatically: Lists all supported net and server types from the schema definitions
  4. Integrates with build: Runs automatically during documentation builds to keep content current

Usage

# Generate documentation manually
npm run generate-schema-docs

# Build docs (includes automatic schema generation)
npm run build

The script automatically detects and works with both debug and release builds of the binary.

Benefits

  • Always up-to-date: Schema documentation is regenerated from current code, eliminating manual maintenance
  • Comprehensive: Shows complete JSON schema with all supported configuration types
  • Developer-friendly: Includes instructions for using the schema in editors like VS Code for autocomplete
  • Minimal impact: Reuses existing schema generation code without modifying core functionality

Config Reference Page

The new Config Reference page is now accessible in the documentation sidebar and provides comprehensive JSON schema information for configuration files, making it easier for users to understand and write valid configurations.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] 为文档新增 json-schema 生成到 Config Reference 页的脚本 Add JSON schema generation script for Config Reference documentation page Aug 19, 2025
Copilot AI requested a review from spacemeowx2 August 19, 2025 19:43
Copilot finished work on behalf of spacemeowx2 August 19, 2025 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants