https://github.com/rust-lang-cn/style-guide-cn
Rust 语言风格指南 中文版——Chinese translation of The Rust Style Guide
https://github.com/rust-lang-cn/style-guide-cn
rust rust-style-guide style-guide
Last synced: 24 days ago
JSON representation
Rust 语言风格指南 中文版——Chinese translation of The Rust Style Guide
- Host: GitHub
- URL: https://github.com/rust-lang-cn/style-guide-cn
- Owner: rust-lang-cn
- License: apache-2.0
- Created: 2023-07-30T15:04:37.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-31T17:35:49.000Z (almost 2 years ago)
- Last Synced: 2025-04-05T12:51:09.247Z (about 2 months ago)
- Topics: rust, rust-style-guide, style-guide
- Language: JavaScript
- Homepage: https://rustwiki.org/zh-CN/style-guide/
- Size: 1.13 MB
- Stars: 11
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# Rust 语言风格指南

[](https://raw.githubusercontent.com/rust-lang-cn/style-guide-cn/master/LICENSE-MIT)
[](https://raw.githubusercontent.com/rust-lang-cn/style-guide-cn/master/LICENSE-APACHE)
[](https://github.com/rust-lang-cn/style-guide-cn/commits/master)
[](https://github.com/rust-lang-cn/style-guide-cn/graphs/contributors)

[](https://rustwiki.org)> The Chinese Translation of [The Rust Style Guide][style-guide-en]
>
> - 首次于 2023-07-31 翻译完全部内容,欢迎纠正——最后更新时间 2023-07-31。
> - 期待更多朋友加入 [Rust 中文翻译项目组](https://github.com/rust-lang-cn),协助我们,一起更新完善中文版,感激不尽!这是《Rust 语言风格指南》中文版,翻译自 [Rust 源码中的《The Rust Style Guide》][style-guide-src]。
在线版可在本组织官网上阅读,包括[全球站点][style-guide-cn]或[国内站点][style-guide-cn-zh](**均支持同一页面中英双语切换**),或者在 Rust 官网上[阅读英文版][style-guide-en]。
[style-guide-src]: https://github.com/rust-lang/rust/tree/master/src/doc/style-guide
[style-guide-cn]: https://rustwiki.org/zh-CN/style-guide/
[style-guide-cn-zh]: https://www.rustwiki.org.cn/zh-CN/style-guide/
[style-guide-en]: https://doc.rust-lang.org/style-guide/## 构建
构建之前请先安装 `mdBook` 工具。
从 GitHub 下载仓库并构建:
```sh
$ git clone https://github.com/rust-lang-cn/style-guide-cn.git
$ cd style-guide-cn
$ mdbook serve
```然后就可以在浏览器上访问 `http://localhost:3000` 来查看文档内容了。
要生成本地图书,使用以下命令:
```sh
$ mdbook build
```即可在当前仓库目录下生存一个 `book` 子目录,可找到相应的 HTML 文件。
## 许可协议
《Rust 语言风格指南》(中文版与英文版 *The Rust Style Guide* 均) 使用以下两种协议的任一种进行授权:
- Apache 2.0 授权协议,([LICENSE-APACHE](LICENSE-APACHE) 或 http://www.apache.org/licenses/LICENSE-2.0)
- MIT 授权协议 ([LICENSE-MIT](LICENSE-MIT) 或 http://opensource.org/licenses/MIT)可以根据自己选择来定。
除非您有另外说明,否则您在本仓库提交的任何贡献均按上述方式进行双重许可授权,就如 Apache 2.0 协议所规定那样,而无需附加任何其他条款或条件。