Skip to content

Commit 30dff64

Browse files
committed
Merge branch 'docs-whitepaper-overhaul'
# Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
2 parents 1cef7a6 + e1646c2 commit 30dff64

61 files changed

Lines changed: 4072 additions & 1032 deletions

Some content is hidden

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

.github/workflows/ci-docs.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,27 @@ on:
1717
jobs:
1818
build:
1919
runs-on: ubuntu-latest
20+
env:
21+
VITEPRESS_BASE: /cpp-high-performance-guide/
2022
steps:
2123
- name: Checkout repository
2224
uses: actions/checkout@v4
2325

2426
- name: Set up Node.js
2527
uses: actions/setup-node@v4
2628
with:
27-
node-version: "22"
29+
node-version: "20"
2830
cache: npm
2931
cache-dependency-path: docs/package-lock.json
3032

3133
- name: Install docs dependencies
3234
working-directory: docs
3335
run: npm ci
3436

37+
- name: Run docs regression tests
38+
working-directory: docs
39+
run: npm test
40+
3541
- name: Build docs
3642
working-directory: docs
37-
run: npm run build
43+
run: npm run build:pages

.github/workflows/pages.yml

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Docs
1+
name: Docs (GitHub Pages)
22

33
on:
44
push:
@@ -18,49 +18,61 @@ concurrency:
1818
cancel-in-progress: true
1919

2020
jobs:
21-
build:
21+
deploy:
22+
# Only run on the original repository, not on forks
23+
if: github.repository == 'LessUp/cpp-high-performance-guide'
2224
runs-on: ubuntu-latest
25+
environment:
26+
name: github-pages
27+
url: ${{ steps.deploy.outputs.page_url }}
2328
steps:
24-
- name: Checkout
29+
- name: Checkout repository
2530
uses: actions/checkout@v4
2631

27-
- name: Configure GitHub Pages
28-
id: pages
29-
uses: actions/configure-pages@v5
30-
31-
- name: Setup Node.js
32+
- name: Set up Node.js
3233
uses: actions/setup-node@v4
3334
with:
34-
node-version: 22
35+
node-version: '20'
3536
cache: npm
3637
cache-dependency-path: docs/package-lock.json
3738

38-
- name: Install dependencies
39+
- name: Configure GitHub Pages
40+
id: pages
41+
uses: actions/configure-pages@v5
42+
43+
- name: Set VitePress base
44+
shell: bash
45+
env:
46+
BASE_PATH: ${{ steps.pages.outputs.base_path }}
47+
run: |
48+
set -euo pipefail
49+
if [[ -z "${BASE_PATH}" ]]; then
50+
base="/"
51+
else
52+
base="${BASE_PATH%/}/"
53+
fi
54+
echo "VITEPRESS_BASE=${base}" >> "$GITHUB_ENV"
55+
56+
- name: Install docs dependencies
3957
working-directory: docs
4058
run: npm ci
4159

60+
- name: Run docs regression tests
61+
working-directory: docs
62+
run: npm test
63+
4264
- name: Build docs
4365
working-directory: docs
44-
env:
45-
VITEPRESS_BASE: ${{ steps.pages.outputs.base_path }}
46-
run: |
47-
npm run build
48-
touch .vitepress/dist/.nojekyll
66+
run: npm run build:pages
67+
68+
- name: Add .nojekyll
69+
run: touch docs/.vitepress/dist/.nojekyll
4970

5071
- name: Upload Pages artifact
5172
uses: actions/upload-pages-artifact@v3
5273
with:
5374
path: docs/.vitepress/dist
5475

55-
deploy:
56-
# Only run on the original repository, not on forks
57-
if: github.repository == 'LessUp/cpp-high-performance-guide'
58-
needs: build
59-
runs-on: ubuntu-latest
60-
environment:
61-
name: github-pages
62-
url: ${{ steps.deployment.outputs.page_url }}
63-
steps:
6476
- name: Deploy to GitHub Pages
65-
id: deployment
77+
id: deploy
6678
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ cachegrind.out.*
5555
massif.out.*
5656
*.svg
5757
flamegraph*.svg
58+
!docs/public/logo.svg
59+
!docs/public/og-card.svg
5860

5961
# Benchmark results
6062
*_bench.json

