Skip to content

Commit fc980b2

Browse files
committed
docs:重构文档系统,新增国际化支持
- 新增中英文双语文档结构 (docs/en/ 和 docs/zh/) - 更新 VitePress 配置支持 i18n 和语言切换 - 专业化重写 CHANGELOG.md,使用标准格式 - 优化 README.md 和 README.zh-CN.md,改进视觉效果 - 所有指南页面提供完整中英对照 Release-Note: 完整文档国际化支持,包含中英文双语站点
1 parent 8860c6b commit fc980b2

13 files changed

Lines changed: 2085 additions & 222 deletions

CHANGELOG.md

Lines changed: 135 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,184 @@
1-
# Changelog | 变更日志
1+
# Changelog
22

33
All notable changes to this project will be documented in this file.
44

5-
本文件记录本项目的所有重要变更。
6-
75
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
86
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
97

10-
格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/)
11-
本项目遵循 [语义化版本](https://semver.org/lang/zh-CN/)
12-
138
## [Unreleased]
149

15-
### Added | 新增
16-
- VitePress SEO: Open Graph / Twitter Card meta tags, sitemap, cleanUrls
17-
- Docs landing page: feature cards with anchor links, richer hero tagline
18-
- Docs algorithms page: complexity analysis table, Huffman/Arithmetic comparison, Range Coder vs Arithmetic differences
19-
- Docs getting-started: code-group tabs, Makefile command table, structured environment requirements
20-
- Docs project-structure: CI/CD table, file format table, enhanced directory tree
21-
- Site favicon (logo.svg)
10+
### Added
11+
12+
#### Documentation
13+
14+
- **Internationalization (i18n)**: Complete bilingual documentation site (English & Chinese)
15+
- New directory structure: `docs/en/` and `docs/zh/`
16+
- VitePress configuration with locale switcher
17+
- Full translations for all guide pages
18+
- Enhanced README with modern badges and improved structure
19+
- Professional changelog reorganization with detailed categorization
20+
21+
#### Algorithms & Implementations
22+
2223
- Arithmetic coding Go implementation with full test suite
2324
- Arithmetic coding Rust implementation with full test suite
2425
- Range coder Go CLI (`range/go/cmd/main.go`) for cross-language testing
2526
- Range coder Rust CLI (`range/rust/src/bin/rangecoder.rs`) for cross-language testing
26-
- Cross-language benchmark script for Arithmetic coding (`arithmetic/benchmark/bench.py`)
27-
- Cross-language benchmark script for Range coder (`range/benchmark/bench.py`)
28-
- CI cross-language correctness tests for Arithmetic and Range coder (all 3 languages)
29-
30-
### Changed | 变更
31-
- Pages workflow: sparse-checkout (skip algorithm source), Node 20→22, package-lock.json path trigger
32-
- VitePress sidebar restructured into "入门" + "算法" groups, nav added "相关链接" dropdown
33-
- README.md: fixed dead doc links (algorithms, benchmarks → guide/ paths)
34-
- Upgraded Arithmetic benchmark from C++-only to cross-language (C++, Go, Rust)
35-
- Overhauled Makefile with complete build/test/clean targets for all algorithms and languages
36-
- Updated CI workflow: full build, test, and cross-language verification for all 4 algorithms × 3 languages
27+
28+
#### Infrastructure
29+
30+
- Cross-language benchmark scripts for Arithmetic coding and Range coder
31+
- CI cross-language correctness tests for all 4 algorithms × 3 languages
32+
- Input size validation (4 GiB max) to prevent frequency overflow attacks
33+
- Output size validation (1 GiB max) to prevent decompression bombs
34+
- RAII/smart pointers for memory management in C++ Huffman implementation
35+
- `-Werror` flag in Makefile for C++ builds to catch all warnings
36+
37+
### Changed
38+
39+
#### Documentation Site
40+
41+
- VitePress sidebar restructured into logical groups (Overview, Guide, Reference)
42+
- README.md simplified to repository entry point with links to docs site
43+
- Updated site metadata and SEO optimization (Open Graph, Twitter Cards)
44+
45+
#### Build & CI
46+
47+
- Pages workflow: sparse-checkout optimization, Node 20→22, path-based triggers
48+
- CI workflow: full build, test, and cross-language verification matrix
49+
- Makefile: complete build/test/clean targets for all algorithms and languages
50+
- Arithmetic benchmark upgraded from C++-only to cross-language (C++, Go, Rust)
51+
52+
#### Code Quality
53+
54+
- All error messages standardized to English across all implementations
55+
- All Chinese comments translated to English for consistency
3756
- Updated `go.work` to include `arithmetic/go` module
3857
- Updated `range/rust/Cargo.toml` to include `rangecoder` CLI binary
39-
- Updated `.gitignore` for new binaries and file extensions
40-
- Updated `run_all_bench.py` to use unified cross-language benchmark scripts
41-
- Updated README: algorithm table, project structure, Go version badge (1.21+), roadmap
42-
43-
### Fixed | 修复
44-
- README badge URL: `docs.yml``pages.yml` (both EN & ZH READMEs)
45-
- README algorithm table: "LZ77" → "Range Coder" (matched actual project directory)
46-
- README project structure: `lz77/``range/`
58+
59+
### Fixed
60+
61+
- README badge URL: `docs.yml``pages.yml`
62+
- README algorithm table: corrected "LZ77" → "Range Coder"
63+
- README project structure: corrected `lz77/``range/`
4764
- `.gitignore`: removed bare `Makefile` pattern that could shadow root Makefile
48-
- Fixed Makefile `build-range` target (was running `go test` instead of building CLI)
49-
- Fixed Makefile `clean` target (replaced fragile Python one-liner with proper `rm` commands)
65+
- Makefile `build-range` target: fixed incorrect `go test` call
66+
- Makefile `clean` target: replaced fragile Python one-liner with proper `rm` commands
67+
- Huffman cross-language compatibility: unified tree building tie-breaking across C++, Go, Rust
68+
- CI Python setup: removed invalid `cache: pip` option
69+
- CI Range coder tests: using 100KB test file to work around decode performance issue
70+
71+
### Security
72+
73+
- Added input size limits to prevent frequency overflow attacks
74+
- Added output size limits to prevent decompression bomb attacks
75+
- All implementations now validate file sizes before processing
76+
77+
---
5078

5179
## [1.0.0] - 2026-01-07
5280

53-
### Added | 新增
81+
### Added
82+
83+
#### Core Algorithms
84+
85+
- **Huffman Coding**: Implementation in C++, Go, and Rust
86+
- Prefix-code based lossless compression
87+
- Cross-language file format compatibility
88+
- Benchmark suite
89+
90+
- **Arithmetic Coding**: Implementation in C++
91+
- Interval subdivision based compression
92+
- Near-optimal compression efficiency
5493

55-
#### Algorithms | 算法
56-
- Huffman encoding implementation in C++, Go, and Rust
57-
- Arithmetic coding implementation in C++
58-
- Range coder implementation in C++, Go, and Rust
59-
- Run-Length Encoding (RLE) implementation in C++, Go, and Rust
94+
- **Range Coder**: Implementation in C++, Go, and Rust
95+
- Integer-based arithmetic coding equivalent
96+
- Library API for Go and Rust
97+
- CLI tools for all languages
98+
99+
- **Run-Length Encoding (RLE)**: Implementation in C++, Go, and Rust
100+
- Simple (count, value) pair encoding
101+
- Optimized for repetitive data
102+
103+
#### Features
60104

61-
#### Features | 功能
62105
- Unified CLI interface across all implementations (`encode`/`decode` commands)
63106
- Cross-language file format compatibility
64107
- Benchmark scripts for performance comparison
65-
- Test data generation scripts
108+
- Test data generation scripts (Python)
109+
110+
#### Documentation
66111

67-
#### Documentation | 文档
68112
- Comprehensive README with bilingual (Chinese/English) content
69-
- Algorithm comparison table
70-
- Quick start guide
113+
- Algorithm comparison table with complexity analysis
114+
- Quick start guide with build instructions
71115
- Project structure documentation
72116

73-
#### Open Source Infrastructure | 开源基础设施
117+
#### Open Source Infrastructure
118+
74119
- MIT License
75-
- Contributing guidelines (CONTRIBUTING.md)
76-
- Code of Conduct (CODE_OF_CONDUCT.md)
77-
- Security policy (SECURITY.md)
120+
- Contributing guidelines (CONTRIBUTING.md) - bilingual
121+
- Code of Conduct (CODE_OF_CONDUCT.md) - bilingual
122+
- Security policy (SECURITY.md) - bilingual
78123
- GitHub Issue templates (bug report, feature request)
79124
- GitHub Pull Request template
80-
- GitHub Actions CI/CD pipeline
125+
126+
#### CI/CD Pipeline
127+
128+
- GitHub Actions CI workflow
81129
- Multi-platform C++ builds (Ubuntu, macOS)
82130
- Go build and lint checks
83131
- Rust build and clippy checks
84132
- Encode/decode correctness verification
85133
- Required files check
134+
- GitHub Actions Pages workflow for documentation deployment
135+
136+
### Technical Specifications
137+
138+
#### File Formats
86139

87-
### Technical Details | 技术细节
140+
| Algorithm | Magic | Header | Data |
141+
|-----------|-------|--------|------|
142+
| Huffman | `HFMN` | Frequency table (257×4 bytes) | Bit stream |
143+
| Arithmetic | `AENC` | Frequency table (257×4 bytes) | Bit stream |
144+
| Range Coder | `RCNC` | Frequency table (257×4 bytes) | Byte stream |
145+
| RLE | None | None | (count, value) pairs |
88146

89-
#### File Formats | 文件格式
90-
- Huffman: Magic header `HFMN`, frequency table, bit-encoded data
91-
- RLE: `(count, value)` pairs with 4-byte little-endian count
147+
#### Build Requirements
92148

93-
#### Build Requirements | 构建要求
94-
- C++17 compatible compiler
95-
- Go 1.21+
96-
- Rust 1.70+
97-
- Python 3.8+ (for scripts)
149+
| Language | Version | Compiler/Tool |
150+
|----------|---------|---------------|
151+
| C++ | C++17 | g++ 9+ or clang++ 10+ |
152+
| Go | 1.21+ | go 1.21+ |
153+
| Rust | 1.70+ | rustc 1.70+ |
154+
| Python | 3.8+ | python3 3.8+ |
98155

99156
---
100157

101-
## Version History Summary | 版本历史摘要
158+
## Version History Summary
102159

103160
| Version | Date | Highlights |
104161
|---------|------|------------|
105-
| 1.0.0 | 2026-01-07 | Initial release with 4 algorithms, 3 languages, full open source setup |
162+
| [Unreleased] | - | Documentation i18n, security improvements, complete test coverage |
163+
| [1.0.0] | 2026-01-07 | Initial release with 4 algorithms, 3 languages, full open source setup |
106164

107165
---
108166

167+
## Release Comparison
168+
109169
[Unreleased]: https://github.com/LessUp/encoding/compare/v1.0.0...HEAD
110170
[1.0.0]: https://github.com/LessUp/encoding/releases/tag/v1.0.0
171+
172+
---
173+
174+
## Contributing
175+
176+
When adding changes to this changelog, please follow the categorization:
177+
178+
- `Added` - New features
179+
- `Changed` - Changes in existing functionality
180+
- `Deprecated` - Soon-to-be removed features
181+
- `Removed` - Now removed features
182+
- `Fixed` - Bug fixes
183+
- `Security` - Security-related changes
184+
- `Performance` - Performance improvements

0 commit comments

Comments
 (0)