Merge pull request #950 from EurFelux/docs/serve

feat: Enable optional sections in the book
main
KaiserY 2 days ago committed by GitHub
commit bf23886a18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -8,9 +8,9 @@
PS: PS:
* 对照源码位置:[https://github.com/rust-lang/book/tree/main/src][source] - 对照源码位置:[https://github.com/rust-lang/book/tree/main/src][source]
* 注意源码 `src` 目录一般会比 [https://doc.rust-lang.org/book/](https://doc.rust-lang.org/book/) 要新,如果遇到冲突建议对照 `src` 目录。 - 注意源码 `src` 目录一般会比 [https://doc.rust-lang.org/book/](https://doc.rust-lang.org/book/) 要新,如果遇到冲突建议对照 `src` 目录。
* 每章翻译开头都带有官方链接和 commit hash 的注释,若发现与官方不一致,欢迎 Issue 或 PR - 每章翻译开头都带有官方链接和 commit hash 的注释,若发现与官方不一致,欢迎 Issue 或 PR
[source]: https://github.com/rust-lang/book/tree/main/src [source]: https://github.com/rust-lang/book/tree/main/src
@ -26,7 +26,7 @@ PS:
全局安装 mdbook 全局安装 mdbook
``` bash ```bash
cargo install mdbook cargo install mdbook
``` ```
@ -36,13 +36,10 @@ cd 到项目目录,然后开始构建。构建好的静态文档会出现在 "
mdbook build mdbook build
``` ```
### 文档撰写 在本地部署 HTTP 服务器以阅读文档:
可以通过任意的 http 服务器来预览构建的文档。举个例子:
```bash ```bash
cargo install simple-http-server mdbook serve
simple-http-server .\book\html\ -i
``` ```
## 社区资源 ## 社区资源
@ -62,6 +59,7 @@ simple-http-server .\book\html\ -i
本翻译主要采用 [mdBook](https://github.com/rust-lang-nursery/mdBook) 格式。同时支持 [GitBook](https://github.com/GitbookIO/gitbook),但会缺失部分功能,如一些代码没有语法高亮。 本翻译主要采用 [mdBook](https://github.com/rust-lang-nursery/mdBook) 格式。同时支持 [GitBook](https://github.com/GitbookIO/gitbook),但会缺失部分功能,如一些代码没有语法高亮。
本翻译加速查看站点有: 本翻译加速查看站点有:
- 深圳站点:<http://120.78.128.153/rustbook>
- 深圳站点:<http://120.78.128.153/rustbook>
[GitBook.com](https://www.gitbook.com/) 地址:<https://kaisery.github.io/trpl-zh-cn/> [GitBook.com](https://www.gitbook.com/) 地址:<https://kaisery.github.io/trpl-zh-cn/>

@ -25,6 +25,7 @@ custom-template = "custom-template.typ"
pdf = true pdf = true
section-number = true section-number = true
rust-book = true rust-book = true
optional = true
[rust] [rust]
edition = "2024" edition = "2024"

Loading…
Cancel
Save