Skip to content

Commit 23615a0

Browse files
committed
docs: refine build guides, contracts, mkdocs content, and ai-markmap documentation
1 parent de00830 commit 23615a0

File tree

9 files changed

+353
-355
lines changed

9 files changed

+353
-355
lines changed

.dev/VIRTUAL_ENV_SETUP.md

Lines changed: 69 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
# 虛擬環境設定指南
1+
# Virtual Environment Setup Guide
22

3-
## 📋 概述
3+
## 📋 Overview
44

5-
本專案使用 `leetcode` Python 虛擬環境來隔離依賴。單元測試腳本會自動使用此虛擬環境。
5+
This project uses a `leetcode` Python virtual environment to isolate dependencies. Unit test scripts automatically use this virtual environment.
66

77
---
88

9-
## 🔧 虛擬環境設定
9+
## 🔧 Virtual Environment Setup
1010

1111
### Windows
1212

13-
#### 1. 建立虛擬環境
13+
#### 1. Create Virtual Environment
1414
```powershell
15-
# 從專案根目錄
15+
# From project root directory
1616
python -m venv leetcode
1717
```
1818

19-
#### 2. 啟動虛擬環境
19+
#### 2. Activate Virtual Environment
2020
```powershell
2121
# PowerShell
2222
leetcode\Scripts\Activate.ps1
@@ -25,44 +25,44 @@ leetcode\Scripts\Activate.ps1
2525
leetcode\Scripts\activate.bat
2626
```
2727

28-
#### 3. 安裝依賴
28+
#### 3. Install Dependencies
2929
```powershell
30-
# 安裝基本依賴
30+
# Install basic dependencies
3131
pip install -r requirements.txt
3232
33-
# 安裝測試依賴
33+
# Install test dependencies
3434
pip install pytest pytest-cov
3535
```
3636

3737
### Linux / macOS
3838

39-
#### 1. 建立虛擬環境
39+
#### 1. Create Virtual Environment
4040
```bash
41-
# 從專案根目錄
41+
# From project root directory
4242
python3 -m venv leetcode
4343
```
4444

45-
#### 2. 啟動虛擬環境
45+
#### 2. Activate Virtual Environment
4646
```bash
4747
source leetcode/bin/activate
4848
```
4949

50-
#### 3. 安裝依賴
50+
#### 3. Install Dependencies
5151
```bash
52-
# 安裝基本依賴
52+
# Install basic dependencies
5353
pip install -r requirements.txt
5454

55-
# 安裝測試依賴
55+
# Install test dependencies
5656
pip install pytest pytest-cov
5757
```
5858

5959
---
6060

61-
## 🧪 運行測試
61+
## 🧪 Running Tests
6262

63-
### 方法 1: 使用測試腳本(推薦)
63+
### Method 1: Using Test Scripts (Recommended)
6464

65-
測試腳本會自動使用虛擬環境:
65+
Test scripts automatically use the virtual environment:
6666

6767
```bash
6868
# Windows
@@ -74,7 +74,7 @@ cd .dev
7474
./run_tests.sh
7575
```
7676

77-
### 方法 2: 手動使用虛擬環境
77+
### Method 2: Manual Virtual Environment Usage
7878

7979
```bash
8080
# Windows
@@ -88,23 +88,23 @@ cd .dev
8888
python -m pytest tests -v
8989
```
9090

91-
### 方法 3: 直接使用虛擬環境 Python
91+
### Method 3: Direct Virtual Environment Python Usage
9292

93-
不需要啟動虛擬環境:
93+
No need to activate the virtual environment:
9494

9595
```bash
96-
# Windows(從專案根目錄)
96+
# Windows (from project root)
9797
leetcode\Scripts\python.exe -m pytest .dev/tests -v
9898

99-
# Linux/Mac(從專案根目錄)
99+
# Linux/Mac (from project root)
100100
leetcode/bin/python -m pytest .dev/tests -v
101101
```
102102

103103
---
104104

105-
## 🔍 驗證設定
105+
## 🔍 Verify Setup
106106

107-
### 檢查虛擬環境是否存在
107+
### Check if Virtual Environment Exists
108108

109109
```bash
110110
# Windows
@@ -114,7 +114,7 @@ dir leetcode\Scripts\python.exe
114114
ls -la leetcode/bin/python
115115
```
116116

117-
### 檢查 pytest 是否安裝
117+
### Check if pytest is Installed
118118

119119
```bash
120120
# Windows
@@ -124,7 +124,7 @@ leetcode\Scripts\python.exe -m pytest --version
124124
leetcode/bin/python -m pytest --version
125125
```
126126

127-
### 檢查安裝的套件
127+
### Check Installed Packages
128128

