Skip to content

Commit 4f34d93

Browse files
committed
docs: add Chinese architecture translation and fix VitePress config
- Create docs/zh/guide/architecture.md (translation of English version) - Add architecture.md to both English and Chinese sidebars - Fix og-image extension from .png to .svg (matching actual file)
1 parent c171bf2 commit 4f34d93

2 files changed

Lines changed: 35 additions & 2 deletions

File tree

docs/.vitepress/config.mts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const sharedSidebar = {
88
items: [
99
{ text: 'Introduction', link: '/en/' },
1010
{ text: 'Quick Start', link: '/en/guide/getting-started' },
11+
{ text: 'Architecture', link: '/en/guide/architecture' },
1112
{ text: 'Project Structure', link: '/en/guide/project-structure' },
1213
],
1314
},
@@ -53,6 +54,7 @@ const sharedSidebar = {
5354
items: [
5455
{ text: '项目介绍', link: '/zh/' },
5556
{ text: '快速开始', link: '/zh/guide/getting-started' },
57+
{ text: '架构设计', link: '/zh/guide/architecture' },
5658
{ text: '项目结构', link: '/zh/guide/project-structure' },
5759
],
5860
},
@@ -162,7 +164,7 @@ export default defineConfig({
162164
['meta', { property: 'og:description', content: 'Classic lossless compression algorithms in C++17, Go, and Rust with cross-language binary verification.' }],
163165
['meta', { property: 'og:url', content: 'https://lessup.github.io/compress-kit/' }],
164166
['meta', { property: 'og:site_name', content: 'CompressKit' }],
165-
['meta', { property: 'og:image', content: '/compress-kit/og-image.png' }],
167+
['meta', { property: 'og:image', content: '/compress-kit/og-image.svg' }],
166168
['meta', { property: 'og:image:width', content: '1200' }],
167169
['meta', { property: 'og:image:height', content: '630' }],
168170

@@ -171,7 +173,7 @@ export default defineConfig({
171173
['meta', { name: 'twitter:site', content: '@compresskit' }],
172174
['meta', { name: 'twitter:title', content: 'CompressKit | Compression Algorithms Collection' }],
173175
['meta', { name: 'twitter:description', content: 'Classic lossless compression algorithms in C++17, Go, and Rust with cross-language binary verification.' }],
174-
['meta', { name: 'twitter:image', content: '/compress-kit/og-image.png' }],
176+
['meta', { name: 'twitter:image', content: '/compress-kit/og-image.svg' }],
175177

176178
// Favicon
177179
['link', { rel: 'icon', type: 'image/svg+xml', href: '/compress-kit/logo.svg' }],

docs/zh/guide/architecture.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# 架构设计
2+
3+
CompressKit 现有算法核心之上采用两层内存集成模型:
4+
5+
```text
6+
调用方
7+
-> 缓冲层 (encode_buffer / decode_buffer)
8+
-> 流式层 (process / flush / finish / reset)
9+
-> 现有算法核心
10+
```
11+
12+
## 设计目的
13+
14+
- 文件到文件 CLI 现在与内存调用方共享相同的缓冲层路径
15+
- 生命周期语义在 C++17、Go 和 Rust 之间保持一致
16+
- 统一的错误处理使后续帧格式和一致性工作更易构建
17+
18+
## 语言实现
19+
20+
- C++: `algorithms/shared/cpp`
21+
- Go: `algorithms/shared/go`
22+
- Rust: `algorithms/shared/rust`
23+
24+
## 安全边界
25+
26+
- 流式层接受的输入上限为 `4 GiB`
27+
- 流式层产生的解码输出上限为 `1 GiB`
28+
29+
## 验证
30+
31+
`make test` 在运行算法特定测试套件之前,包含所有三种语言的共享流式生命周期测试。

0 commit comments

Comments
 (0)