DESIGN.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Design System
2+
3+
## Overview
4+
5+
The docs site should read like a modern engineering monograph: structured, typographically confident, and visually
6+
precise. The primary scene is an expert reader reviewing architecture and implementation details on a laptop or large
7+
monitor in normal daylight, so the main experience should privilege a bright paper-like surface with a disciplined
8+
dark companion theme for late-night review.
9+
10+
## Visual Direction
11+
12+
- Whitepaper / lab notebook aesthetic, not product-marketing SaaS
13+
- Restrained color strategy with cool neutrals and one committed cobalt signal color
14+
- Strong typographic hierarchy, generous rhythm, and figure-like diagram framing
15+
- Minimal motion, mostly opacity and transform, never decorative layout animation
16+
17+
## Color
18+
19+
- Primary accent: deep cobalt in OKLCH, used for links, active states, figures, and emphasis
20+
- Neutrals: slightly blue-tinted paper, ink, and steel tones, never pure black or white
21+
- States: success, warning, and danger should stay muted and publication-like rather than dashboard-bright
22+
- Dark theme should invert contrast without turning diagrams into neon-on-black
23+
24+
## Typography
25+
26+
- Use the system sans stack for maintainability
27+
- Let hierarchy come from scale, weight, and spacing rather than decorative font mixing
28+
- Keep body measure around 70ch
29+
- Headings should feel compressed and authoritative, body copy should feel calm and readable
30+
31+
## Layout
32+
33+
- Prefer sectional composition and editorial rhythm over repeated equal cards
34+
- Use panels, callout rows, figure frames, and structured index blocks as reusable primitives
35+
- Keep the docs landing page asymmetric where it helps emphasis, but preserve clarity over spectacle
36+
- Treat sidebars and top navigation as orientation tools, not decorative chrome
37+
38+
## Components
39+
40+
- Bilingual language switcher integrated into the nav
41+
- Section index blocks for academy / architecture / research navigation
42+
- Figure shell for Mermaid and SVG diagrams with caption and note support
43+
- Reference list and comparison table styles for citations and related-work sections
44+
- Hero rail with thesis, validation signals, and route entry points
45+
46+
## Motion
47+
48+
- Very light fades and lifts for interactive affordances
49+
- No animated gradients
50+
- No motion that blocks reading or competes with code and diagrams

PRODUCT.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Product
2+
3+
## Register
4+
5+
brand
6+
7+
## Users
8+
9+
The primary readers are strict interviewers, advanced GitHub developers, and future maintainers evaluating the
10+
repository as a serious engineering artifact. They arrive in a browser, often from GitHub, and want fast evidence of
11+
architectural depth, technical rigor, validation discipline, and documentation quality.
12+
13+
## Product Purpose
14+
15+
This project teaches high-performance C++ through runnable examples, but the docs site must do more than teach. It
16+
must frame the repository as an archive-ready technical whitepaper, academy, and architecture guide that explains why
17+
the code exists, how the modules connect, how claims are validated, and where the project fits in the broader systems
18+
ecosystem.
19+
20+
## Brand Personality
21+
22+
Rigorous, scholarly, exacting. The tone should feel calm, credible, and opinionated, with enough visual character to
23+
avoid looking like a generic docs template.
24+
25+
## Anti-references
26+
27+
Do not look like a default GitBook clone, a card-farm SaaS landing page, a glassy AI-generated template, or a
28+
cyberpunk dashboard. Avoid ornamental gradients, gimmicky hero metrics, and any layout that signals "marketing site"
29+
before "engineering publication".
30+
31+
## Design Principles
32+
33+
1. Show evidence, not slogans.
34+
2. Make reading flow as strong as visual style.
35+
3. Treat diagrams as arguments, not decoration.
36+
4. Keep bilingual entry surfaces structurally equivalent.
37+
5. Favor durable, low-maintenance design primitives over one-off flair.
38+
39+
## Accessibility & Inclusion
40+
41+
Target WCAG AA contrast on both themes. Support reduced-motion users by keeping motion subtle and non-essential.
42+
Maintain strong readability for long-form technical content, including diagram captions, code-adjacent reference
43+
surfaces, and bilingual navigation.

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Every major topic is meant to be **readable, buildable, and measurable**.
4242
| `examples/03-modern-cpp/` | constexpr, move semantics, reserve, ranges |
4343
| `examples/04-simd-vectorization/` | auto-vectorization, intrinsics, SIMD wrappers |
4444
| `examples/05-concurrency/` | atomics, lock-free queue, OpenMP |
45-
| `docs/` | bilingual learning path, profiling guide, troubleshooting, reference |
45+
| `docs/` | bilingual Pages whitepaper covering academy, architecture, playbook, reference, research |
4646
| `openspec/` | spec-driven development workflow and change history |
4747

4848
## Quick start
@@ -61,8 +61,9 @@ Run one benchmark:
6161
./build/release/examples/02-memory-cache/aos_soa_bench
6262
```
6363

64-
Need sanitizer-specific guidance after the quick start? See
65-
[`docs/en/guides/validation.md`](docs/en/guides/validation.md).
64+
Need the redesigned docs route after the quick start? Start with
65+
[`docs/en/playbook/index.md`](docs/en/playbook/index.md), then continue to
66+
[`docs/en/guides/validation.md`](docs/en/guides/validation.md) for sanitizer-specific guidance.
6667

6768
## Validation commands
6869

@@ -75,13 +76,17 @@ cmake --preset=tsan && cmake --build build/tsan && ctest --preset=tsan
7576
cmake --preset=ubsan && cmake --build build/ubsan && ctest --preset=ubsan
7677
```
7778

