Skip to content

Commit 13b0434

Browse files
committed
feat: add new compression algorithms and documentation
- Introduced new algorithms: Arithmetic Coding, Huffman Coding, Range Encoding, and Run-Length Encoding (RLE) with detailed explanations and code examples in C++, Go, and Rust. - Added SVG for Open Graph image to enhance social sharing. - Updated project structure and documentation links to reflect the new repository name "CompressKit". - Implemented cross-language testing framework to validate encoding/decoding across different languages. - Enhanced the homepage and various guides to improve user experience and clarity.
1 parent 18f80cb commit 13b0434

37 files changed

Lines changed: 4422 additions & 264 deletions

docs/.vitepress/config.mts

Lines changed: 203 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,21 @@ import { defineConfig } from 'vitepress'
44
const sharedSidebar = {
55
'/en/': [
66
{
7-
text: 'Overview',
7+
text: 'Getting Started',
88
items: [
9-
{ text: 'Home', link: '/en/' },
9+
{ text: 'Introduction', link: '/en/' },
1010
{ text: 'Quick Start', link: '/en/guide/getting-started' },
11-
{ text: 'Algorithms', link: '/en/guide/algorithms' },
11+
{ text: 'Project Structure', link: '/en/guide/project-structure' },
12+
],
13+
},
14+
{
15+
text: 'Algorithms',
16+
items: [
17+
{ text: 'Overview', link: '/en/guide/algorithms' },
18+
{ text: 'Huffman Coding', link: '/en/algorithms/huffman' },
19+
{ text: 'Arithmetic Coding', link: '/en/algorithms/arithmetic' },
20+
{ text: 'Range Coder', link: '/en/algorithms/range' },
21+
{ text: 'Run-Length Encoding', link: '/en/algorithms/rle' },
1222
],
1323
},
1424
{
@@ -20,28 +30,39 @@ const sharedSidebar = {
2030
],
2131
},
2232
{
23-
text: 'Benchmarks',
33+
text: 'Benchmarks & Testing',
2434
items: [
2535
{ text: 'Performance Results', link: '/en/benchmarks/results' },
2636
{ text: 'How to Run', link: '/en/benchmarks/how-to-run' },
37+
{ text: 'Cross-Language Testing', link: '/en/testing/cross-language' },
2738
],
2839
},
2940
{
3041
text: 'Reference',
3142
items: [
32-
{ text: 'Project Structure', link: '/en/guide/project-structure' },
43+
{ text: 'Specifications', link: 'https://github.com/LessUp/compresskit/tree/master/specs' },
3344
{ text: 'Contributing', link: '/en/guide/contributing' },
34-
{ text: 'Specs (SSOT)', link: 'https://github.com/LessUp/encoding/tree/master/specs' },
45+
{ text: 'Changelog', link: 'https://github.com/LessUp/compresskit/blob/master/CHANGELOG.md' },
3546
],
3647
},
3748
],
3849
'/zh/': [
3950
{
40-
text: '概览',
51+
text: '开始使用',
4152
items: [
42-
{ text: '首页', link: '/zh/' },
53+
{ text: '项目介绍', link: '/zh/' },
4354
{ text: '快速开始', link: '/zh/guide/getting-started' },
44-
{ text: '算法详解', link: '/zh/guide/algorithms' },
55+
{ text: '项目结构', link: '/zh/guide/project-structure' },
56+
],
57+
},
58+
{
59+
text: '算法详解',
60+
items: [
61+
{ text: '算法综述', link: '/zh/guide/algorithms' },
62+
{ text: '霍夫曼编码', link: '/zh/algorithms/huffman' },
63+
{ text: '算术编码', link: '/zh/algorithms/arithmetic' },
64+
{ text: '区间编码', link: '/zh/algorithms/range' },
65+
{ text: '行程编码', link: '/zh/algorithms/rle' },
4566
],
4667
},
4768
{
@@ -57,65 +78,147 @@ const sharedSidebar = {
5778
items: [
5879
{ text: '性能结果', link: '/zh/benchmarks/results' },
5980
{ text: '如何运行', link: '/zh/benchmarks/how-to-run' },
81+
{ text: '跨语言测试', link: '/zh/testing/cross-language' },
6082
],
6183
},
6284
{
6385
text: '参考',
6486
items: [
65-
{ text: '项目结构', link: '/zh/guide/project-structure' },
87+
{ text: '规范文档', link: 'https://github.com/LessUp/compresskit/tree/master/specs' },
6688
{ text: '参与贡献', link: '/zh/guide/contributing' },
67-
{ text: '规范文档 (SSOT)', link: 'https://github.com/LessUp/encoding/tree/master/specs' },
89+
{ text: '更新日志', link: 'https://github.com/LessUp/compresskit/blob/master/CHANGELOG.md' },
6890
],
6991
},
7092
],
7193
}
7294

7395
// Shared nav configuration
7496
const sharedNav = (lang: string) => [
75-
{ text: lang === 'zh' ? '概览' : 'Overview', link: lang === 'zh' ? '/zh/' : '/en/' },
76-
{ text: lang === 'zh' ? '快速开始' : 'Get Started', link: lang === 'zh' ? '/zh/guide/getting-started' : '/en/guide/getting-started' },
77-
{ text: lang === 'zh' ? '算法' : 'Algorithms', link: lang === 'zh' ? '/zh/guide/algorithms' : '/en/guide/algorithms' },
78-
{ text: lang === 'zh' ? 'API' : 'API', link: lang === 'zh' ? '/zh/api/go' : '/en/api/go' },
79-
{ text: lang === 'zh' ? '性能' : 'Benchmarks', link: lang === 'zh' ? '/zh/benchmarks/results' : '/en/benchmarks/results' },
80-
{ text: lang === 'zh' ? '贡献' : 'Contributing', link: lang === 'zh' ? '/zh/guide/contributing' : '/en/guide/contributing' },
81-
{ text: 'Changelog', link: 'https://github.com/LessUp/encoding/blob/master/CHANGELOG.md' },
97+
{
98+
text: lang === 'zh' ? '开始' : 'Get Started',
99+
link: lang === 'zh' ? '/zh/guide/getting-started' : '/en/guide/getting-started',
100+
activeMatch: lang === 'zh' ? '/zh/guide/' : '/en/guide/'
101+
},
102+
{
103+
text: lang === 'zh' ? '算法' : 'Algorithms',
104+
link: lang === 'zh' ? '/zh/guide/algorithms' : '/en/guide/algorithms',
105+
activeMatch: lang === 'zh' ? '/zh/algorithms/' : '/en/algorithms/'
106+
},
107+
{
108+
text: 'API',
109+
link: lang === 'zh' ? '/zh/api/go' : '/en/api/go',
110+
activeMatch: lang === 'zh' ? '/zh/api/' : '/en/api/'
111+
},
112+
{
113+
text: lang === 'zh' ? '基准' : 'Benchmarks',
114+
link: lang === 'zh' ? '/zh/benchmarks/results' : '/en/benchmarks/results',
115+
activeMatch: lang === 'zh' ? '/zh/benchmarks/' : '/en/benchmarks/'
116+
},
82117
]
83118

84119
export default defineConfig({
85-
// Default to English
120+
// Brand Configuration
86121
lang: 'en-US',
87-
title: 'Encoding',
88-
description: 'Compression algorithms collection: classic compression algorithms in C++, Go, and Rust for learning, comparison, and verification',
89-
base: '/encoding/',
122+
title: 'CompressKit',
123+
titleTemplate: ':title | CompressKit',
124+
description: 'Production-ready compression algorithms in C++17, Go, and Rust. Learn, compare, and verify across languages with identical binary formats.',
125+
126+
// Base URL
127+
base: '/compresskit/',
90128
cleanUrls: true,
91-
129+
130+
// Appearance
131+
appearance: true,
132+
133+
// Sitemap
92134
sitemap: {
93-
hostname: 'https://lessup.github.io/encoding/',
135+
hostname: 'https://lessup.github.io/compresskit/',
94136
},
95-
137+
138+
// Head Meta Tags
96139
head: [
97-
['link', { rel: 'canonical', href: 'https://lessup.github.io/encoding/' }],
98-
['meta', { name: 'theme-color', content: '#0f172a' }],
140+
['link', { rel: 'canonical', href: 'https://lessup.github.io/compresskit/' }],
141+
['meta', { charset: 'UTF-8' }],
142+
['meta', { name: 'viewport', content: 'width=device-width, initial-scale=1.0' }],
143+
['meta', { name: 'theme-color', content: '#2563eb', media: '(prefers-color-scheme: light)' }],
144+
['meta', { name: 'theme-color', content: '#0f172a', media: '(prefers-color-scheme: dark)' }],
145+
146+
// SEO
147+
['meta', { name: 'keywords', content: 'compression algorithms, huffman coding, arithmetic coding, range coder, run-length encoding, C++, Go, Rust, lossless compression, cross-language, benchmark' }],
148+
['meta', { name: 'author', content: 'CompressKit Team' }],
149+
['meta', { name: 'robots', content: 'index, follow' }],
150+
151+
// Open Graph
99152
['meta', { property: 'og:type', content: 'website' }],
100-
['meta', { property: 'og:title', content: 'Encoding | Compression Algorithms Collection' }],
101-
['meta', { property: 'og:description', content: 'Classic compression algorithms in C++, Go, and Rust for learning, comparison and cross-language verification' }],
102-
['meta', { property: 'og:url', content: 'https://lessup.github.io/encoding/' }],
153+
['meta', { property: 'og:locale', content: 'en_US' }],
154+
['meta', { property: 'og:title', content: 'CompressKit | Compression Algorithms Collection' }],
155+
['meta', { property: 'og:description', content: 'Production-ready compression algorithms in C++17, Go, and Rust. Learn, compare, and verify across languages.' }],
156+
['meta', { property: 'og:url', content: 'https://lessup.github.io/compresskit/' }],
157+
['meta', { property: 'og:site_name', content: 'CompressKit' }],
158+
['meta', { property: 'og:image', content: '/compresskit/og-image.png' }],
159+
['meta', { property: 'og:image:width', content: '1200' }],
160+
['meta', { property: 'og:image:height', content: '630' }],
161+
162+
// Twitter
103163
['meta', { name: 'twitter:card', content: 'summary_large_image' }],
104-
['meta', { name: 'twitter:title', content: 'Encoding | Compression Algorithms Collection' }],
105-
['meta', { name: 'twitter:description', content: 'Classic compression algorithms in C++, Go, and Rust for learning, comparison and cross-language verification' }],
106-
['link', { rel: 'icon', type: 'image/svg+xml', href: '/encoding/logo.svg' }],
164+
['meta', { name: 'twitter:site', content: '@compresskit' }],
165+
['meta', { name: 'twitter:title', content: 'CompressKit | Compression Algorithms Collection' }],
166+
['meta', { name: 'twitter:description', content: 'Production-ready compression algorithms in C++17, Go, and Rust. Learn, compare, and verify across languages.' }],
167+
['meta', { name: 'twitter:image', content: '/compresskit/og-image.png' }],
168+
169+
// Favicon
170+
['link', { rel: 'icon', type: 'image/svg+xml', href: '/compresskit/logo.svg' }],
171+
['link', { rel: 'mask-icon', href: '/compresskit/logo.svg', color: '#2563eb' }],
172+
['link', { rel: 'apple-touch-icon', href: '/compresskit/logo.svg' }],
173+
174+
// Preconnect for fonts
175+
['link', { rel: 'preconnect', href: 'https://fonts.googleapis.com' }],
176+
['link', { rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: '' }],
177+
['link', { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap' }],
178+
179+
// Structured Data (JSON-LD)
180+
['script', { type: 'application/ld+json' }, JSON.stringify({
181+
'@context': 'https://schema.org',
182+
'@type': 'SoftwareApplication',
183+
'name': 'CompressKit',
184+
'description': 'Production-ready compression algorithms in C++17, Go, and Rust',
185+
'url': 'https://lessup.github.io/compresskit/',
186+
'applicationCategory': 'DeveloperApplication',
187+
'operatingSystem': 'Linux, macOS, Windows',
188+
'softwareVersion': '1.0.0',
189+
'license': 'https://opensource.org/licenses/MIT',
190+
'programmingLanguage': ['C++', 'Go', 'Rust'],
191+
'author': {
192+
'@type': 'Organization',
193+
'name': 'LessUp'
194+
},
195+
'codeRepository': 'https://github.com/LessUp/compresskit',
196+
'featureList': [
197+
'Huffman Coding implementation',
198+
'Arithmetic Coding implementation',
199+
'Range Coder implementation',
200+
'Run-Length Encoding implementation',
201+
'Cross-language binary compatibility',
202+
'Comprehensive benchmark suite'
203+
]
204+
})],
107205
],
108-
206+
207+
// Markdown Configuration
109208
markdown: {
110209
lineNumbers: true,
111210
languageAlias: {
112211
cuda: 'cpp',
113212
},
213+
config: (md) => {
214+
// Custom markdown enhancements can be added here
215+
}
114216
},
115-
217+
218+
// Last Updated
116219
lastUpdated: true,
117-
118-
// Internationalization configuration
220+
221+
// Internationalization Configuration
119222
locales: {
120223
root: {
121224
label: 'English',
@@ -125,12 +228,12 @@ export default defineConfig({
125228
nav: sharedNav('en'),
126229
sidebar: sharedSidebar['/en/'],
127230
editLink: {
128-
pattern: 'https://github.com/LessUp/encoding/edit/master/docs/:path',
231+
pattern: 'https://github.com/LessUp/compresskit/edit/master/docs/:path',
129232
text: 'Edit this page on GitHub',
130233
},
131234
footer: {
132235
message: 'Released under the MIT License',
133-
copyright: 'Copyright © 2025-2026 LessUp',
236+
copyright: 'Copyright © 2025-2026 LessUp. Built with VitePress.',
134237
},
135238
outline: {
136239
level: [2, 3],
@@ -146,6 +249,26 @@ export default defineConfig({
146249
returnToTopLabel: 'Return to top',
147250
sidebarMenuLabel: 'Menu',
148251
darkModeSwitchLabel: 'Theme',
252+
search: {
253+
provider: 'local',
254+
options: {
255+
translations: {
256+
button: {
257+
buttonText: 'Search',
258+
buttonAriaLabel: 'Search documentation',
259+
},
260+
modal: {
261+
noResultsText: 'No results found',
262+
resetButtonTitle: 'Clear search',
263+
footer: {
264+
selectText: 'to select',
265+
navigateText: 'to navigate',
266+
closeText: 'to close',
267+
},
268+
},
269+
},
270+
},
271+
},
149272
},
150273
},
151274
zh: {
@@ -156,12 +279,12 @@ export default defineConfig({
156279
nav: sharedNav('zh'),
157280
sidebar: sharedSidebar['/zh/'],
158281
editLink: {
159-
pattern: 'https://github.com/LessUp/encoding/edit/master/docs/:path',
282+
pattern: 'https://github.com/LessUp/compresskit/edit/master/docs/:path',
160283
text: '在 GitHub 上编辑此页',
161284
},
162285
footer: {
163286
message: '基于 MIT 许可证发布',
164-
copyright: '版权所有 © 2025-2026 LessUp',
287+
copyright: '版权所有 © 2025-2026 LessUp. 使用 VitePress 构建。',
165288
},
166289
outline: {
167290
level: [2, 3],
@@ -177,39 +300,9 @@ export default defineConfig({
177300
returnToTopLabel: '返回顶部',
178301
sidebarMenuLabel: '菜单',
179302
darkModeSwitchLabel: '主题',
180-
},
181-
},
182-
},
183-
184-
themeConfig: {
185-
// Social links (shared)
186-
socialLinks: [
187-
{ icon: 'github', link: 'https://github.com/LessUp/encoding' },
188-
],
189-
190-
// Search (localized)
191-
search: {
192-
provider: 'local',
193-
options: {
194-
locales: {
195-
root: {
196-
translations: {
197-
button: {
198-
buttonText: 'Search',
199-
buttonAriaLabel: 'Search docs',
200-
},
201-
modal: {
202-
noResultsText: 'No results found',
203-
resetButtonTitle: 'Reset search',
204-
footer: {
205-
selectText: 'select',
206-
navigateText: 'navigate',
207-
closeText: 'close',
208-
},
209-
},
210-
},
211-
},
212-
zh: {
303+
search: {
304+
provider: 'local',
305+
options: {
213306
translations: {
214307
button: {
215308
buttonText: '搜索文档',
@@ -229,7 +322,42 @@ export default defineConfig({
229322
},
230323
},
231324
},
232-
325+
},
326+
327+
// Theme Configuration
328+
themeConfig: {
329+
// Logo
330+
logo: {
331+
light: '/logo.svg',
332+
dark: '/logo-dark.svg',
333+
alt: 'CompressKit Logo'
334+
},
335+
336+
// Site Title
337+
siteTitle: 'CompressKit',
338+
339+
// Social links
340+
socialLinks: [
341+
{ icon: 'github', link: 'https://github.com/LessUp/compresskit' },
342+
],
343+
344+
// External link indicator
233345
externalLinkIcon: true,
234346
},
347+
348+
// Vite Configuration
349+
vite: {
350+
resolve: {
351+
alias: {
352+
'@theme': '/.vitepress/theme',
353+
},
354+
},
355+
css: {
356+
preprocessorOptions: {
357+
scss: {
358+
additionalData: '',
359+
},
360+
},
361+
},
362+
},
235363
})

0 commit comments

Comments
 (0)