From acd670b5b3480471824aecb28922f8912123802e Mon Sep 17 00:00:00 2001 From: ้ญๆ›นๅ…ˆ็”Ÿ <1992414357@qq.com> Date: Mon, 15 Jun 2026 01:31:12 +0800 Subject: Update example descriptions with meaningful docs --- docs/example-pages/examples.json | 40 +++++++++++++------------- examples/example-argument-parse/page.toml | 2 +- examples/example-async-support/page.toml | 2 +- examples/example-basic/page.toml | 2 +- examples/example-clap-binding/page.toml | 2 +- examples/example-completion/page.toml | 2 +- examples/example-custom-pickable/page.toml | 2 +- examples/example-dispatch-tree/page.toml | 2 +- examples/example-enum-tag/page.toml | 2 +- examples/example-error-handling/page.toml | 2 +- examples/example-exitcode/page.toml | 2 +- examples/example-general-renderer/page.toml | 2 +- examples/example-help/page.toml | 2 +- examples/example-hook/page.toml | 2 +- examples/example-implicit-dispatcher/page.toml | 2 +- examples/example-lazy-resources/page.toml | 2 +- examples/example-panic-unwind/page.toml | 2 +- examples/example-repl-basic/page.toml | 2 +- examples/example-resources/page.toml | 2 +- examples/example-setup/page.toml | 2 +- examples/example-unit-test/page.toml | 2 +- 21 files changed, 40 insertions(+), 40 deletions(-) diff --git a/docs/example-pages/examples.json b/docs/example-pages/examples.json index f669af7..e7f0c0c 100644 --- a/docs/example-pages/examples.json +++ b/docs/example-pages/examples.json @@ -4,7 +4,7 @@ "name": "Basic", "icon": "๐Ÿš€", "category": "core", - "desc": "Example The Basic Usage of Mingling\n", + "desc": "Demonstrates the basic usage of Mingling with a simple `greet` subcommand that takes a name and prints a greeting.\n", "tags": [ "dispatcher!", "#[chain]", @@ -20,7 +20,7 @@ "name": "Argument Parse", "icon": "๐Ÿ“‹", "category": "parsing", - "desc": "Example Argument Parse\n", + "desc": "Shows how to use Mingling's `parser` feature with a `Picker` to extract and validate typed arguments from the command line.\n", "tags": [ "pick", "Pickable" @@ -35,7 +35,7 @@ "name": "Async Support", "icon": "โšก", "category": "runtime", - "desc": "Example Async Runtime Support\n", + "desc": "Shows how to drive an async runtime with Mingling using the `async` feature, enabling `async fn` in `#[chain]` with tokio.\n", "tags": [ "async", "await", @@ -51,7 +51,7 @@ "name": "Clap Binding", "icon": "๐Ÿ”—", "category": "parsing", - "desc": "Example Clap Binding\n", + "desc": "Demonstrates how to bind a `clap::Parser` derive struct to Mingling using `#[dispatcher_clap]` for advanced argument parsing.\n", "tags": [ "clap" ], @@ -65,7 +65,7 @@ "name": "Completion", "icon": "๐Ÿ”„", "category": "ux", - "desc": "Example Completion\n", + "desc": "Demonstrates how to implement dynamic shell completion with `#[completion]` and generate scripts for bash, zsh, fish, and pwsh.\n", "tags": [ "comp" ], @@ -80,7 +80,7 @@ "name": "Custom Pickable", "icon": "๐ŸŽฏ", "category": "parsing", - "desc": "Example Custom Pickable\n", + "desc": "Shows how to implement the `Pickable` trait on custom types for seamless extraction from CLI arguments via Picker.\n", "tags": [ "Pickable", "custom" @@ -95,7 +95,7 @@ "name": "Dispatch Tree", "icon": "๐ŸŒณ", "category": "dispatch", - "desc": "Example Dispatch Tree\n", + "desc": "Introduces the `dispatch_tree` feature that converts the subcommand list into a compile-time prefix trie for O(n) command lookup.\n", "tags": [ "dispatch_tree" ], @@ -109,7 +109,7 @@ "name": "Enum Tag", "icon": "๐Ÿท๏ธ", "category": "parsing", - "desc": "Example Enum Tag\n", + "desc": "Shows how to derive `EnumTag` on enums for parsing variants from CLI strings with renames and descriptions.\n", "tags": [ "enum_tag", "Pickable" @@ -124,7 +124,7 @@ "name": "Error Handling", "icon": "โš ๏ธ", "category": "runtime", - "desc": "Example Error Handling\n", + "desc": "Demonstrates how to define custom error types with `pack!` and route them to dedicated `#[renderer]` functions for user-friendly output.\n", "tags": [ "Result" ], @@ -138,7 +138,7 @@ "name": "Exitcode", "icon": "๐Ÿšช", "category": "runtime", - "desc": "Example Error Handling\n", + "desc": "Shows how to set custom exit codes using `ExitCodeSetup` and the `finish` hook to signal success or failure to the shell.\n", "tags": [ "ExitCode" ], @@ -152,7 +152,7 @@ "name": "General Renderer", "icon": "๐Ÿ“ค", "category": "output", - "desc": "Example General Renderer\n", + "desc": "Demonstrates how to render structured output in JSON or YAML using `GeneralRendererSetup` and the `general_renderer` feature.\n", "tags": [ "general_renderer", "--json", @@ -168,7 +168,7 @@ "name": "Help", "icon": "๐Ÿ’ก", "category": "ux", - "desc": "Example Help\n", + "desc": "Shows how to use the `#[help]` attribute to provide custom per-command help text that activates when the user passes `--help`.\n", "tags": [ "#[help]" ], @@ -182,7 +182,7 @@ "name": "Hook", "icon": "๐Ÿช", "category": "runtime", - "desc": "Example Hook\n", + "desc": "Demonstrates how to use Mingling's `ProgramHook` system to observe and debug every stage of the execution pipeline.\n", "tags": [ "ProgramHook" ], @@ -196,7 +196,7 @@ "name": "Implicit Dispatcher", "icon": "๐Ÿซฅ", "category": "dispatch", - "desc": "Example Implicit Dispatcher\n", + "desc": "Shows the abbreviated `dispatcher!(\"cmd.path\")` syntax from `extra_macros` that auto-derives struct names from the command path.\n", "tags": [ "implicit" ], @@ -210,7 +210,7 @@ "name": "Lazy Resources", "icon": "๐Ÿ’ค๏ธ", "category": "advanced", - "desc": "Example Lazy Resources\n", + "desc": "Demonstrates how to use `LazyRes` for lazily initialized resources that only allocate when first accessed.\n", "tags": [ "LazyRes" ], @@ -224,7 +224,7 @@ "name": "Panic Unwind", "icon": "๐Ÿ’ฅ", "category": "runtime", - "desc": "Example Panic Unwind\n", + "desc": "Shows how to catch panics during program execution and display friendly error messages instead of a raw panic trace.\n", "tags": [ "panic_unwind" ], @@ -238,7 +238,7 @@ "name": "REPL Basic", "icon": "๐Ÿ”", "category": "repl", - "desc": "Example REPL Basic\n", + "desc": "Demonstrates how to build an interactive REPL shell with Mingling using `exec_repl()`, custom prompts, and built-in setups.\n", "tags": [ "repl" ], @@ -252,7 +252,7 @@ "name": "Resources", "icon": "๐Ÿ“ฆ", "category": "advanced", - "desc": "Example Resource Injection\n", + "desc": "Shows how to share global state across commands using `with_resource()` and inject `&T` or `&mut T` into chain and renderer functions.\n", "tags": [ "Resources", "injection" @@ -268,7 +268,7 @@ "name": "Setup", "icon": "๐Ÿ—๏ธ", "category": "core", - "desc": "Example Setup\n", + "desc": "Demonstrates how to build a custom `ProgramSetup` with `#[program_setup]` for modular configuration of program behaviour.\n", "tags": [ "#[setup]", "extra_macros" @@ -283,7 +283,7 @@ "name": "Unit Test", "icon": "๐Ÿงช", "category": "testing", - "desc": "Example Unit Test\n", + "desc": "Shows how to write unit tests for Chain and Renderer functions using the `entry!` macro and assertion helpers.\n", "tags": [ "testing", "extra_macros" diff --git a/examples/example-argument-parse/page.toml b/examples/example-argument-parse/page.toml index 1a85621..fc4d646 100644 --- a/examples/example-argument-parse/page.toml +++ b/examples/example-argument-parse/page.toml @@ -4,7 +4,7 @@ name = "Argument Parse" icon = "๐Ÿ“‹" category = "parsing" desc = """ -Example Argument Parse +Shows how to use Mingling's `parser` feature with a `Picker` to extract and validate typed arguments from the command line. """ tags = ["pick", "Pickable"] files = ["src/main.rs", "Cargo.toml"] diff --git a/examples/example-async-support/page.toml b/examples/example-async-support/page.toml index e193a2b..cfa0565 100644 --- a/examples/example-async-support/page.toml +++ b/examples/example-async-support/page.toml @@ -4,7 +4,7 @@ name = "Async Support" icon = "โšก" category = "runtime" desc = """ -Example Async Runtime Support +Shows how to drive an async runtime with Mingling using the `async` feature, enabling `async fn` in `#[chain]` with tokio. """ tags = ["async", "await", "#[chain]"] files = ["src/main.rs", "Cargo.toml"] diff --git a/examples/example-basic/page.toml b/examples/example-basic/page.toml index a9e1a15..0aa6e68 100644 --- a/examples/example-basic/page.toml +++ b/examples/example-basic/page.toml @@ -4,7 +4,7 @@ name = "Basic" icon = "๐Ÿš€" category = "core" desc = """ -Example The Basic Usage of Mingling +Demonstrates the basic usage of Mingling with a simple `greet` subcommand that takes a name and prints a greeting. """ tags = ["dispatcher!", "#[chain]", "#[renderer]"] files = ["src/main.rs", "Cargo.toml"] diff --git a/examples/example-clap-binding/page.toml b/examples/example-clap-binding/page.toml index bd8a9eb..aa03d5f 100644 --- a/examples/example-clap-binding/page.toml +++ b/examples/example-clap-binding/page.toml @@ -4,7 +4,7 @@ name = "Clap Binding" icon = "๐Ÿ”—" category = "parsing" desc = """ -Example Clap Binding +Demonstrates how to bind a `clap::Parser` derive struct to Mingling using `#[dispatcher_clap]` for advanced argument parsing. """ tags = ["clap"] files = ["src/main.rs", "Cargo.toml"] diff --git a/examples/example-completion/page.toml b/examples/example-completion/page.toml index 029cfb5..adccd86 100644 --- a/examples/example-completion/page.toml +++ b/examples/example-completion/page.toml @@ -4,7 +4,7 @@ name = "Completion" icon = "๐Ÿ”„" category = "ux" desc = """ -Example Completion +Demonstrates how to implement dynamic shell completion with `#[completion]` and generate scripts for bash, zsh, fish, and pwsh. """ tags = ["comp"] files = ["src/main.rs", "build.rs", "Cargo.toml"] diff --git a/examples/example-custom-pickable/page.toml b/examples/example-custom-pickable/page.toml index 9b6cd05..1c3bfa0 100644 --- a/examples/example-custom-pickable/page.toml +++ b/examples/example-custom-pickable/page.toml @@ -4,7 +4,7 @@ name = "Custom Pickable" icon = "๐ŸŽฏ" category = "parsing" desc = """ -Example Custom Pickable +Shows how to implement the `Pickable` trait on custom types for seamless extraction from CLI arguments via Picker. """ tags = ["Pickable", "custom"] files = ["src/main.rs", "Cargo.toml"] diff --git a/examples/example-dispatch-tree/page.toml b/examples/example-dispatch-tree/page.toml index 220ea16..d1fd425 100644 --- a/examples/example-dispatch-tree/page.toml +++ b/examples/example-dispatch-tree/page.toml @@ -4,7 +4,7 @@ name = "Dispatch Tree" icon = "๐ŸŒณ" category = "dispatch" desc = """ -Example Dispatch Tree +Introduces the `dispatch_tree` feature that converts the subcommand list into a compile-time prefix trie for O(n) command lookup. """ tags = ["dispatch_tree"] files = ["src/main.rs", "Cargo.toml"] diff --git a/examples/example-enum-tag/page.toml b/examples/example-enum-tag/page.toml index 01eb9b0..53170a9 100644 --- a/examples/example-enum-tag/page.toml +++ b/examples/example-enum-tag/page.toml @@ -4,7 +4,7 @@ name = "Enum Tag" icon = "๐Ÿท๏ธ" category = "parsing" desc = """ -Example Enum Tag +Shows how to derive `EnumTag` on enums for parsing variants from CLI strings with renames and descriptions. """ tags = ["enum_tag", "Pickable"] files = ["src/main.rs", "Cargo.toml"] diff --git a/examples/example-error-handling/page.toml b/examples/example-error-handling/page.toml index 7c07928..655bc2b 100644 --- a/examples/example-error-handling/page.toml +++ b/examples/example-error-handling/page.toml @@ -4,7 +4,7 @@ name = "Error Handling" icon = "โš ๏ธ" category = "runtime" desc = """ -Example Error Handling +Demonstrates how to define custom error types with `pack!` and route them to dedicated `#[renderer]` functions for user-friendly output. """ tags = ["Result"] files = ["src/main.rs", "Cargo.toml"] diff --git a/examples/example-exitcode/page.toml b/examples/example-exitcode/page.toml index f0be05c..96329ba 100644 --- a/examples/example-exitcode/page.toml +++ b/examples/example-exitcode/page.toml @@ -4,7 +4,7 @@ name = "Exitcode" icon = "๐Ÿšช" category = "runtime" desc = """ -Example Error Handling +Shows how to set custom exit codes using `ExitCodeSetup` and the `finish` hook to signal success or failure to the shell. """ tags = ["ExitCode"] files = ["src/main.rs", "Cargo.toml"] diff --git a/examples/example-general-renderer/page.toml b/examples/example-general-renderer/page.toml index c07b26a..1d3e4b1 100644 --- a/examples/example-general-renderer/page.toml +++ b/examples/example-general-renderer/page.toml @@ -4,7 +4,7 @@ name = "General Renderer" icon = "๐Ÿ“ค" category = "output" desc = """ -Example General Renderer +Demonstrates how to render structured output in JSON or YAML using `GeneralRendererSetup` and the `general_renderer` feature. """ tags = ["general_renderer", "--json", "--yaml"] files = ["src/main.rs", "Cargo.toml"] diff --git a/examples/example-help/page.toml b/examples/example-help/page.toml index aa74e6e..94018c8 100644 --- a/examples/example-help/page.toml +++ b/examples/example-help/page.toml @@ -4,7 +4,7 @@ name = "Help" icon = "๐Ÿ’ก" category = "ux" desc = """ -Example Help +Shows how to use the `#[help]` attribute to provide custom per-command help text that activates when the user passes `--help`. """ tags = ["#[help]"] files = ["src/main.rs", "Cargo.toml"] diff --git a/examples/example-hook/page.toml b/examples/example-hook/page.toml index beca75a..f696dd1 100644 --- a/examples/example-hook/page.toml +++ b/examples/example-hook/page.toml @@ -4,7 +4,7 @@ name = "Hook" icon = "๐Ÿช" category = "runtime" desc = """ -Example Hook +Demonstrates how to use Mingling's `ProgramHook` system to observe and debug every stage of the execution pipeline. """ tags = ["ProgramHook"] files = ["src/main.rs", "Cargo.toml"] diff --git a/examples/example-implicit-dispatcher/page.toml b/examples/example-implicit-dispatcher/page.toml index 2812b79..4bea717 100644 --- a/examples/example-implicit-dispatcher/page.toml +++ b/examples/example-implicit-dispatcher/page.toml @@ -4,7 +4,7 @@ name = "Implicit Dispatcher" icon = "๐Ÿซฅ" category = "dispatch" desc = """ -Example Implicit Dispatcher +Shows the abbreviated `dispatcher!("cmd.path")` syntax from `extra_macros` that auto-derives struct names from the command path. """ tags = ["implicit"] files = ["src/main.rs", "Cargo.toml"] diff --git a/examples/example-lazy-resources/page.toml b/examples/example-lazy-resources/page.toml index d2c740f..46d5080 100644 --- a/examples/example-lazy-resources/page.toml +++ b/examples/example-lazy-resources/page.toml @@ -4,7 +4,7 @@ name = "Lazy Resources" icon = "๐Ÿ’ค๏ธ" category = "advanced" desc = """ -Example Lazy Resources +Demonstrates how to use `LazyRes` for lazily initialized resources that only allocate when first accessed. """ tags = ["LazyRes"] files = ["src/main.rs", "Cargo.toml"] diff --git a/examples/example-panic-unwind/page.toml b/examples/example-panic-unwind/page.toml index 8b9a7cd..2ca327d 100644 --- a/examples/example-panic-unwind/page.toml +++ b/examples/example-panic-unwind/page.toml @@ -4,7 +4,7 @@ name = "Panic Unwind" icon = "๐Ÿ’ฅ" category = "runtime" desc = """ -Example Panic Unwind +Shows how to catch panics during program execution and display friendly error messages instead of a raw panic trace. """ tags = ["panic_unwind"] files = ["src/main.rs", "Cargo.toml"] diff --git a/examples/example-repl-basic/page.toml b/examples/example-repl-basic/page.toml index 83d92c0..bfe5340 100644 --- a/examples/example-repl-basic/page.toml +++ b/examples/example-repl-basic/page.toml @@ -4,7 +4,7 @@ name = "REPL Basic" icon = "๐Ÿ”" category = "repl" desc = """ -Example REPL Basic +Demonstrates how to build an interactive REPL shell with Mingling using `exec_repl()`, custom prompts, and built-in setups. """ tags = ["repl"] files = ["src/main.rs", "Cargo.toml"] diff --git a/examples/example-resources/page.toml b/examples/example-resources/page.toml index 0121f8a..d51f80c 100644 --- a/examples/example-resources/page.toml +++ b/examples/example-resources/page.toml @@ -4,7 +4,7 @@ name = "Resources" icon = "๐Ÿ“ฆ" category = "advanced" desc = """ -Example Resource Injection +Shows how to share global state across commands using `with_resource()` and inject `&T` or `&mut T` into chain and renderer functions. """ tags = ["Resources", "injection"] files = ["Cargo.toml", "src/main.rs", "src/lib.rs"] diff --git a/examples/example-setup/page.toml b/examples/example-setup/page.toml index c12443e..9c1fc97 100644 --- a/examples/example-setup/page.toml +++ b/examples/example-setup/page.toml @@ -4,7 +4,7 @@ name = "Setup" icon = "๐Ÿ—๏ธ" category = "core" desc = """ -Example Setup +Demonstrates how to build a custom `ProgramSetup` with `#[program_setup]` for modular configuration of program behaviour. """ tags = ["#[setup]", "extra_macros"] files = ["src/main.rs", "Cargo.toml"] diff --git a/examples/example-unit-test/page.toml b/examples/example-unit-test/page.toml index 7356cc2..d778d49 100644 --- a/examples/example-unit-test/page.toml +++ b/examples/example-unit-test/page.toml @@ -4,7 +4,7 @@ name = "Unit Test" icon = "๐Ÿงช" category = "testing" desc = """ -Example Unit Test +Shows how to write unit tests for Chain and Renderer functions using the `entry!` macro and assertion helpers. """ tags = ["testing", "extra_macros"] files = ["Cargo.toml", "src/main.rs"] -- cgit