From 01382c8e0a9a8a2049739248f46fc431b58aa755 Mon Sep 17 00:00:00 2001 From: icarus Date: Sat, 21 Feb 2026 02:26:03 +0800 Subject: [PATCH 1/5] refactor: Format book.toml with consistent indentation --- book.toml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/book.toml b/book.toml index 2d84b18f..3a9b06c8 100644 --- a/book.toml +++ b/book.toml @@ -1,18 +1,13 @@ [book] title = "Rust 程序设计语言 简体中文版" -authors = [ - "Steve Klabnik", - "Carol Nichols", - "Chris Krycho", - "来自 Rust 社区的贡献(Rust 中文社区翻译)", -] +authors = ["Steve Klabnik", "Carol Nichols", "Chris Krycho", "来自 Rust 社区的贡献(Rust 中文社区翻译)"] [output.html] additional-css = [ - "ferris.css", - "theme/2018-edition.css", - "theme/semantic-notes.css", - "theme/listing.css", + "ferris.css", + "theme/2018-edition.css", + "theme/semantic-notes.css", + "theme/listing.css", ] additional-js = ["ferris.js"] git-repository-url = "https://github.com/KaiserY/trpl-zh-cn/tree/main" @@ -25,6 +20,7 @@ custom-template = "custom-template.typ" pdf = true section-number = true rust-book = true +optional = true [rust] edition = "2024" From 0bfa03d33f90fc17ce32c7c92eed6edca70fbfb5 Mon Sep 17 00:00:00 2001 From: icarus Date: Fri, 27 Feb 2026 14:31:40 +0800 Subject: [PATCH 2/5] docs: update README.md --- README.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index ee73b2fa..8db61f96 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,9 @@ PS: -* 对照源码位置:[https://github.com/rust-lang/book/tree/main/src][source] -* 注意源码 `src` 目录一般会比 [https://doc.rust-lang.org/book/](https://doc.rust-lang.org/book/) 要新,如果遇到冲突建议对照 `src` 目录。 -* 每章翻译开头都带有官方链接和 commit hash 的注释,若发现与官方不一致,欢迎 Issue 或 PR +- 对照源码位置:[https://github.com/rust-lang/book/tree/main/src][source] +- 注意源码 `src` 目录一般会比 [https://doc.rust-lang.org/book/](https://doc.rust-lang.org/book/) 要新,如果遇到冲突建议对照 `src` 目录。 +- 每章翻译开头都带有官方链接和 commit hash 的注释,若发现与官方不一致,欢迎 Issue 或 PR [source]: https://github.com/rust-lang/book/tree/main/src @@ -26,7 +26,7 @@ PS: 全局安装 mdbook -``` bash +```bash cargo install mdbook ``` @@ -36,13 +36,10 @@ cd 到项目目录,然后开始构建。构建好的静态文档会出现在 " mdbook build ``` -### 文档撰写 - 可以通过任意的 http 服务器来预览构建的文档。举个例子: ```bash -cargo install simple-http-server -simple-http-server .\book\html\ -i +mdbook serve ``` ## 社区资源 @@ -62,6 +59,7 @@ simple-http-server .\book\html\ -i 本翻译主要采用 [mdBook](https://github.com/rust-lang-nursery/mdBook) 格式。同时支持 [GitBook](https://github.com/GitbookIO/gitbook),但会缺失部分功能,如一些代码没有语法高亮。 本翻译加速查看站点有: - - 深圳站点: + +- 深圳站点: [GitBook.com](https://www.gitbook.com/) 地址: From f2035458067ba10809a13f322cb13f22a0bae8e5 Mon Sep 17 00:00:00 2001 From: icarus Date: Fri, 27 Feb 2026 15:28:32 +0800 Subject: [PATCH 3/5] docs: Update README with clearer local preview instructions --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8db61f96..0ec9dc06 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ cd 到项目目录,然后开始构建。构建好的静态文档会出现在 " mdbook build ``` -可以通过任意的 http 服务器来预览构建的文档。举个例子: +在本地部署 HTTP 服务器以阅读文档: ```bash mdbook serve From d24df237888ead63e79aaf60f7260b489fc223e9 Mon Sep 17 00:00:00 2001 From: icarus Date: Fri, 27 Feb 2026 15:30:03 +0800 Subject: [PATCH 4/5] Revert "refactor: Format book.toml with consistent indentation" This reverts commit 01382c8e0a9a8a2049739248f46fc431b58aa755. --- book.toml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/book.toml b/book.toml index 3a9b06c8..2d84b18f 100644 --- a/book.toml +++ b/book.toml @@ -1,13 +1,18 @@ [book] title = "Rust 程序设计语言 简体中文版" -authors = ["Steve Klabnik", "Carol Nichols", "Chris Krycho", "来自 Rust 社区的贡献(Rust 中文社区翻译)"] +authors = [ + "Steve Klabnik", + "Carol Nichols", + "Chris Krycho", + "来自 Rust 社区的贡献(Rust 中文社区翻译)", +] [output.html] additional-css = [ - "ferris.css", - "theme/2018-edition.css", - "theme/semantic-notes.css", - "theme/listing.css", + "ferris.css", + "theme/2018-edition.css", + "theme/semantic-notes.css", + "theme/listing.css", ] additional-js = ["ferris.js"] git-repository-url = "https://github.com/KaiserY/trpl-zh-cn/tree/main" @@ -20,7 +25,6 @@ custom-template = "custom-template.typ" pdf = true section-number = true rust-book = true -optional = true [rust] edition = "2024" From 8563ff5f4e261ee57d51631008aadc1f840b3876 Mon Sep 17 00:00:00 2001 From: icarus Date: Fri, 27 Feb 2026 15:30:42 +0800 Subject: [PATCH 5/5] feat: Enable optional sections in the book --- book.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/book.toml b/book.toml index 2d84b18f..4a69f462 100644 --- a/book.toml +++ b/book.toml @@ -25,6 +25,7 @@ custom-template = "custom-template.typ" pdf = true section-number = true rust-book = true +optional = true [rust] edition = "2024"