diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-06-21 18:33:32 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-06-21 18:33:32 +0800 |
| commit | 232f31c6649e6348a5b0b64362f185f7f4db1dc0 (patch) | |
| tree | 81784c32ff9ae75d0a27a0d0e7b7eb2d0aaf9bbe /docs/pages/1-getting-started.md | |
| parent | 90f563d7bbcbea98ee966bfb62a3e4a942e19c64 (diff) | |
Add intro content and merge getting started page
Diffstat (limited to 'docs/pages/1-getting-started.md')
| -rw-r--r-- | docs/pages/1-getting-started.md | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/docs/pages/1-getting-started.md b/docs/pages/1-getting-started.md new file mode 100644 index 0000000..4832191 --- /dev/null +++ b/docs/pages/1-getting-started.md @@ -0,0 +1,69 @@ +<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!(); +``` + +> [!IMPORTANT] +> Almost all Rust code blocks in the documentation have been compiled through the CI pipeline and are guaranteed to be usable. +> +> However, code blocks starting with `// NOT VERIFIED` have **not been verified**. +> +> Want to know which `*.md` files have been compiled? Check [`verified-docs.toml`](https://github.com/mingling-rs/mingling/blob/main/verified-docs.toml) + +## Verify Compilation + +```plaintext +~# cargo check +``` + +--- + +Once everything is good, start building! |
