# vonng/ddia architecture

> Architecture diagram of the GitHub repository vonng/ddia, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vonng/ddia
- Repository: https://github.com/vonng/ddia

## Overview

DDIA 中文版是以 Hugo 发布的多语言技术书籍，核心用户流程是读者浏览在线章节、目录及相关阅读输出。内容包含第二版简体中文与英文、繁体中文，以及第一版存档；README 还列出整书打印、Markdown/llms.txt、EPUB、稳定图表编号与交叉引用等能力。图中另列繁体转换和贡献者卡片生成。部分模板和未采样子系统仅按目录或 README 概括；未展示的运行时连线不作推断。

Main entry points: [`layouts`](https://github.com/vonng/ddia/tree/main/layouts) (在线书站), [`bin/zh-tw.py`](https://github.com/vonng/ddia/blob/main/bin/zh-tw.py) (繁体转换), [`bin/repository-cards/update.py`](https://github.com/vonng/ddia/blob/main/bin/repository-cards/update.py) (贡献者数据更新), [`content/zh`](https://github.com/vonng/ddia/tree/main/content/zh) (简体中文第二版)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_publishing["网站发布"]
  node_web["在线书站"]
  node_sitecfg["站点配置<br/>[hugo.yaml]"]
  node_booklayouts["书籍页面模板"]
  node_landing["首页组件"]
end

subgraph group_book["书籍内容"]
  node_zhbook["简体中文第二版"]
  node_enbook["英文内容"]
  node_twbook["繁体中文第二版"]
  node_v1book["第一版存档"]
  node_v1twbook["第一版繁体存档"]
  node_assets["图表与静态资源"]
end

subgraph group_outputs["阅读输出"]
  node_print["整书打印<br/>[landing.print.html]"]
  node_llms["LLM 阅读输出<br/>[index.llms.txt]"]
  node_epub["EPUB 预处理<br/>[preprocess-epub.py]"]
end

subgraph group_community["社区与翻译"]
  node_twconvert["繁体转换<br/>[zh-tw.py]"]
  node_twconfig["繁体覆盖规则"]
  node_contributors["贡献者数据<br/>[contributors.yaml]"]
  node_cardsupdate["贡献者数据更新<br/>[update.py]"]
  node_cardsrender["贡献者卡片渲染<br/>[render.py]"]
end

node_reader(("读者"))
node_hugo{{"Hugo 构建"}}
node_github{{"GitHub"}}

node_reader -->|"浏览"| node_web
node_hugo -->|"构建发布"| node_web
node_sitecfg -.->|"配置站点"| node_web
node_booklayouts -.->|"提供页面模板"| node_web
node_landing -.->|"提供首页组件"| node_web
node_zhbook -.->|"发布内容"| node_web
node_enbook -.->|"发布内容"| node_web
node_twbook -.->|"发布内容"| node_web
node_v1book -.->|"发布内容"| node_web
node_v1twbook -.->|"发布内容"| node_web
node_assets -.->|"提供图表资源"| node_web
node_reader -->|"打印阅读"| node_print
node_reader -->|"获取文本"| node_llms
node_reader -->|"导出 EPUB"| node_epub
node_zhbook -->|"转换输入"| node_twconvert
node_twconfig -->|"应用覆盖规则"| node_twconvert
node_twconvert -->|"写入译文"| node_twbook
node_github -->|"获取贡献信息"| node_cardsupdate
node_cardsupdate -->|"调用渲染"| node_cardsrender
node_contributors -.->|"读取名单"| node_cardsupdate

click node_web "https://github.com/vonng/ddia/tree/main/layouts"
click node_sitecfg "https://github.com/vonng/ddia/blob/main/hugo.yaml"
click node_booklayouts "https://github.com/vonng/ddia/tree/main/layouts/book"
click node_landing "https://github.com/vonng/ddia/tree/main/layouts/_partials/landing"
click node_zhbook "https://github.com/vonng/ddia/tree/main/content/zh"
click node_enbook "https://github.com/vonng/ddia/tree/main/content/en"
click node_twbook "https://github.com/vonng/ddia/tree/main/content/tw"
click node_v1book "https://github.com/vonng/ddia/tree/main/content/v1"
click node_v1twbook "https://github.com/vonng/ddia/tree/main/content/v1_tw"
click node_assets "https://github.com/vonng/ddia/tree/main/static"
click node_print "https://github.com/vonng/ddia/blob/main/layouts/book/landing.print.html"
click node_llms "https://github.com/vonng/ddia/blob/main/layouts/index.llms.txt"
click node_epub "https://github.com/vonng/ddia/blob/main/bin/preprocess-epub.py"
click node_twconvert "https://github.com/vonng/ddia/blob/main/bin/zh-tw.py"
click node_twconfig "https://github.com/vonng/ddia/blob/main/bin/translation-tw-overrides.json"
click node_contributors "https://github.com/vonng/ddia/blob/main/data/contributors.yaml"
click node_cardsupdate "https://github.com/vonng/ddia/blob/main/bin/repository-cards/update.py"
click node_cardsrender "https://github.com/vonng/ddia/blob/main/bin/repository-cards/render.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web,node_sitecfg,node_booklayouts,node_landing toneBlue
class node_zhbook,node_enbook,node_twbook,node_v1book,node_v1twbook,node_assets toneAmber
class node_print,node_llms,node_epub toneMint
class node_twconvert,node_twconfig,node_contributors,node_cardsupdate,node_cardsrender toneRose
class node_reader,node_hugo,node_github toneIndigo
```

## Components

### 网站发布

- [在线书站](https://github.com/vonng/ddia/tree/main/layouts): `layouts`
- [站点配置](https://github.com/vonng/ddia/blob/main/hugo.yaml): `hugo.yaml`
- [书籍页面模板](https://github.com/vonng/ddia/tree/main/layouts/book): `layouts/book`
- [首页组件](https://github.com/vonng/ddia/tree/main/layouts/_partials/landing): `layouts/_partials/landing`

### 书籍内容

- [简体中文第二版](https://github.com/vonng/ddia/tree/main/content/zh): `content/zh`
- [英文内容](https://github.com/vonng/ddia/tree/main/content/en): `content/en`
- [繁体中文第二版](https://github.com/vonng/ddia/tree/main/content/tw): `content/tw`
- [第一版存档](https://github.com/vonng/ddia/tree/main/content/v1): `content/v1`
- [第一版繁体存档](https://github.com/vonng/ddia/tree/main/content/v1_tw): `content/v1_tw`
- [图表与静态资源](https://github.com/vonng/ddia/tree/main/static): `static`

### 阅读输出

- [整书打印](https://github.com/vonng/ddia/blob/main/layouts/book/landing.print.html): `layouts/book/landing.print.html`
- [LLM 阅读输出](https://github.com/vonng/ddia/blob/main/layouts/index.llms.txt): `layouts/index.llms.txt`
- [EPUB 预处理](https://github.com/vonng/ddia/blob/main/bin/preprocess-epub.py): `bin/preprocess-epub.py`

### 社区与翻译

- [繁体转换](https://github.com/vonng/ddia/blob/main/bin/zh-tw.py): `bin/zh-tw.py`
- [繁体覆盖规则](https://github.com/vonng/ddia/blob/main/bin/translation-tw-overrides.json): `bin/translation-tw-overrides.json`
- [贡献者数据](https://github.com/vonng/ddia/blob/main/data/contributors.yaml): `data/contributors.yaml`
- [贡献者数据更新](https://github.com/vonng/ddia/blob/main/bin/repository-cards/update.py): `bin/repository-cards/update.py`
- [贡献者卡片渲染](https://github.com/vonng/ddia/blob/main/bin/repository-cards/render.py): `bin/repository-cards/render.py`

### Other components

- **读者**
- **Hugo 构建**
- **GitHub**

## Connections

- 读者 → 在线书站: 浏览 (evidence: `README.md`)
- Hugo 构建 → 在线书站: 构建发布 (evidence: `README.md`)
- 站点配置 → 在线书站: 配置站点
- 书籍页面模板 → 在线书站: 提供页面模板
- 首页组件 → 在线书站: 提供首页组件
- 简体中文第二版 → 在线书站: 发布内容
- 英文内容 → 在线书站: 发布内容
- 繁体中文第二版 → 在线书站: 发布内容
- 第一版存档 → 在线书站: 发布内容
- 第一版繁体存档 → 在线书站: 发布内容
- 图表与静态资源 → 在线书站: 提供图表资源
- 读者 → 整书打印: 打印阅读 (evidence: `README.md`)
- 读者 → LLM 阅读输出: 获取文本 (evidence: `README.md`)
- 读者 → EPUB 预处理: 导出 EPUB (evidence: `README.md`)
- 简体中文第二版 → 繁体转换: 转换输入 (evidence: `bin/zh-tw.py`)
- 繁体覆盖规则 → 繁体转换: 应用覆盖规则 (evidence: `bin/zh-tw.py`)
- 繁体转换 → 繁体中文第二版: 写入译文 (evidence: `bin/zh-tw.py`)
- GitHub → 贡献者数据更新: 获取贡献信息 (evidence: `bin/repository-cards/update.py`)
- 贡献者数据更新 → 贡献者卡片渲染: 调用渲染 (evidence: `bin/repository-cards/update.py`)
- 贡献者数据 → 贡献者数据更新: 读取名单