78-
## Documentation and learning path
79+
## Documentation entry points
7980

8081
- **Docs site:** <https://lessup.github.io/cpp-high-performance-guide/>
81-
- **Quick start:** `docs/en/getting-started/quickstart.md`
82-
- **Learning path:** `docs/en/guides/learning-path.md`
83-
- **Profiling guide:** `docs/en/guides/profiling-guide.md`
84-
- **Validation & sanitizers:** `docs/en/guides/validation.md`
82+
- **Academy:** [`docs/en/academy/index.md`](docs/en/academy/index.md)
83+
- **Architecture:** [`docs/en/architecture/index.md`](docs/en/architecture/index.md)
84+
- **Playbook:** [`docs/en/playbook/index.md`](docs/en/playbook/index.md)
85+
- **Reference:** [`docs/en/reference/index.md`](docs/en/reference/index.md)
86+
- **Research:** [`docs/en/research/index.md`](docs/en/research/index.md)
87+
- **Quick start inside the playbook:** [`docs/en/getting-started/quickstart.md`](docs/en/getting-started/quickstart.md)
88+
- **Profiling guide:** [`docs/en/guides/profiling-guide.md`](docs/en/guides/profiling-guide.md)
89+
- **Validation & sanitizers:** [`docs/en/guides/validation.md`](docs/en/guides/validation.md)
8590
- **Chinese entry:** `README.zh-CN.md` and `docs/zh/`
8691

8792
## Development workflow

README.zh-CN.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
| `examples/03-modern-cpp/` | constexpr、移动语义、reserve、ranges |
4343
| `examples/04-simd-vectorization/` | 自动向量化、intrinsics、SIMD 封装 |
4444
| `examples/05-concurrency/` | 原子操作、无锁队列、OpenMP |
45-
| `docs/` | 双语学习路径、profiling、排障、参考文档 |
45+
| `docs/` | 双语 Pages 白皮书,覆盖学院 / 架构 / 实践手册 / 参考 / 研究 |
4646
| `openspec/` | 规格驱动开发流程与 change 历史 |
4747

4848
## 快速开始
@@ -61,8 +61,9 @@ cmake --build build/release
6161
./build/release/examples/02-memory-cache/aos_soa_bench
6262
```
6363

64-
如果你想在快速开始之后直接使用 sanitizer,请查看
65-
[`docs/zh/guides/validation.md`](docs/zh/guides/validation.md)
64+
如果你想在快速开始之后进入新的文档主路径,请先查看
65+
[`docs/zh/playbook/index.md`](docs/zh/playbook/index.md),再进入
66+
[`docs/zh/guides/validation.md`](docs/zh/guides/validation.md) 了解 sanitizer 相关说明。
6667

6768
## 常用验证命令
6869

@@ -75,13 +76,18 @@ cmake --preset=tsan && cmake --build build/tsan && ctest --preset=tsan
7576
cmake --preset=ubsan && cmake --build build/ubsan && ctest --preset=ubsan
7677
```
7778

78-
## 文档与学习路径
79+
## 文档入口
7980

8081
- **文档站:** <https://lessup.github.io/cpp-high-performance-guide/>
81-
- **快速开始:** `docs/zh/getting-started/quickstart.md`
82-
- **学习路径:** `docs/zh/guides/learning-path.md`
83-
- **性能分析指南:** `docs/zh/guides/profiling-guide.md`
84-
- **验证与 Sanitizer:** `docs/zh/guides/validation.md`
82+
- **学院:** [`docs/zh/academy/index.md`](docs/zh/academy/index.md)
83+
- **架构:** [`docs/zh/architecture/index.md`](docs/zh/architecture/index.md)
84+
- **实践手册:** [`docs/zh/playbook/index.md`](docs/zh/playbook/index.md)
85+
- **参考:** [`docs/zh/reference/index.md`](docs/zh/reference/index.md)
86+
- **研究:** [`docs/zh/research/index.md`](docs/zh/research/index.md)
87+
- **实践手册内的快速开始:** [`docs/zh/getting-started/quickstart.md`](docs/zh/getting-started/quickstart.md)
88+
- **学习路径:** [`docs/zh/guides/learning-path.md`](docs/zh/guides/learning-path.md)
89+
- **性能分析指南:** [`docs/zh/guides/profiling-guide.md`](docs/zh/guides/profiling-guide.md)
90+
- **验证与 Sanitizer:** [`docs/zh/guides/validation.md`](docs/zh/guides/validation.md)
8591
- **英文入口:** `README.md``docs/en/`
8692

8793
## 开发流程

docs/.vitepress/config-helpers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const englishReferenceHub = '/en/reference/'

0 commit comments

Comments
 (0)