Add comprehensive project architecture documentation #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR addresses the issue "总结一下项目架构" (Summarize the project architecture) by adding detailed bilingual documentation explaining the zdocs project's architecture, components, and design decisions.
What's Added
ARCHITECTURE.md
A comprehensive architecture document covering:
src/main.zig): Command-line interface, HTTP server, static file serving, and source code archivalsrc/wasm/): AST parsing (Walk.zig), declaration management (Decl.zig), HTML rendering (html_render.zig), and Markdown processing (markdown.zig)www/): TypeScript/Bun-based web server, WASM interface, and browser-side documentation UIREADME.md Updates
Added a new "documentation" section that links to the architecture documentation, making it easily discoverable for new contributors and users who want to understand the project structure.
Benefits
Documentation Highlights
The architecture follows a clean separation of concerns:
This design enables zdocs to be distributed as a single binary while also supporting a more flexible web-based deployment for serving documentation of multiple Zig packages simultaneously.
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.