From b944b00207161ae271143cabbbe73cd146a0b5d3 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 15 Jun 2026 00:42:19 +0800 Subject: Fix trailing whitespace in documentation files --- docs/_zh_CN/pages/2-getting-started.md | 14 +++++++------- docs/_zh_CN/pages/other/features.md | 34 +++++++++++++++++----------------- docs/pages/2-getting-started.md | 16 ++++++++-------- docs/pages/other/features.md | 34 +++++++++++++++++----------------- 4 files changed, 49 insertions(+), 49 deletions(-) diff --git a/docs/_zh_CN/pages/2-getting-started.md b/docs/_zh_CN/pages/2-getting-started.md index 57b32e4..62eb94b 100644 --- a/docs/_zh_CN/pages/2-getting-started.md +++ b/docs/_zh_CN/pages/2-getting-started.md @@ -6,7 +6,7 @@ cargo new my-cli cd my-cli ``` - + ## 添加依赖 在 `Cargo.toml` 写入如下内容 @@ -16,7 +16,7 @@ cd my-cli version = "0.2" features = [] ``` - + ## 启用特性 **Mingling** 默认所有特性关闭,且不提供类似 `full` 的全开特性。 @@ -31,7 +31,7 @@ features = [ "comp", ] ``` - + > [!NOTE] > 请前往 [docs.rs](https://docs.rs/mingling/latest/mingling/feature/index.html) 或 [特性](pages/other/features) 以了解所有特性 @@ -41,22 +41,22 @@ features = [ ```rust use mingling::prelude::*; - + fn main() { let mut program = ThisProgram::new(); program.exec_and_exit(); } - + gen_program!(); ``` - + ## 编译验证 ```plaintext ~# cargo check ``` - + --- 一切无误后,开始写点什么吧! diff --git a/docs/_zh_CN/pages/other/features.md b/docs/_zh_CN/pages/other/features.md index b04f1b8..f988a3a 100644 --- a/docs/_zh_CN/pages/other/features.md +++ b/docs/_zh_CN/pages/other/features.md @@ -19,15 +19,15 @@ ```rust // Features: ["async"] - + pack!(StateFoo = ()); - + #[chain] async fn handle_state_foo(foo: StateFoo) -> Next { StateFoo::new(()) } ``` - + 详见 [示例](https://mingling-rs.github.io/mingling/docs/example-viewer.html?name=example-async-support) ## 特性 `builds` @@ -41,13 +41,13 @@ async fn handle_state_foo(foo: StateFoo) -> Next { ```rust // Features: ["builds", "comp"] use mingling::build::build_comp_scripts; - + fn main() { // 为 `myprogram` 生成补全脚本 build_comp_scripts("myprogram").unwrap(); } ``` - + ## 特性 `clap` **介绍:** @@ -106,17 +106,17 @@ fn main() { ```rust // Features: ["extra_macros"] - + pack!(StatePrev1 = ()); pack!(StatePrev2 = ()); - + pack!(StateNext = ()); - + #[chain] fn handle_state_prev2(_p: StatePrev1) { // 无 Next 的 #[chain] 可以直接不返回值 } - + #[chain] fn handle_state_prev1(_p: StatePrev1) -> Next { let foo = 1; @@ -129,19 +129,19 @@ fn handle_state_prev1(_p: StatePrev1) -> Next { } } ``` - + ### `#[program_setup]` ```rust // Features: ["extra_macros"] use mingling::{macros::program_setup, Program}; - + fn main() { let mut program = ThisProgram::new(); program.with_setup(NoErrorSetup); program.exec_and_exit(); } - + #[program_setup] fn no_error_setup(program: &mut Program) { program.global_flag(["--no-error"], |program| { @@ -149,24 +149,24 @@ fn no_error_setup(program: &mut Program) { }); } ``` - + ### `entry!` ```rust // Features: ["extra_macros"] use mingling::macros::entry; - + pack!(EntryHello = Vec); - + fn main() { let result = handle_hello(entry!("--name", "Bob")).into(); // ... 此处为断言逻辑 } - + #[chain] fn handle_hello(args: EntryHello) {} ``` - + ## 特性 `general_renderer` diff --git a/docs/pages/2-getting-started.md b/docs/pages/2-getting-started.md index 77503e9..35da464 100644 --- a/docs/pages/2-getting-started.md +++ b/docs/pages/2-getting-started.md @@ -6,7 +6,7 @@ cargo new my-cli cd my-cli ``` - + ## Add Dependency Add the following to `Cargo.toml`: @@ -16,7 +16,7 @@ Add the following to `Cargo.toml`: version = "0.2" features = [] ``` - + ## Enable Features **Mingling** has all features disabled by default and does not provide an all-in-one feature like `full`. @@ -31,7 +31,7 @@ features = [ "comp", ] ``` - + > [!NOTE] > Visit [docs.rs](https://docs.rs/mingling/latest/mingling/feature/index.html) or [Features](pages/other/features) to learn about all available features. @@ -41,22 +41,22 @@ Edit `src/main.rs` with the following code: ```rust use mingling::prelude::*; - + fn main() { let mut program = ThisProgram::new(); - + program.exec_and_exit(); } - + gen_program!(); ``` - + ## Verify Compilation ```plaintext ~# cargo check ``` - + --- Once everything is good, start building! diff --git a/docs/pages/other/features.md b/docs/pages/other/features.md index 8f458af..f0edc84 100644 --- a/docs/pages/other/features.md +++ b/docs/pages/other/features.md @@ -19,15 +19,15 @@ Enables async runtime support, allowing `#[chain]` to bind `async` functions, e. ```rust // Features: ["async"] - + pack!(StateFoo = ()); - + #[chain] async fn handle_state_foo(foo: StateFoo) -> Next { StateFoo::new(()) } ``` - + See [example](https://mingling-rs.github.io/mingling/docs/example-viewer.html?name=example-async-support) ## Feature `builds` @@ -41,13 +41,13 @@ Enables scripts needed for use in `build.rs`, currently including: ```rust // Features: ["builds", "comp"] use mingling::build::build_comp_scripts; - + fn main() { // Generate completion scripts for `myprogram` build_comp_scripts("myprogram").unwrap(); } ``` - + ## Feature `clap` **Description:** @@ -106,17 +106,17 @@ For example, allows the shorthand form `dispatcher!("greet")`, which auto-genera ```rust // Features: ["extra_macros"] - + pack!(StatePrev1 = ()); pack!(StatePrev2 = ()); - + pack!(StateNext = ()); - + #[chain] fn handle_state_prev2(_p: StatePrev1) { // A #[chain] with no return type can simply omit the return value } - + #[chain] fn handle_state_prev1(_p: StatePrev1) -> Next { let foo = 1; @@ -129,19 +129,19 @@ fn handle_state_prev1(_p: StatePrev1) -> Next { } } ``` - + ### `#[program_setup]` ```rust // Features: ["extra_macros"] use mingling::{macros::program_setup, Program}; - + fn main() { let mut program = ThisProgram::new(); program.with_setup(NoErrorSetup); program.exec_and_exit(); } - + #[program_setup] fn no_error_setup(program: &mut Program) { program.global_flag(["--no-error"], |program| { @@ -149,24 +149,24 @@ fn no_error_setup(program: &mut Program) { }); } ``` - + ### `entry!` ```rust // Features: ["extra_macros"] use mingling::macros::entry; - + pack!(EntryHello = Vec); - + fn main() { let result = handle_hello(entry!("--name", "Bob")).into(); // ... assertion logic here } - + #[chain] fn handle_hello(args: EntryHello) {} ``` - + ## Feature `general_renderer` -- cgit