129129
```bash
130130
# Windows
@@ -138,98 +138,98 @@ pip list
138138

139139
---
140140

141-
## 📦 虛擬環境路徑
141+
## 📦 Virtual Environment Paths
142142

143-
測試腳本使用以下路徑:
143+
Test scripts use the following paths:
144144

145145
### Windows
146-
- Python 執行檔: `leetcode\Scripts\python.exe`
147-
- 啟動腳本: `leetcode\Scripts\activate.bat` (CMD) `leetcode\Scripts\Activate.ps1` (PowerShell)
146+
- Python executable: `leetcode\Scripts\python.exe`
147+
- Activation script: `leetcode\Scripts\activate.bat` (CMD) or `leetcode\Scripts\Activate.ps1` (PowerShell)
148148

149149
### Linux/Mac
150-
- Python 執行檔: `leetcode/bin/python`
151-
- 啟動腳本: `leetcode/bin/activate`
150+
- Python executable: `leetcode/bin/python`
151+
- Activation script: `leetcode/bin/activate`
152152

153153
---
154154

155-
## ⚠️ 常見問題
155+
## ⚠️ Common Issues
156156

157-
### Q1: 虛擬環境不存在
157+
### Q1: Virtual Environment Not Found
158158

159-
**錯誤訊息**:
159+
**Error Message**:
160160
```
161161
[ERROR] Virtual environment not found: leetcode\Scripts\python.exe
162162
```
163163

164-
**解決方法**:
164+
**Solution**:
165165
```bash
166-
# 建立虛擬環境
166+
# Create virtual environment
167167
python -m venv leetcode
168168

169-
# 啟動並安裝依賴
169+
# Activate and install dependencies
170170
leetcode\Scripts\activate
171171
pip install -r requirements.txt
172172
pip install pytest pytest-cov
173173
```
174174

175-
### Q2: pytest 未安裝
175+
### Q2: pytest Not Installed
176176

177-
**錯誤訊息**:
177+
**Error Message**:
178178
```
179179
[ERROR] pytest is not installed in virtual environment
180180
```
181181

182-
**解決方法**:
182+
**Solution**:
183183
```bash
184-
# 啟動虛擬環境
184+
# Activate virtual environment
185185
leetcode\Scripts\activate # Windows
186186
source leetcode/bin/activate # Linux/Mac
187187

188-
# 安裝 pytest
188+
# Install pytest
189189
pip install pytest pytest-cov
190190
```
191191

192-
### Q3: 找不到 runner 模組
192+
### Q3: Module 'runner' Not Found
193193

194-
**錯誤訊息**:
194+
**Error Message**:
195195
```
196196
ModuleNotFoundError: No module named 'runner'
197197
```
198198

199-
**解決方法**:
200-
確保從專案根目錄運行測試,或使用測試腳本。
199+
**Solution**:
200+
Ensure you run tests from the project root directory, or use the test scripts.
201201

202202
---
203203

204-
## 🔄 更新依賴
204+
## 🔄 Updating Dependencies
205205

206-
### 更新測試依賴
206+
### Update Test Dependencies
207207

208208
```bash
209-
# 啟動虛擬環境
209+
# Activate virtual environment
210210
leetcode\Scripts\activate # Windows
211211
source leetcode/bin/activate # Linux/Mac
212212

213-
# 更新套件
213+
# Update packages
214214
pip install --upgrade pytest pytest-cov
215215
```
216216

217-
### 更新所有依賴
217+
### Update All Dependencies
218218

219219
```bash
220-
# 啟動虛擬環境
220+
# Activate virtual environment
221221
leetcode\Scripts\activate # Windows
222222
source leetcode/bin/activate # Linux/Mac
223223

224-
# 更新所有套件
224+
# Update all packages
225225
pip install --upgrade -r requirements.txt
226226
```
227227

228228
---
229229

230230
## 📝 requirements.txt
231231

232-
確保 `requirements.txt` 包含測試依賴:
232+
Ensure `requirements.txt` includes test dependencies:
233233

234234
```txt
235235
# LeetCode Practice Framework - Dependencies
@@ -253,24 +253,23 @@ mkdocs-include-markdown-plugin>=7.0.0 # Include markdown files
253253

254254
---
255255

256-
## 🎯 最佳實踐
256+
## 🎯 Best Practices
257257

258-
1. **使用虛擬環境**: 始終在虛擬環境中安裝依賴
259-
2. **使用測試腳本**: 測試腳本會自動處理虛擬環境
260-
3. **定期更新**: 定期更新依賴以獲得最新功能和修復
261-
4. **版本控制**: 不要將 `leetcode/` 資料夾加入 Git
258+
1. **Use Virtual Environment**: Always install dependencies in the virtual environment
259+
2. **Use Test Scripts**: Test scripts automatically handle the virtual environment
260+
3. **Regular Updates**: Regularly update dependencies to get the latest features and fixes
261+
4. **Version Control**: Do not add the `leetcode/` folder to Git
262262

