Skip to content

Commit 2bf38c7

Browse files
committed
docs: 重构 Git Pages 为技术白皮书风格
## 主要变更 ### 架构重构 - 简化主题入口,移除不必要的 Vue 组件 - 合并 CSS 文件为单一 vars.css - 添加 markdown-it-footnote 学术引用支持 - 添加 Mermaid 深色主题动态切换 ### 新增内容模块 - 算法学院 (Academy): 深度算法解析 - Huffman 编码深度解析(含数学证明) - 状态机设计哲学(5状态 FSM) - 架构设计: 系统分层架构文档 - 参考文献: 学术引用机制 ### 工程化改进 - 新增 ci-docs.yml PR 验证工作流 - 更新导航和侧边栏配置 - 添加 footnote CSS 样式 ### 移除组件 - CustomFooter.vue (使用默认 footer) - StatsBar.vue (改为纯 CSS) - BackToTop.vue, ReadingProgress.vue 参考标杆: kimi-cli 极简工程化方案
1 parent 6817f66 commit 2bf38c7

24 files changed

Lines changed: 7000 additions & 1482 deletions

.github/workflows/ci-docs.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CI Docs
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
paths:
7+
- 'docs/**'
8+
- '.github/workflows/ci-docs.yml'
9+
pull_request:
10+
branches: [main, master]
11+
paths:
12+
- 'docs/**'
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: '20'
25+
26+
- name: Cache docs node_modules
27+
uses: actions/cache@v4
28+
with:
29+
path: docs/node_modules
30+
key: ${{ runner.os }}-docs-node-modules-${{ hashFiles('docs/package.json') }}
31+
restore-keys: |
32+
${{ runner.os }}-docs-node-modules-
33+
34+
- name: Install docs dependencies
35+
working-directory: docs
36+
run: npm install --no-package-lock
37+
38+
- name: Build docs
39+
working-directory: docs
40+
run: npm run build
41+
42+
- name: Upload artifact
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: docs-dist
46+
path: docs/.vitepress/dist
47+
retention-days: 7

docs/.vitepress/config.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { defineConfig } from 'vitepress'
22
import { withMermaid } from 'vitepress-plugin-mermaid'
33
import llmstxt from 'vitepress-plugin-llms'
4+
import footnote from 'markdown-it-footnote'
5+
import mark from 'markdown-it-mark'
46

57
const rawBase = process.env.VITEPRESS_BASE
68
const base = rawBase
@@ -21,6 +23,13 @@ const sharedSidebar = {
2123
{ text: 'Project Structure', link: '/en/guide/project-structure' },
2224
],
2325
},
26+
{
27+
text: 'Academy',
28+
items: [
29+
{ text: 'Algorithm Academy', link: '/en/academy/' },
30+
{ text: 'Huffman Coding', link: '/en/academy/huffman' },
31+
],
32+
},
2433
{
2534
text: 'Algorithms',
2635
items: [
@@ -51,6 +60,8 @@ const sharedSidebar = {
5160
{
5261
text: 'Reference',
5362
items: [
63+
{ text: 'Architecture Design', link: '/en/architecture/' },
64+
{ text: 'Bibliography', link: '/en/reference/bibliography' },
5465
{ text: 'OpenSpec Specs', link: 'https://github.com/LessUp/compress-kit/tree/master/openspec/specs' },
5566
{ text: 'Contributing', link: '/en/guide/contributing' },
5667
{ text: 'Changelog', link: '/en/release-notes/changelog' },
@@ -67,6 +78,14 @@ const sharedSidebar = {
6778
{ text: '项目结构', link: '/zh/guide/project-structure' },
6879
],
6980
},
81+
{
82+
text: '学院',
83+
items: [
84+
{ text: '算法学院', link: '/zh/academy/' },
85+
{ text: '霍夫曼编码深度解析', link: '/zh/academy/huffman' },
86+
{ text: '状态机设计哲学', link: '/zh/academy/state-machine' },
87+
],
88+
},
7089
{
7190
text: '算法详解',
7291
items: [
@@ -97,6 +116,8 @@ const sharedSidebar = {
97116
{
98117
text: '参考',
99118
items: [
119+
{ text: '系统架构设计', link: '/zh/architecture/' },
120+
{ text: '参考文献', link: '/zh/reference/bibliography' },
100121
{ text: 'OpenSpec 规范', link: 'https://github.com/LessUp/compress-kit/tree/master/openspec/specs' },
101122
{ text: '参与贡献', link: '/zh/guide/contributing' },
102123
{ text: '更新日志', link: '/zh/release-notes/changelog' },
@@ -266,6 +287,10 @@ export default withMermaid(defineConfig({
266287
languageAlias: {
267288
cuda: 'cpp',
268289
},
290+
config: (md) => {
291+
md.use(footnote)
292+
md.use(mark)
293+
}
269294
},
270295

271296
head: [

docs/.vitepress/theme/components/BackToTop.vue

Lines changed: 0 additions & 46 deletions
This file was deleted.

docs/.vitepress/theme/components/CustomFooter.vue

Lines changed: 0 additions & 220 deletions
This file was deleted.

0 commit comments

Comments
 (0)