Skip to content

Commit be4a6e2

Browse files
docs: restore slimmed VitePress site aligned with lean C++17 tree
The live GitHub Pages site was a stale snapshot from before the slim refactor: it documented the deleted streaming layer, 5-state FSM, encoder.hpp, make_huffman_encoder(), 8-value StatusCode enum, ADRs, and broken base-path links (/en/api/streaming -> 404). Restore docs/ and docs-pages.yml from 6c1ffa9^, then prune to the algorithms/architecture/benchmarks scope the project keeps: - Delete api/streaming, academy/state-machine, adr/, guide/contributing, guide/project-structure, reference/bibliography (en + zh). - Rewrite api/cpp.md: drop streaming facade, encoder.hpp, factory; document BufferTransform + 3-value StatusCode (OK/ERR_CORRUPT/ ERR_SIZE_LIMIT). - Rewrite guide/architecture.md and architecture/index.md: single buffer(BufferTransform) -> core model; update mermaid and shared utility table to current headers. - Fix broken base-path links in academy/huffman, academy/index, guide/algorithms, guide/getting-started (en + zh). - Update site-content.mjs nav/sidebar to drop removed pages. Verified: docs build (30 md files), docs tests (15/15), make test (36 CLI smoke), make lint. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 6c1ffa9 commit be4a6e2

55 files changed