263263
---
264264

265-
## 📞 需要幫助?
265+
## 📞 Need Help?
266266

267-
如有問題,請參考:
268-
- [.dev/README.md](.dev/README.md) - 維護者指南
269-
- [.dev/TESTING.md](.dev/TESTING.md) - 完整測試文檔
270-
- 專案主 README.md - Python 環境章節
267+
If you have questions, please refer to:
268+
- [.dev/README.md](.dev/README.md) - Maintainer Guide
269+
- [.dev/TESTING.md](.dev/TESTING.md) - Complete Testing Documentation
270+
- Project main README.md - Python Environment section
271271

272272
---
273273

274-
**測試負責人**: luffdev
275-
**建立日期**: 2025-12-08
276-
274+
**Test Maintainer**: luffdev
275+
**Created Date**: 2025-12-08

docs/BUILD_DOCS_MANUAL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ python -m mkdocs serve -a 127.0.0.1:8001
290290

291291
## Changelog
292292

293-
- **2025-01-XX**: Initial version
293+
- **2025-12-17**: Initial version
294294
- ✅ Added `build_docs.bat` and `build_docs.sh` scripts
295295
- ✅ Created comprehensive manual build guide
296296
- ✅ Cross-platform support (Windows, Linux, macOS)

docs/GENERATOR_CONTRACT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> **Status**: Canonical Reference
44
> **Scope**: All generator files in `generators/`
5-
> **Last Updated**: 2025/12/12
5+
> **Last Updated**: 2025-12-12
66
77
This document defines the **contract** for test case generator files. Generators enable stress testing, edge case discovery, and reproducible test generation.
88

docs/LOCAL_DOCS_BUILD.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ Act provides **exact CI/CD simulation**, which is useful when:
191191

192192
## Changelog
193193

194-
- **2025-01-XX**: Initial version
194+
- **2025-12-17**: Initial version
195195
- ✅ Added comparison of local build methods
196196
- ✅ Created overview guide
197197
- ✅ Linked to detailed guides for each method

docs/MKDOCS_CONTENT_GUIDE.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,14 +243,14 @@ If you need to access these documents, use the GitHub absolute URLs provided in
243243

244244
## 📝 Update Log
245245

246-
- **2025-01-XX**: Initial version
247-
- **2025-01-XX**: Updated - Added `docs/patterns/` and `docs/GITHUB_PAGES_SETUP.md` to website navigation
246+
- **2025-12-12**: Initial version
247+
- **2025-12-12**: Updated - Added `docs/patterns/` and `docs/GITHUB_PAGES_SETUP.md` to website navigation
248248
- **2025-12-12**: Added "📚 Reference" section to nav with Solution Contract, Generator Contract, Architecture Migration
249249
- **2025-12-12**: Moved Tools documentation from `docs/TOOLS.md` to `tools/README.md` (developer docs belong with code)
250-
- **2025-01-XX**: Added local documentation build guides - `BUILD_DOCS_MANUAL.md` (recommended) and `ACT_LOCAL_GITHUB_ACTIONS.md` (optional) to Guides section
251-
- **2025-12-XX**: Added `ONTOLOGY_DESIGN.md` to Reference section
252-
- **2025-12-XX**: Added `MKDOCS_CONTENT_GUIDE.md` and `LOCAL_DOCS_BUILD.md` to Guides section
253-
- **2025-12-XX**: Added `backtracking_exploration` pattern to Patterns section
250+
- **2025-12-13**: Added local documentation build guides - `BUILD_DOCS_MANUAL.md` (recommended) and `ACT_LOCAL_GITHUB_ACTIONS.md` (optional) to Guides section
251+
- **2025-12-14**: Added `ONTOLOGY_DESIGN.md` to Reference section
252+
- **2025-12-15**: Added `MKDOCS_CONTENT_GUIDE.md` and `LOCAL_DOCS_BUILD.md` to Guides section
253+
- **2025-12-17**: Added `backtracking_exploration` pattern to Patterns section
254254
- Check `mkdocs.yml` `nav` configuration for the latest list
255255

256256
---

docs/SOLUTION_CONTRACT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> **Status**: Canonical Reference
44
> **Scope**: All solution files in `solutions/`
5-
> **Last Updated**: 2024
5+
> **Last Updated**: 2025-12-17
66
77
This document defines the **contract** for solution files in this repository. All solution files MUST conform to this specification. The test runner, generators, and tooling depend on this contract.
88

0 commit comments

Comments
 (0)