Skip to content

Commit bf23886

Browse files
authored
Merge pull request #950 from EurFelux/docs/serve
feat: Enable optional sections in the book
2 parents d2b3fc1 + 8563ff5 commit bf23886

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
PS:
1010

11-
* 对照源码位置:[https://github.com/rust-lang/book/tree/main/src][source]
12-
* 注意源码 `src` 目录一般会比 [https://doc.rust-lang.org/book/](https://doc.rust-lang.org/book/) 要新,如果遇到冲突建议对照 `src` 目录。
13-
* 每章翻译开头都带有官方链接和 commit hash 的注释,若发现与官方不一致,欢迎 Issue 或 PR
11+
- 对照源码位置:[https://github.com/rust-lang/book/tree/main/src][source]
12+
- 注意源码 `src` 目录一般会比 [https://doc.rust-lang.org/book/](https://doc.rust-lang.org/book/) 要新,如果遇到冲突建议对照 `src` 目录。
13+
- 每章翻译开头都带有官方链接和 commit hash 的注释,若发现与官方不一致,欢迎 Issue 或 PR
1414

1515
[source]: https://github.com/rust-lang/book/tree/main/src
1616

@@ -26,7 +26,7 @@ PS:
2626

2727
全局安装 mdbook
2828

29-
``` bash
29+
```bash
3030
cargo install mdbook
3131
```
3232

@@ -36,13 +36,10 @@ cd 到项目目录,然后开始构建。构建好的静态文档会出现在 "
3636
mdbook build
3737
```
3838

39-
### 文档撰写
40-
41-
可以通过任意的 http 服务器来预览构建的文档。举个例子:
39+
在本地部署 HTTP 服务器以阅读文档:
4240

4341
```bash
44-
cargo install simple-http-server
45-
simple-http-server .\book\html\ -i
42+
mdbook serve
4643
```
4744

4845
## 社区资源
@@ -62,6 +59,7 @@ simple-http-server .\book\html\ -i
6259
本翻译主要采用 [mdBook](https://github.com/rust-lang-nursery/mdBook) 格式。同时支持 [GitBook](https://github.com/GitbookIO/gitbook),但会缺失部分功能,如一些代码没有语法高亮。
6360

6461
本翻译加速查看站点有:
65-
- 深圳站点:<http://120.78.128.153/rustbook>
62+
63+
- 深圳站点:<http://120.78.128.153/rustbook>
6664

6765
[GitBook.com](https://www.gitbook.com/) 地址:<https://kaisery.github.io/trpl-zh-cn/>

book.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ custom-template = "custom-template.typ"
2525
pdf = true
2626
section-number = true
2727
rust-book = true
28+
optional = true
2829

2930
[rust]
3031
edition = "2024"

0 commit comments

Comments
 (0)