Lines changed: 11442 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docs-pages.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Docs (GitHub Pages)
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
paths:
9+
- "docs/**"
10+
- ".github/workflows/docs-pages.yml"
11+
12+
workflow_dispatch:
13+
14+
permissions:
15+
contents: read
16+
pages: write
17+
id-token: write
18+
19+
jobs:
20+
deploy:
21+
if: github.repository == 'LessUp/compress-kit'
22+
runs-on: ubuntu-latest
23+
environment:
24+
name: github-pages
25+
url: ${{ steps.deploy.outputs.page_url }}
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
30+
- name: Set up Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: "20"
34+
cache: "npm"
35+
cache-dependency-path: docs/package-lock.json
36+
37+
- name: Configure GitHub Pages
38+
id: pages
39+
uses: actions/configure-pages@v5
40+
41+
- name: Set VitePress base
42+
shell: bash
43+
env:
44+
BASE_PATH: ${{ steps.pages.outputs.base_path }}
45+
run: |
46+
set -euo pipefail
47+
if [[ -z "${BASE_PATH}" ]]; then
48+
base="/"
49+
else
50+
base="${BASE_PATH%/}/"
51+
fi
52+
echo "VITEPRESS_BASE=${base}" >> "$GITHUB_ENV"
53+
54+
- name: Install docs dependencies
55+
working-directory: docs
56+
run: npm ci
57+
58+
- name: Build docs
59+
working-directory: docs
60+
env:
61+
VITEPRESS_BASE: ${{ env.VITEPRESS_BASE }}
62+
run: npm run build
63+
64+
- name: Add .nojekyll
65+
run: touch docs/.vitepress/dist/.nojekyll
66+
67+
- name: Upload Pages artifact
68+
uses: actions/upload-pages-artifact@v3
69+
with:
70+
path: docs/.vitepress/dist
71+
72+
- name: Deploy to GitHub Pages
73+
id: deploy
74+
uses: actions/deploy-pages@v4

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ style categories and uses semantic versioning for releases.
1414
- Removed OpenSpec, Cursor, and Claude skill meta-tooling directories.
1515
- Removed cross-language conformance matrix and streaming API contract tests.
1616
- **Simplification (Occam's razor)**: Removed VitePress documentation site, bilingual docs (en/zh), and root `package.json`/`docs/` tree. README is now single-language (Chinese).
17+
- **Docs restoration**: Restored a slimmed VitePress docs site (`docs/` + `docs-pages.yml` workflow) keeping only algorithms, architecture, and benchmarks content. Removed stale streaming API, state-machine academy, ADRs, contributing, project-structure, and bibliography pages. Updated API/architecture pages to reflect the `BufferTransform`-based buffer layer and 3-value `StatusCode` enum; fixed broken base-path links.
1718
- **Simplification**: Removed governance docs (`CODE_OF_CONDUCT.md`, `SECURITY.md`, `CONTEXT.md`, `CONTRIBUTING.md`) and `.devcontainer/` — unnecessary for a hobby/learning project.
1819
- **Simplification**: Removed Streaming state-machine layer (`encoder.hpp` with `State`/`Encoder`/`Decoder` abstract classes, `BufferEncoder`/`BufferDecoder` wrappers). `encode_buffer`/`decode_buffer` now take a `BufferTransform` function pointer directly. Algorithms never used the streaming interface — the state machine was dead abstraction.
19-
- **Simplification**: Merged CI workflows into a single `ci.yml` (removed `ci-docs.yml`, `codeql.yml`, `docs-pages.yml`).
20+
- **Simplification**: Merged CI workflows into a single `ci.yml` (removed `ci-docs.yml`, `codeql.yml`; `docs-pages.yml` later restored with the slimmed docs site).
2021
- **Simplification**: Pruned `StatusCode` enum to only used values (`OK`/`ERR_CORRUPT`/`ERR_SIZE_LIMIT`); removed `INITIAL_DECODE_OVERHEAD` constant.
2122
- Buffer layer rewritten to use in-memory transforms instead of temporary files.
2223
- Huffman encoding now uses `uint64_t` code words instead of `std::string` for 8x density.

docs/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
.vitepress/dist
3+
.vitepress/cache

docs/.vitepress/config.ts

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
import { defineConfig } from 'vitepress'
2+
import { withMermaid } from 'vitepress-plugin-mermaid'
3+
import llmstxt from 'vitepress-plugin-llms'
4+
import footnote from 'markdown-it-footnote'
5+
import mark from 'markdown-it-mark'
6+
import { buildNav, buildSidebar } from './data/site-content.mjs'
7+
8+
const rawBase = process.env.VITEPRESS_BASE
9+
const base = rawBase
10+
? rawBase.startsWith('/')
11+
? rawBase.endsWith('/') ? rawBase : `${rawBase}/`
12+
: `/${rawBase}/`
13+
: '/'
14+
15+
export default withMermaid(defineConfig({
16+
base,
17+
title: 'CompressKit',
18+
titleTemplate: ':title | CompressKit',
19+
description: 'Classic lossless compression algorithms in C++17.',
20+
cleanUrls: true,
21+
lastUpdated: true,
22+
appearance: true,
23+
24+
sitemap: {
25+
hostname: 'https://lessup.github.io/compress-kit/',
26+
},
27+
28+
locales: {
29+
root: {
30+
label: 'English',
31+
lang: 'en-US',
32+
link: '/en/',
33+
themeConfig: {
34+
nav: buildNav('en'),
35+
sidebar: buildSidebar('en'),
36+
editLink: {
37+
pattern: 'https://github.com/LessUp/compress-kit/edit/master/docs/:path',
38+
text: 'Edit this page on GitHub',
39+
},
40+
footer: false,
41+
outline: {
42+
level: [2, 3],
43+
label: 'On this page',
44+
},
45+
lastUpdated: {
46+
text: 'Last updated',
47+
},
48+
docFooter: {
49+
prev: 'Previous page',
50+
next: 'Next page',
51+
},
52+
returnToTopLabel: 'Return to top',
53+
sidebarMenuLabel: 'Menu',
54+
darkModeSwitchLabel: 'Theme',
55+
search: {
56+
provider: 'local',
57+
options: {
58+
translations: {
59+
button: {
60+
buttonText: 'Search',
61+
buttonAriaLabel: 'Search documentation',
62+
},
63+
modal: {
64+
noResultsText: 'No results found',
65+
resetButtonTitle: 'Clear search',
66+
footer: {
67+
selectText: 'to select',
68+
navigateText: 'to navigate',
69+
closeText: 'to close',
70+
},
71+
},
72+
},
73+
},
74+
},
75+
},
76+
},
77+
zh: {
78+
label: '简体中文',
79+
lang: 'zh-CN',
80+
link: '/zh/',
81+
themeConfig: {
82+
nav: buildNav('zh'),
83+
sidebar: buildSidebar('zh'),
84+
editLink: {
85+
pattern: 'https://github.com/LessUp/compress-kit/edit/master/docs/:path',
86+
text: '在 GitHub 上编辑此页',
87+
},
88+
footer: false,
89+
outline: {
90+
level: [2, 3],
91+
label: '本页内容',
92+
},
93+
lastUpdated: {
94+
text: '最后更新',
95+
},
96+
docFooter: {
97+
prev: '上一页',
98+
next: '下一页',
99+
},
100+
returnToTopLabel: '返回顶部',
101+
sidebarMenuLabel: '菜单',
102+
darkModeSwitchLabel: '主题',
103+
search: {
104+
provider: 'local',
105+
options: {
106+
translations: {
107+
button: {
108+
buttonText: '搜索文档',
109+
buttonAriaLabel: '搜索文档',
110+
},
111+
modal: {
112+
noResultsText: '无法找到相关结果',
113+
resetButtonTitle: '清除查询条件',
114+
footer: {
115+
selectText: '选择',
116+
navigateText: '切换',
117+
closeText: '关闭',
118+
},
119+
},
120+
},
121+
},
122+
},
123+
},
124+
},
125+
},
126+
127+
themeConfig: {
128+
outline: [2, 3],
129+
search: { provider: 'local' },
130+
socialLinks: [
131+
{ icon: 'github', link: 'https://github.com/LessUp/compress-kit' },
132+
],
133+
logo: {
134+
light: '/logo.svg',
135+
dark: '/logo-dark.svg',
136+
alt: 'CompressKit Logo'
137+
},
138+
siteTitle: 'CompressKit',
139+
externalLinkIcon: true,
140+
},
141+
142+
markdown: {
143+
lineNumbers: true,
144+
languageAlias: {
145+
cuda: 'cpp',
146+
},
147+
config: (md) => {
148+
md.use(footnote)
149+
md.use(mark)
150+
}
151+
},
152+
153+
head: [
154+
['link', { rel: 'canonical', href: 'https://lessup.github.io/compress-kit/' }],
155+
['meta', { charset: 'UTF-8' }],
156+
['meta', { name: 'viewport', content: 'width=device-width, initial-scale=1.0' }],
157+
['meta', { name: 'theme-color', content: '#2563eb', media: '(prefers-color-scheme: light)' }],
158+
['meta', { name: 'theme-color', content: '#0f172a', media: '(prefers-color-scheme: dark)' }],
159+
['meta', { name: 'keywords', content: 'compression algorithms, huffman coding, arithmetic coding, range coder, run-length encoding, C++17, lossless compression' }],
160+
['meta', { name: 'author', content: 'CompressKit Team' }],
161+
['meta', { name: 'robots', content: 'index, follow' }],
162+
['meta', { property: 'og:type', content: 'website' }],
163+
['meta', { property: 'og:locale', content: 'en_US' }],
164+
['meta', { property: 'og:title', content: 'CompressKit | Compression Algorithms Collection' }],
165+
['meta', { property: 'og:description', content: 'Classic lossless compression algorithms in C++17.' }],
166+
['meta', { property: 'og:url', content: 'https://lessup.github.io/compress-kit/' }],
167+
['meta', { property: 'og:site_name', content: 'CompressKit' }],
168+
['meta', { property: 'og:image', content: '/compress-kit/og-image.svg' }],
169+
['link', { rel: 'icon', type: 'image/svg+xml', href: '/compress-kit/logo.svg' }],
170+
],
171+
172+
vite: {
173+
plugins: [llmstxt()],
174+
resolve: {
175+
alias: {
176+
'@theme': '/.vitepress/theme',
177+
},
178+
},
179+
},
180+
}))
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"generated": "2026-05-16",
3+
"version": "1.0.0",
4+
"results": [
5+
{
6+
"algorithm": "huffman",
7+
"language": "cpp",
8+
"dataset": "textlike_10MiB",
9+
"encodeTime": 644.3,
10+
"decodeTime": 2231.2,
11+
"encodeSpeed": 15.5,
12+
"decodeSpeed": 4.5,
13+
"compressionRatio": 0.746,
14+
"throughput": "low"
15+
},
16+
{
17+
"algorithm": "arithmetic",
18+
"language": "cpp",
19+
"dataset": "textlike_10MiB",
20+
"encodeTime": 1502.2,
21+
"decodeTime": 3785.4,
22+
"encodeSpeed": 6.7,
23+
"decodeSpeed": 2.6,
24+
"compressionRatio": 0.743,
25+
"throughput": "low"
26+
},
27+
{
28+
"algorithm": "range",
29+
"language": "cpp",
30+
"dataset": "small_dictionary_like",
31+
"encodeTime": 7.3,
32+
"decodeTime": 9.0,
33+
"encodeSpeed": 1.1,
34+
"decodeSpeed": 0.9,
35+
"compressionRatio": 0.615,
36+
"throughput": "low"
37+
},
38+
{
39+
"algorithm": "rle",
40+
"language": "cpp",
41+
"dataset": "repetitive_10MiB",
42+
"encodeTime": 207.6,
43+
"decodeTime": 578.0,
44+
"encodeSpeed": 48.2,
45+
"decodeSpeed": 17.3,
46+
"compressionRatio": 0.002,
47+
"throughput": "medium"
48+
}
49+
]
50+
}

0 commit comments

Comments
 (0)