diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-06-15 00:36:34 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-06-15 00:36:34 +0800 |
| commit | e214d07f6783009869c93bbab1e4bec9829584ee (patch) | |
| tree | 2f5e4ebeba925a5676728f498119a614ffc654b5 /docs/pages/2-getting-started.md | |
| parent | 14666265b235626c3f0f5b60fb4e9969f9e7bf3c (diff) | |
Add Introduction, Getting Started, and Features docs
Diffstat (limited to 'docs/pages/2-getting-started.md')
| -rw-r--r-- | docs/pages/2-getting-started.md | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/docs/pages/2-getting-started.md b/docs/pages/2-getting-started.md new file mode 100644 index 0000000..77503e9 --- /dev/null +++ b/docs/pages/2-getting-started.md @@ -0,0 +1,62 @@ +<h1 align="center">Getting Started</h1> + +## Create a New Project + +```bash +cargo new my-cli +cd my-cli +``` + +## Add Dependency + +Add the following to `Cargo.toml`: + +```toml +[dependencies.mingling] +version = "0.2" +features = [] +``` + +## Enable Features + +**Mingling** has all features disabled by default and does not provide an all-in-one feature like `full`. + +Some features will **directly affect the behavior of the entire lifecycle**, so you need to enable them as needed, for example: + +```toml +[dependencies.mingling] +version = "0.2" +features = [ + "parser", + "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. + +## Write the Basic Entry Point + +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! |
