Skip to content

Repository files navigation

codegraph-zh-tw · codegraph 繁體中文教學站

codegraph非官方繁體中文教學站。把整個 repo(程式碼、文件、MCP 工具、測試、實作案例)做成中英對照的解說內容,並收錄兩條「meta」示範:用 graphify 掃描 codegraph 自己做出的可操作互動知識圖譜,以及實際安裝 codegraph、在它自己源碼上跑的 dogfooding 真實輸出

免責聲明:本站為第三方社群教學站,與 Colby Mchenry 無關,不代表 codegraph 官方立場。codegraph 與 Colby Mchenry 為其各自權利人所有,本站僅在描述性/教學語境下使用該名稱。

上線網站:https://shumingyang-opencode.github.io/codegraph-zh-tw/

目錄


網站亮點

  1. 中英對照 — 中文口語解說為主文,英文原文與程式碼保留上游原貌。文件頁用「可展開的英文原文」,程式碼頁用「附中文註解的原始碼」。
  2. TypeScript 逐函數講解 — src/ 的 9 大模組逐函數 <details> 收縮塊(signature + 中文用途 + 關鍵邏輯),含 Rust kernel 對照。
  3. 策展式教學而非鏡像 — 809 檔的 repo 不逐檔翻譯,聚焦運作原理、架構、MCP 工具、CLI、自動同步、框架路由、效能基準、設定。
  4. 雙 meta 案例 — 用 graphify 掃描 codegraph 源碼的互動知識圖譜(EN/ZH 雙版本)+ 實際安裝 codegraph v1.5.0 在它自己源碼上的自跑輸出。
  5. 版本釘選 — 上游對齊 main @ c6aaa20(發行版 v1.5.0);所有實測數字(570 檔 → 12,733 節點 / 44,903 邊 in 1.7s 等)為本站實際運行取得,可追溯。

網站地圖

純靜態站(HTML + CSS + JS),GitHub Pages 部署於 main 根目錄。

codegraph-zh-tw/
├── index.html            首頁:CodeGraph 是什麼、三大亮點、benchmark 統計、入口卡
├── map.html              概念地圖:知識圖譜/node-edge/SQLite/MCP/explore/impact/Rust kernel/watcher
├── learning-path.html    學習路線 L0→L4:可點卡片
├── install.html          安裝指南:install.sh/ps1/npm、9 agent 平台、init、uninstall、疑難排解
├── about.html            授權、方法、免責聲明
├── docs/
│   ├── index.html        文件教學入口(hub)
│   ├── how-it-works.html 運作原理(抽取→儲存→解析→自動同步四階段)
│   ├── architecture.html 架構總覽(模組職責表)
│   ├── mcp-tools.html    codegraph_explore 單一工具 + 7 個隱藏工具 + CODEGRAPH_MCP_TOOLS
│   ├── cli.html          CLI 指令參考(含 dogfooding 真實輸出)
│   ├── auto-sync.html    三層新鮮機制(watcher/staleness banner/catch-up)
│   ├── framework-routes.html  17 框架路由
│   ├── ios-rn-bridging.html   iOS/RN/Expo 跨語言橋接
│   ├── benchmarks.html   7 repo WITH/WITHOUT + 殘留上下文取捨
│   ├── config.html       codegraph.json(exclude/include/extensions)
│   ├── library.html      Library 用法(CodeGraph class API)
│   ├── languages.html    30+ 語言支援 + cross-file coverage
│   ├── security.html     100% 本機 / telemetry / verified releases / 疑難排解
│   ├── worked.html       實作案例入口
│   ├── case/codegraph-source.html  案例:graphify 掃描 codegraph 自己 + codegraph 自跑
│   └── code/             程式碼對照(10 頁,逐函數 <details>)
│       ├── index.html    入口
│       ├── main.html     src/index.ts(CodeGraph class)
│       ├── db.html       node:sqlite / WAL / FTS5 / schema.sql
│       ├── extraction.html  ExtractionOrchestrator + languages/ + Rust kernel
│       ├── resolution.html  ReferenceResolver + frameworks/ + rebind
│       ├── graph.html    GraphTraverser / GraphQueryManager
│       ├── context.html  ContextBuilder(verbatim 原始碼 + ranking)
│       ├── mcp.html      MCPServer / tools / server-instructions
│       ├── installer.html  9-agent multi-target installer
│       └── cli.html      src/bin/codegraph.ts(commander)
├── worked/codegraph-source/  案例資產:graph.html + graph-zh.html + GRAPH_REPORT.md + dogfood.md
└── assets/               site.css / favicon.svg

實作案例總覽

每個案例都是「中文解說 + 互動圖(EN/ZH 界面)+ 本站跑的數字 + 重現步驟」。

案例 語料 來源方式 本站數字 互動圖
codegraph 自己 src/ + codegraph-kernel/src/ + __tests__/(501 個程式檔) graphify 本站實跑--code-only,零 LLM)+ codegraph 自跑@colbymchenry/codegraph@1.5.0 graphify:7,987 節點 / 18,148 邊 / 683 社群;codegraph init:570 檔 → 12,733 節點 / 44,903 邊(1.7s) ✅ 雙版本

所有案例的圖與數字都是真實工具產出,不是示意圖。這是「用知識圖譜工具分析知識圖譜工具」的 meta 示範。

