mirror of
https://github.com/tldr-pages/tldr
synced 2026-08-26 14:13:36 +01:00
rustdoc, rustfmt: add Simplified and Traditional Chinese translation (#22289)
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
# rustdoc
|
||||
|
||||
> 为 Rust 包(crate)生成文档。
|
||||
> 更多信息:<https://doc.rust-lang.org/stable/rustdoc/>。
|
||||
|
||||
- 从包(crate)的根文件生成文档:
|
||||
|
||||
`rustdoc {{src/lib.rs}}`
|
||||
|
||||
- 为项目传递一个名称:
|
||||
|
||||
`rustdoc {{src/lib.rs}} --crate-name {{名称}}`
|
||||
|
||||
- 从 Markdown 文件生成文档:
|
||||
|
||||
`rustdoc {{路径/到/文件.md}}`
|
||||
|
||||
- 指定输出目录:
|
||||
|
||||
`rustdoc {{src/lib.rs}} {{[-o|--out-dir]}} {{路径/到/输出目录}}`
|
||||
|
||||
- 显示帮助:
|
||||
|
||||
`rustdoc {{[-h|--help]}}`
|
||||
@@ -1,16 +1,24 @@
|
||||
# rustfmt
|
||||
|
||||
> 格式化 Rust 源代码的工具。
|
||||
> 格式化 Rust 源代码。
|
||||
> 更多信息:<https://github.com/rust-lang/rustfmt>。
|
||||
|
||||
- 格式化文件,就地覆盖原始文件:
|
||||
|
||||
`rustfmt {{路径/到/源文件.rs}}`
|
||||
|
||||
- 检查文件的格式并在控制台上显示所有更改:
|
||||
- 检查文件的格式并在控制台显示所有变更:
|
||||
|
||||
`rustfmt --check {{路径/到/源文件.rs}}`
|
||||
|
||||
- 格式化之前,备份所有修改过的文件(原始文件的扩展名为 `.bk`):
|
||||
- 在格式化前备份所有修改的文件(原始文件会以 `.bk` 扩展名重命名):
|
||||
|
||||
`rustfmt --backup {{路径/到/源文件.rs}}`
|
||||
|
||||
- 使用特定的 Rust 风格版次(格式化规则)以详细模式格式化代码:
|
||||
|
||||
`rustfmt --style-edition {{2015|2018|2021|2024}} {{[-v|--verbose]}} {{路径/到/源文件1.rs 路径/到/源文件2.rs ...}}`
|
||||
|
||||
- 使用特定的 Rust 版次(语言特性和解析)格式化代码:
|
||||
|
||||
`rustfmt --edition {{2015|2018|2021|2024}} {{路径/到/源文件1.rs 路径/到/源文件2.rs ...}}`
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
# rustdoc
|
||||
|
||||
> 為 Rust 套件(crate)產生文件。
|
||||
> 更多資訊:<https://doc.rust-lang.org/stable/rustdoc/>。
|
||||
|
||||
- 從套件(crate)的根檔案產生文件:
|
||||
|
||||
`rustdoc {{src/lib.rs}}`
|
||||
|
||||
- 為專案傳遞一個名稱:
|
||||
|
||||
`rustdoc {{src/lib.rs}} --crate-name {{名稱}}`
|
||||
|
||||
- 從 Markdown 檔案產生文件:
|
||||
|
||||
`rustdoc {{路徑/到/檔案.md}}`
|
||||
|
||||
- 指定輸出目錄:
|
||||
|
||||
`rustdoc {{src/lib.rs}} {{[-o|--out-dir]}} {{路徑/到/輸出目錄}}`
|
||||
|
||||
- 顯示說明:
|
||||
|
||||
`rustdoc {{[-h|--help]}}`
|
||||
@@ -0,0 +1,24 @@
|
||||
# rustfmt
|
||||
|
||||
> 格式化 Rust 原始碼。
|
||||
> 更多資訊:<https://github.com/rust-lang/rustfmt>。
|
||||
|
||||
- 格式化檔案,就地覆蓋原始檔案:
|
||||
|
||||
`rustfmt {{路徑/至/原始檔案.rs}}`
|
||||
|
||||
- 檢查檔案的格式並在主控台顯示所有變更:
|
||||
|
||||
`rustfmt --check {{路徑/至/原始檔案.rs}}`
|
||||
|
||||
- 在格式化前備份所有修改的檔案(原始檔案會以 `.bk` 副檔名重命名):
|
||||
|
||||
`rustfmt --backup {{路徑/至/原始檔案.rs}}`
|
||||
|
||||
- 使用特定的 Rust 風格版次(格式化規則)以詳細模式格式化程式碼:
|
||||
|
||||
`rustfmt --style-edition {{2015|2018|2021|2024}} {{[-v|--verbose]}} {{路徑/至/原始檔案1.rs 路徑/至/原始檔案2.rs ...}}`
|
||||
|
||||
- 使用特定的 Rust 版次(語言特性和解析)格式化程式碼:
|
||||
|
||||
`rustfmt --edition {{2015|2018|2021|2024}} {{路徑/至/原始檔案1.rs 路徑/至/原始檔案2.rs ...}}`
|
||||
@@ -17,4 +17,8 @@
|
||||
|
||||
- Specify the output directory:
|
||||
|
||||
`rustdoc {{src/lib.rs}} --out-dir {{path/to/output_directory}}`
|
||||
`rustdoc {{src/lib.rs}} {{[-o|--out-dir]}} {{path/to/output_directory}}`
|
||||
|
||||
- Display help:
|
||||
|
||||
`rustdoc {{[-h|--help]}}`
|
||||
|
||||
Reference in New Issue
Block a user