Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
a9592ba
adjust v2 links
Vonng Jul 31, 2025
63f0340
update online version links
Vonng Jul 31, 2025
1d039fa
add beian number
Vonng Jul 31, 2025
c9e8296
chore: clean up docsify resources
Vonng Jul 31, 2025
af13d29
add google analytics
Vonng Aug 3, 2025
65c0866
add o'reilly 1st/2nd book links
Vonng Aug 3, 2025
bc87dde
adjust beian number
Vonng Aug 5, 2025
54bbbfc
hide footer from hugo pages
Vonng Aug 6, 2025
0c9db16
en stub
Vonng Aug 9, 2025
d216e35
fix reference link
Vonng Aug 9, 2025
752c2f5
fix note format
Vonng Aug 9, 2025
4ec385f
fix reference summary
Vonng Aug 9, 2025
515bb3a
fix ref links
Vonng Aug 9, 2025
5c1bef6
update v2 missing warning
Vonng Aug 9, 2025
aa06c85
fix caution
Vonng Aug 9, 2025
cdd205f
convert figure to shortcode
Vonng Aug 9, 2025
860cc17
fix ch1-ch5 hierarchy
Vonng Aug 9, 2025
99b4b00
adjust anchor for ch5 - ch10
Vonng Aug 9, 2025
bb300d5
fix tips format caption
Vonng Aug 9, 2025
8acb45f
adjust toc style
Vonng Aug 9, 2025
4f025dd
add anchor name to en docs
Vonng Aug 9, 2025
95781d9
change en docs anchor
Vonng Aug 10, 2025
a31bfaf
translate zh-cn toc
Vonng Aug 10, 2025
ee24fa2
add images to en v2
Vonng Aug 10, 2025
003fb7a
add init translation
Vonng Aug 10, 2025
7c17fcf
add tw translation
Vonng Aug 10, 2025
a51fd07
update part index
Vonng Aug 10, 2025
e391301
add toc generate script
Vonng Aug 10, 2025
07da940
update tw part doc
Vonng Aug 10, 2025
eacc60e
replace with the new images
Vonng Aug 10, 2025
a89c4c8
udpate branch info
Vonng Aug 10, 2025
ea527cd
add v1 images
Vonng Aug 10, 2025
95a72df
add v1 to the v2 repo
Vonng Aug 10, 2025
d6eb35b
update v2 toc
Vonng Aug 10, 2025
59cab31
polish ch1 - ch4
Vonng Aug 10, 2025
18fcb5c
fix broken format
Vonng Aug 11, 2025
8efd0b7
fix broken links
Vonng Aug 11, 2025
8099734
fix cross links in v1 content
yingang Aug 12, 2025
710b719
optimize translation
xyohn Aug 12, 2025
59fc391
Merge pull request #363 from xyohn/main
yingang Aug 12, 2025
85d29d2
ch1 - optimize translation
xyohn Aug 13, 2025
c651dab
Merge branch 'Vonng:main' into main
xyohn Aug 13, 2025
cc24078
Merge pull request #365 from xyohn/main
Vonng Aug 13, 2025
4f6969d
add back zh-tw version of v1
yingang Aug 14, 2025
443f23e
rename the figure file referenced in part ii
yingang Aug 14, 2025
b155559
update translations of ch1
yingang Aug 15, 2025
1ce76e6
update translations of ch1
yingang Aug 16, 2025
31d1378
Update ch8.md,电源失败改为电源失效
yangshangde Aug 22, 2025
685825b
Merge pull request #366 from yangshangde/main
yingang Aug 22, 2025
1c17625
fix typo
yhao3 Aug 24, 2025
809dc2c
fix formatting and punctuation
yhao3 Aug 24, 2025
e8cfb77
Merge pull request #367 from yhao3/main
yingang Aug 25, 2025
29cd64c
update zh-tw.py and zh-tw content
yingang Aug 25, 2025
04d89c7
update zh-tw.py and zh-tw content
yhao3 Aug 26, 2025
3a6df27
Merge pull request #368 from yhao3/update-zh-tw
yingang Aug 26, 2025
b86d772
bump hextra to the latest version
Vonng Aug 31, 2025
014cfbe
update translations in ch1
yingang Sep 1, 2025
faf9441
update translations in ch1
yingang Sep 4, 2025
964f9c9
update tranlsations in ch1
yingang Sep 17, 2025
1b1ace3
Update ch7.md 可串行化快照隔离检测一个事务何时修改另一个事务的读取
bbwang-gl Sep 17, 2025
f570557
Merge pull request #369 from wbbwbbw/wbb-patch-1
yingang Sep 18, 2025
3a54466
Improve translation
lewiszlw Sep 23, 2025
f27a987
Improve translation
lewiszlw Sep 23, 2025
f972004
Merge pull request #371 from lewiszlw/patch-3
yingang Sep 23, 2025
4458823
minor translation updates
yingang Sep 24, 2025
6b5ac3c
docs(tw): Correct normalization/denormalization terminology
huang06 Nov 15, 2025
7780c74
docs(tw): Standardize 'denormalization' term to '反正規化'
huang06 Nov 15, 2025
4bcb233
Merge pull request #377 from huang06/docs/normalization
yingang Nov 17, 2025
fa8f1a1
update zh-tw.py for the translations of Normalization and Denormaliza…
yingang Nov 17, 2025
387f39a
update translation for metastable failure
yingang Nov 17, 2025
cc730cd
minor translation updates suggested by copilot
yingang Nov 18, 2025
d77e413
update a translation according to #378
yingang Nov 18, 2025
ef49638
fix incomplete term in chapter 4
Max-Tortoise Nov 23, 2025
9dc6c10
Merge pull request #381 from Max-Tortoise/fix/chapter4
yingang Nov 24, 2025
0c6dd2a
improve ch1 translation
uncle-lv Dec 27, 2025
9913919
Merge pull request #382 from uncle-lv/improve-ch1-translation
yingang Dec 30, 2025
1a6ad5c
update zh-tw content
yingang Dec 30, 2025
c43ffe1
docs: 修正ch4中的术语和表达错误
PanggNOTlovebean Dec 30, 2025
ea61259
Merge pull request #383 from PanggNOTlovebean/main
yingang Dec 31, 2025
f5ec1bd
update zh-tw content
yingang Dec 31, 2025
a71ace2
docs: 优化中文文档的措辞和表达
PanggNOTlovebean Jan 7, 2026
a7d19c7
Merge pull request #384 from PanggNOTlovebean/main
yingang Jan 7, 2026
a719db4
improve ch2 translation
uncle-lv Jan 25, 2026
330f3f3
Merge pull request #386 from uncle-lv/improve-ch2-translation
yingang Jan 26, 2026
181eb79
improve ch3 translation, update zh-tw content
yingang Feb 11, 2026
a320e1b
add ddia 11-14
Vonng Feb 15, 2026
a9157a6
修正 ch10 参考文献格式
Vonng Feb 15, 2026
2fa6ddc
更新 ch11 批处理章节翻译(第二版)
Vonng Feb 15, 2026
9ed880b
更新 ch12 流处理章节翻译(第二版)
Vonng Feb 15, 2026
bf9cb48
更新 ch13 流式系统的哲学(第二版)
Vonng Feb 15, 2026
957fdf1
添加 ch14 将事情做正确
Vonng Feb 15, 2026
1e3b1f6
更新第三部分概述与章节索引
Vonng Feb 15, 2026
7e8c100
更新目录,添加 ch11-14 章节索引
Vonng Feb 15, 2026
7d5ead8
更新首页目录与贡献者列表
Vonng Feb 15, 2026
9ff1c76
更新 v1 首页贡献者列表
Vonng Feb 15, 2026
da5e7c3
更新贡献者列表
Vonng Feb 15, 2026
b1e36fa
polish ch1-ch10
Vonng Feb 15, 2026
52f5581
add zh-tw update
Vonng Feb 15, 2026
d11a293
align zh translation format
Vonng Feb 15, 2026
661692f
fix missing img and anchor
Vonng Feb 15, 2026
a65f0d4
Update part-i.md
ButcherV Feb 15, 2026
3e12648
Merge pull request #387 from ButcherV/patch-1
Vonng Feb 15, 2026
909e56f
🐛 fix(epub): 恢复 EPUB 导出功能,修复图片显示问题 (Fixes #388)
demo-zexuan Feb 23, 2026
63bf9f5
feat(epub): 添加封面图片到 EPUB 元数据
demo-zexuan Feb 23, 2026
b9f59a6
Update metadata.yaml
demo-zexuan Feb 23, 2026
26878ff
Merge pull request #389 from demo-zexuan/main
Vonng Feb 24, 2026
573bb53
fix(epub): handle figure attribute variants and absolute image paths
Vonng Feb 24, 2026
61743d2
Fix typographical errors in chapter 1
bearomorphism Feb 24, 2026
de23967
fix(ch2): 修正文案中的“观察记录果”笔误
daihaowxg Mar 27, 2026
71ea02b
Merge pull request #397 from daihaowxg/main
yingang Apr 9, 2026
5be8bf7
Merge pull request #390 from bearomorphism/patch-1
yingang Apr 9, 2026
0a34b4c
update zh-tw script and content
yingang Apr 9, 2026
900a255
更新贡献者 GitHub 链接:按 PR 作者映射修复失效链接,并同步 README/_index/contrib (#393)
cg-zhou Apr 9, 2026
a12dc6e
fix(ch8): 删除多余空行,修复有序列表显示问题 (#408)
hezhengdong Jun 25, 2026
de16eee
fix(readme): 修复翻译进度描述中的重复字
Klu5ure Jul 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Deploy Hugo site to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["hugo"]
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -31,7 +31,7 @@ jobs:
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.147.7
HUGO_VERSION: 0.155.3
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -41,7 +41,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
go-version: '1.26'
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
Expand Down
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@ __pycache__/
tmp/
output/
public/
.hugo_build.lock
.hugo_build.lock
.claude
CLAUDE.md
content/cn/
zh.md
en.md
172 changes: 71 additions & 101 deletions README.md

Large diffs are not rendered by default.

49 changes: 49 additions & 0 deletions assets/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/* 调整左侧导航栏的宽度 */
/* 增加宽度以确保文本不换行 */

/* 左侧导航栏宽度调整 - 增加到 28rem 以避免换行 */
.hextra-sidebar {
width: 28rem !important;
min-width: 28rem !important;
}

/* 确保导航内容正确显示 */
.hextra-sidebar nav {
width: 100%;
}

/* 防止导航项文字换行 */
.hextra-sidebar li {
white-space: nowrap;
}

.sidebar-container {
width: 20rem !important;
white-space: nowrap;
}

/* 确保导航链接不换行 */
.hextra-sidebar a {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: block;
}

/* 调整右侧页内目录(On This Page)的宽度 */
/* Hextra 默认宽度约为 16rem (256px),增加 1.5 倍变为 24rem (384px) */

/* 右侧目录的宽度 */
.hextra-toc {
width: 24rem !important;
}

/* 确保目录内容正确显示 */
.hextra-toc nav {
width: 100%;
}

/* 调整目录项的文字换行以适应更宽的空间 */
.hextra-toc li {
word-wrap: break-word;
}
7 changes: 7 additions & 0 deletions assets/css/example.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.md-example { margin: 1.25rem 0; padding: 1rem; border: 1px solid var(--border); border-radius: .75rem; }
.md-example__caption { display: flex; gap: .5rem; align-items: baseline; margin-bottom: .5rem; }
.md-example__label { font-weight: 600; opacity: .85; }
.md-example__title { font-weight: 600; }
.md-example__anchor { margin-left: auto; text-decoration: none; opacity: .6; }
.md-example__anchor:hover { opacity: 1; }
.md-example__note { margin-top: .5rem; font-size: .95em; opacity: .85; }
52 changes: 32 additions & 20 deletions bin/epub
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
#!/usr/bin/env bash

set -e

# Set the directory containing Markdown files
SCRIPT_DIR=$(dirname "$0")
INPUT_DIR=$(cd "$(dirname "$SCRIPT_DIR")" && pwd)
OUTPUT_DIR="$INPUT_DIR/output"
TEMP_DIR="$OUTPUT_DIR/temp"

# Create output directory if it doesn't exist
mkdir -p "$OUTPUT_DIR"
mkdir -p "$TEMP_DIR"

# Preprocess Markdown files to convert Hugo shortcodes
echo "Preprocessing Markdown files..."
python3 "${SCRIPT_DIR}/preprocess-epub.py" "${INPUT_DIR}/content/zh" "$TEMP_DIR"

convert_to_epub() {
# convert all EPUB files into a single EPUB book
Expand All @@ -24,28 +32,32 @@ convert_to_epub() {
--css="$css_file" \
--webtex \
--wrap=preserve \
"${INPUT_DIR}"/SUMMARY.md \
"${INPUT_DIR}"/README.md \
"${INPUT_DIR}"/preface.md \
"${INPUT_DIR}"/part-i.md \
"${INPUT_DIR}"/ch1.md \
"${INPUT_DIR}"/ch2.md \
"${INPUT_DIR}"/ch3.md \
"${INPUT_DIR}"/ch4.md \
"${INPUT_DIR}"/part-ii.md \
"${INPUT_DIR}"/ch5.md \
"${INPUT_DIR}"/ch6.md \
"${INPUT_DIR}"/ch7.md \
"${INPUT_DIR}"/ch8.md \
"${INPUT_DIR}"/ch9.md \
"${INPUT_DIR}"/part-iii.md \
"${INPUT_DIR}"/ch10.md \
"${INPUT_DIR}"/ch11.md \
"${INPUT_DIR}"/ch12.md \
"${INPUT_DIR}"/colophon.md \
"${INPUT_DIR}"/glossary.md
"${TEMP_DIR}"/_index.md \
"${TEMP_DIR}"/preface.md \
"${TEMP_DIR}"/part-i.md \
"${TEMP_DIR}"/ch1.md \
"${TEMP_DIR}"/ch2.md \
"${TEMP_DIR}"/ch3.md \
"${TEMP_DIR}"/ch4.md \
"${TEMP_DIR}"/part-ii.md \
"${TEMP_DIR}"/ch5.md \
"${TEMP_DIR}"/ch6.md \
"${TEMP_DIR}"/ch7.md \
"${TEMP_DIR}"/ch8.md \
"${TEMP_DIR}"/ch9.md \
"${TEMP_DIR}"/part-iii.md \
"${TEMP_DIR}"/ch10.md \
"${TEMP_DIR}"/ch11.md \
"${TEMP_DIR}"/ch12.md \
"${TEMP_DIR}"/ch13.md \
"${TEMP_DIR}"/ch14.md \
"${TEMP_DIR}"/colophon.md \
"${TEMP_DIR}"/glossary.md

echo "Converted EPUB book created at $OUTPUT_BOOK."
}

convert_to_epub

# Clean up temporary files
rm -rf "$TEMP_DIR"
111 changes: 111 additions & 0 deletions bin/preprocess-epub.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
#!/usr/bin/env python3
"""
预处理 Markdown 文件,将 Hugo shortcode 转换为 Pandoc 可识别的格式

处理两种 shortcode:
1. {{< figure src="/fig/xxx.png" caption="xxx" >}} → ![xxx](static/fig/xxx.png)
2. {{< figure ... >}} (无 src) → 移除(通常用于代码示例)
"""

import os
import re
import sys
from pathlib import Path

FIGURE_SHORTCODE_RE = re.compile(r"\{\{<\s*figure\b(.*?)>\}\}", re.DOTALL)
ATTR_RE = re.compile(r'([\w-]+)="([^"]*)"')
ABS_IMAGE_RE = re.compile(r'!\[([^\]]*)\]\(/(?!static/)([^)]+)\)')


def _escape_alt_text(text):
"""Escape `]` in alt text to avoid breaking Markdown image syntax."""
return text.replace("]", r"\]")


def convert_markdown(text):
"""
转换 Hugo figure shortcode 和绝对路径图片引用。

Args:
text: Markdown 文本内容

Returns:
转换后的文本
"""
def replace_figure_shortcode(match):
attrs_text = match.group(1)
attrs = dict(ATTR_RE.findall(attrs_text))
src = attrs.get("src")

# 没有 src 的 figure 一般是代码示例占位,直接移除
if not src:
return ""

# 绝对路径资源转为相对 static 路径,便于 Pandoc 打包
if src.startswith('/'):
src = 'static' + src

# 优先 caption,fallback 到 title,至少保证图片可渲染
alt = _escape_alt_text(attrs.get("caption") or attrs.get("title") or "")
return f'![{alt}]({src})'

text = FIGURE_SHORTCODE_RE.sub(replace_figure_shortcode, text)

# 把 Markdown 里的绝对路径图片 ![](/map/ch01.png) 转为 static/map/ch01.png
text = ABS_IMAGE_RE.sub(r'![\1](static/\2)', text)

return text

def process_file(input_path, output_path):
"""
处理单个 Markdown 文件

Args:
input_path: 输入文件路径
output_path: 输出文件路径
"""
with open(input_path, 'r', encoding='utf-8') as f:
content = f.read()

# 转换内容
converted_content = convert_markdown(content)

# 写入输出文件
os.makedirs(os.path.dirname(output_path), exist_ok=True)
with open(output_path, 'w', encoding='utf-8') as f:
f.write(converted_content)

print(f"Processed: {input_path} -> {output_path}")

def main():
"""主函数"""
if len(sys.argv) < 2:
print("Usage: preprocess.py <input_file> [output_file]")
print(" or: preprocess.py <input_dir> <output_dir>")
sys.exit(1)

input_path = sys.argv[1]

if os.path.isfile(input_path):
# 处理单个文件
output_path = sys.argv[2] if len(sys.argv) > 2 else input_path
process_file(input_path, output_path)
elif os.path.isdir(input_path):
# 处理目录
output_dir = sys.argv[2]
input_dir = Path(input_path)

# 获取所有 .md 文件
md_files = sorted(input_dir.glob('*.md'))

for md_file in md_files:
output_file = os.path.join(output_dir, md_file.name)
process_file(str(md_file), output_file)

print(f"\nTotal processed: {len(md_files)} files")
else:
print(f"Error: {input_path} is not a valid file or directory")
sys.exit(1)

if __name__ == '__main__':
main()
Loading