我們怎麼跑的

graphify 掃描(互動圖)

# 0. 安裝(PyPI 套件名是 graphifyy,雙 y)
uv tool install graphifyy

# 1. 準備語料(codegraph 源碼,對齊 c6aaa20)
git clone https://github.com/colbymchenry/codegraph.git
git -C codegraph checkout c6aaa20
mkdir corpus && cp -R codegraph/src corpus/ && cp -R codegraph/codegraph-kernel/src corpus/kernel-src/
cp -R codegraph/__tests__ corpus/tests/

# 2. 跑 pipeline(code-only,純本機 AST、零 API key)
graphify extract ./corpus --code-only
GRAPHIFY_VIZ_NODE_LIMIT=20000 graphify cluster-only ./corpus

# 3. 產出 corpus/graphify-out/:graph.html(互動)、graph.json、GRAPH_REPORT.md
# 4. 中文化互動圖:複製 graph.html → 替換 UI 字串 → graph-zh.html

codegraph dogfooding(真實輸出)

npm i -g @colbymchenry/codegraph@1.5.0
cd codegraph
codegraph init        # 570 檔 → 12,733 節點 / 44,903 邊 in 1.7s
codegraph status      # 索引統計(Backend: node:sqlite,WAL)
codegraph explore "..."  # 結構性問題一次回答
  • 所有 dogfooding 輸出收錄在 worked/codegraph-source/dogfood.md,並散落各教學頁(docs/cli.htmldocs/mcp-tools.htmldocs/how-it-works.html 等)。

授權

  • 本站內容以 MIT License 釋出(與上游相同),並照抄上游的授權檔:
    • LICENSE — MIT 全文(Copyright (c) 2026 Colby Mchenry
    • NOTICE — 本站為上游非官方教學站的聲明、引用範圍、原創內容授權
  • 商標:codegraph 與 Colby Mchenry 為其各自權利人所有。MIT 授權不含商標授權;本站僅在「描述性/教學」語境使用該名稱,並於全站 footer 標示「與 Colby Mchenry 無關」。
  • graphify 產出worked/codegraph-source/ 的互動圖與報告由 graphify(Apache-2.0)產生,案例頁已標註出處。
  • 不做二進位散布:本站不含官方二進位,僅引述實際運行輸出。

上游同步

  • 本站對齊上游分支 main,釘選 commit c6aaa20(發行版 v1.5.0)。
  • .github/workflows/check-upstream.yml 每月自動(每月 1 日 00:00 UTC + 手動觸發)檢查上游最新 SHA,並更新首頁的版本徽章。

開發

靜態站,純 HTML + CSS + JS,無框架、無建置步驟。

python3 -m http.server 8000   # 本機預覽

目錄結構速查

  • assets/site.css — 全站樣式(深色 × 霓虹設計語言,承襲 graphify-zh-tw / codebase-memory-mcp-zh-tw)
  • 每個 HTML 頁都是自含檔案(head 引入 site.css + Google Fonts)
  • worked/codegraph-source/ — 案例的 graph.html(英文)、graph-zh.html(中文界面)、GRAPH_REPORT.mddogfood.md

如何新增一個案例

  1. 準備語料mkdir corpus && git clone <repo> corpus/<name>(或直接指一個資料夾)。
  2. graphify 抽取graphify extract ./corpus --code-only(純程式碼零 key);有 LLM key 則可跑完整版。
  3. 分群 + 產出GRAPHIFY_VIZ_NODE_LIMIT=20000 graphify cluster-only ./corpus → 得到 graph.htmlGRAPH_REPORT.mdgraph.json
  4. 中文化:複製 graph.html → 替換 UI 字串 → graph-zh.html(見 我們怎麼跑的)。
  5. 收錄:把三樣東西放進 worked/<slug>/
  6. 建案例頁:依 docs/case/<slug>.html 的模板(中文解說 + iframe 嵌入互動圖 + 本站數字表 + 重現步驟)。
  7. 更新 docs/worked.html 的案例卡。

已知限制

  • graphify 節點數:7,987 超過 5,000 視覺化上限,介面為社群聚合檢視(683 社群);完整圖資料在 graph.json
  • 社群命名:本機無 LLM key,社群名稱保留程式識別符;節點 label 保留英文(與互動圖中文化原則一致)。
  • 語料差異:graphify 掃的是 501 個程式檔(src + kernel + tests),codegraph init 是全 repo 570 檔——兩者數字不可直接比。
  • codegraph 活躍開發中:上游 changelog 有大量 Unreleased 項目,本站內容以釘選 commit 為準,逐月更新徽章。

回饋與貢獻

  • 本站是教學站,不是官方文件。發現翻譯錯誤或想補充主題,歡迎開 issue
  • 想貢獻案例:跑一個真實 repo 的 graphify 產出或 codegraph 自跑輸出,依新增案例流程發 PR。

相關連結

About

codegraph(MIT)的非官方繁體中文教學站——把整個 repo(程式碼/文件/MCP 工具/測試/案例)做成中英對照講解:概念地圖、學習路線、安裝指南、12 個文件教學頁、9 個程式碼對照頁,並收錄 graphify 互動知識圖譜與 codegraph 自跑(dogfooding)的真實輸出。

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages