diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/_zh_CN/index.html | 2 | ||||
| -rw-r--r-- | docs/dev-docs/README.md | 15 | ||||
| -rw-r--r-- | docs/dev-docs/pages/abouts/.name | 1 | ||||
| -rw-r--r-- | docs/dev-docs/pages/issues/.name | 1 | ||||
| -rw-r--r-- | docs/dev-docs/pages/templates/.name | 1 | ||||
| -rw-r--r-- | docs/dev/README.md | 21 | ||||
| -rw-r--r-- | docs/dev/_sidebar.md (renamed from docs/dev-docs/_sidebar.md) | 14 | ||||
| -rw-r--r-- | docs/dev/index.html (renamed from docs/dev-docs/index.html) | 2 | ||||
| -rw-r--r-- | docs/dev/pages/abouts/.name | 1 | ||||
| -rw-r--r-- | docs/dev/pages/abouts/ai-translation-rule.md (renamed from docs/dev-docs/pages/abouts/ai-translation-rule.md) | 0 | ||||
| -rw-r--r-- | docs/dev/pages/abouts/ci.md | 71 | ||||
| -rw-r--r-- | docs/dev/pages/abouts/code-verify-system.md (renamed from docs/dev-docs/pages/abouts/code-verify-system.md) | 0 | ||||
| -rw-r--r-- | docs/dev/pages/abouts/nightly-features.md | 18 | ||||
| -rw-r--r-- | docs/dev/pages/issues/.name | 1 | ||||
| -rw-r--r-- | docs/dev/pages/issues/remove-r-print-macro.md (renamed from docs/dev-docs/pages/issues/remove-r-print-macro.md) | 12 | ||||
| -rw-r--r-- | docs/dev/pages/issues/the-mod-pathfinder.md (renamed from docs/dev-docs/pages/issues/the-mod-pathfinder.md) | 0 | ||||
| -rw-r--r-- | docs/dev/pages/issues/the-shit-time.md (renamed from docs/dev-docs/pages/issues/the-shit-time.md) | 10 | ||||
| -rw-r--r-- | docs/dev/pages/templates/.name | 1 | ||||
| -rw-r--r-- | docs/dev/pages/templates/doc.md (renamed from docs/dev-docs/pages/templates/doc.md) | 0 | ||||
| -rw-r--r-- | docs/doc.html | 2 |
20 files changed, 145 insertions, 28 deletions
diff --git a/docs/_zh_CN/index.html b/docs/_zh_CN/index.html index 7adaa98..ad21062 100644 --- a/docs/_zh_CN/index.html +++ b/docs/_zh_CN/index.html @@ -56,7 +56,7 @@ auto2top: true, loadSidebar: true, maxLevel: 0, - subMaxLevel: 3, + subMaxLevel: 0, search: { placeholder: "Search", noData: "No matches found.", diff --git a/docs/dev-docs/README.md b/docs/dev-docs/README.md deleted file mode 100644 index a2eede9..0000000 --- a/docs/dev-docs/README.md +++ /dev/null @@ -1,15 +0,0 @@ -<h1 align="center">Mingling Dev Docs</h1> - -<p align="center"> - Internal development documentation for the <b>Mingling</b> codebase — design notes, issue discussions, and architectural decisions. -</p> - -This site is separate from the [main helpdoc](https://mingling-rs.github.io/mingling/docs/doc.html). The helpdoc is user-facing: tutorials, feature guides, and how-to content for developers _using_ Mingling to build CLI applications. This dev-docs site is for developers _working on_ Mingling itself — understanding internal mechanisms, tracking unresolved problems, and recording design rationale. - -## What's here - -- **Issues** — Collected notes on known pain points, unresolved trade-offs, and feature gaps in the current implementation. - -## How this is different from GitHub Issues - -Mingling is hosted on [GitHub](https://github.com/mingling-rs/mingling), and the [Issues page](https://github.com/mingling-rs/mingling/issues) there is primarily for discussion. In contrast, an issue in this document exists only when it is being planned or actively worked on. diff --git a/docs/dev-docs/pages/abouts/.name b/docs/dev-docs/pages/abouts/.name deleted file mode 100644 index d5a4a33..0000000 --- a/docs/dev-docs/pages/abouts/.name +++ /dev/null @@ -1 +0,0 @@ -Abouts diff --git a/docs/dev-docs/pages/issues/.name b/docs/dev-docs/pages/issues/.name deleted file mode 100644 index f99478d..0000000 --- a/docs/dev-docs/pages/issues/.name +++ /dev/null @@ -1 +0,0 @@ -Issues diff --git a/docs/dev-docs/pages/templates/.name b/docs/dev-docs/pages/templates/.name deleted file mode 100644 index 1e1408c..0000000 --- a/docs/dev-docs/pages/templates/.name +++ /dev/null @@ -1 +0,0 @@ -Templates diff --git a/docs/dev/README.md b/docs/dev/README.md new file mode 100644 index 0000000..9289fcf --- /dev/null +++ b/docs/dev/README.md @@ -0,0 +1,21 @@ +<h1 align="center">Mingling Dev Docs</h1> + +<p align="center"> + Internal development documentation for the <b>Mingling</b> codebase — design notes, issue discussions, and architectural decisions. +</p> + +This site is separate from the [Helpdoc](https://mingling-rs.github.io/mingling/docs/doc.html). + +The helpdoc is user-facing: `tutorials`, `feature guides`, and `how-to content` for developers _using_ Mingling to build CLI applications. + +This dev-docs site is for developers **working on** Mingling itself — understanding internal mechanisms, tracking unresolved problems, and recording design rationale. + +## What's here + +- **Issues** — Collected notes on known pain points, unresolved trade-offs, and feature gaps in the current implementation. + +## How this is different from GitHub Issues + +Mingling is hosted on [GitHub](https://github.com/mingling-rs/mingling), and the [Issues page](https://github.com/mingling-rs/mingling/issues) there is primarily for discussion. + +In contrast, an issue in this document exists only when it is being planned or actively worked on. diff --git a/docs/dev-docs/_sidebar.md b/docs/dev/_sidebar.md index dd735c4..e303735 100644 --- a/docs/dev-docs/_sidebar.md +++ b/docs/dev/_sidebar.md @@ -1,10 +1,12 @@ - [Welcome!](README) -* Abouts - * [AI Translation Rule](pages/abouts/ai-translation-rule) - * [Markdown Code Verification System](pages/abouts/code-verify-system) -* Issues - * [remove-r-print-macro](pages/issues/remove-r-print-macro) +* ❓ Issues + * [Remove r_print! and r_println! Macros](pages/issues/remove-r-print-macro) * [The Mod Pathfinder](pages/issues/the-mod-pathfinder) * [Some Situations Where You'd Be Like "Shit!"](pages/issues/the-shit-time) -* Templates +* 💡 Abouts + * [AI Translation Rule](pages/abouts/ai-translation-rule) + * [About Mingling CI Process](pages/abouts/ci) + * [Markdown Code Verification System](pages/abouts/code-verify-system) + * [About Nightly Features](pages/abouts/nightly-features) +* 📄 Templates * [Helpdoc Template](pages/templates/doc) diff --git a/docs/dev-docs/index.html b/docs/dev/index.html index e62268d..1bfb5c5 100644 --- a/docs/dev-docs/index.html +++ b/docs/dev/index.html @@ -141,7 +141,7 @@ auto2top: true, loadSidebar: true, maxLevel: 0, - subMaxLevel: 3, + subMaxLevel: 0, search: { placeholder: "Search dev docs…", noData: "No matches found.", diff --git a/docs/dev/pages/abouts/.name b/docs/dev/pages/abouts/.name new file mode 100644 index 0000000..f2b936c --- /dev/null +++ b/docs/dev/pages/abouts/.name @@ -0,0 +1 @@ +💡 Abouts diff --git a/docs/dev-docs/pages/abouts/ai-translation-rule.md b/docs/dev/pages/abouts/ai-translation-rule.md index b1f93f6..b1f93f6 100644 --- a/docs/dev-docs/pages/abouts/ai-translation-rule.md +++ b/docs/dev/pages/abouts/ai-translation-rule.md diff --git a/docs/dev/pages/abouts/ci.md b/docs/dev/pages/abouts/ci.md new file mode 100644 index 0000000..3a93c1c --- /dev/null +++ b/docs/dev/pages/abouts/ci.md @@ -0,0 +1,71 @@ +<h1 align="center">About Mingling CI Process</h1> +<p align="center"> + CI workflow and local execution guide for Mingling +</p> + +Mingling's CI process is built into the project, with its execution logic located in `.run/src/bin/ci.rs`. You can run it locally via the `cargo ci` command, which produces the same results as the `CI` workflow in GitHub Actions. + +During development, you can run `cargo ci` at any time to verify that your code hasn't introduced regressions. + +## Running Locally + +An alias is defined in `.cargo/config.toml` at the project root: + +```toml +[alias] +ci = "run --manifest-path .run/Cargo.toml --bin ci --quiet --" +``` + +Simply execute: + +```bash +cargo ci +``` + +## CI Execution Flow + +`cargo ci` runs the following stages in order: + +### 1. Code Checking Stage (run by default, or individually via `--test-codes`) + +- **Scan and build all crates**: Recursively finds all `Cargo.toml` files in the project and runs `cargo build` for each crate in parallel. +- **Run Clippy on all crates**: Executes `cargo clippy ... -- -D warnings` in parallel; any warning will cause a failure. +- **Run unit tests for all crates**: Executes `cargo test` in parallel. + +### 2. Documentation and Example Checking Stage (run by default, or individually via `--test-docs`) + +- **Test all examples**: Runs the `test-examples` tool. +- **Verify Markdown code blocks compile**: Runs the `test-all-markdown-code` tool to check code blocks in all `*.md` files. See [ABOUT_CODE_VERIFY](docs/_ABOUT_CODE_VERIFY.md) for details. +- **Check if documentation is up to date**: Runs the following documentation refresh tools in sequence: + - `docs-code-box-fix` + - `docsify-sidebar-gen` + - `refresh-docs` + - `refresh-feature-mod` + - `sync-examples` +- Finally, runs `cargo fmt` to unify code formatting. + +### 3. File Normalization + +Runs `git add --renormalize .` to ensure file attributes such as line endings conform to the repository configuration. + +## Workspace Cleanliness and Temporary Commits + +To ensure reproducible CI results, `ci.rs` imposes strict requirements on the workspace state: + +- If the current workspace is not clean and `--dirty` has not been specified, the script will prompt whether to create a temporary commit: + - The commit message is `[DO NOT PUSH] CI TEMP [DO NOT PUSH]`. + - Use `-y` to auto-confirm without interaction. +- After CI finishes, the script automatically restores the workspace: + - First, `git reset --hard` discards all changes. + - If a temporary commit was created, it then runs `git reset --soft HEAD~1` and unstages everything, restoring the state to before CI started. +- If `--dirty` is specified, the temporary commit and the final cleanliness check are skipped. + +> **Warning**: `git reset --hard` is executed at the end of CI. If you use `--dirty`, ensure you have no unsaved important changes. + +## GitHub Actions Workflow + +`.github/workflows/ci.yml` defines the project's CI: + +- Triggered on `push` to the `main` branch. +- Runs `cargo ci` in parallel on `ubuntu-latest` and `windows-latest`. +- After CI passes, the `unreleased` tag is automatically moved to the latest commit on `main`. diff --git a/docs/dev-docs/pages/abouts/code-verify-system.md b/docs/dev/pages/abouts/code-verify-system.md index 61b66e8..61b66e8 100644 --- a/docs/dev-docs/pages/abouts/code-verify-system.md +++ b/docs/dev/pages/abouts/code-verify-system.md diff --git a/docs/dev/pages/abouts/nightly-features.md b/docs/dev/pages/abouts/nightly-features.md new file mode 100644 index 0000000..13b666e --- /dev/null +++ b/docs/dev/pages/abouts/nightly-features.md @@ -0,0 +1,18 @@ +<h1 align="center">About Nightly Features</h1> +<p align="center"> + Using nightly Rust features in Mingling +</p> + +**Mingling** uses some features that are only available in the `nightly` toolchain. This requires you to enable the `nightly` feature: + +```toml +[dependencies] +mingling = { version = "...", features = ["nightly"] } +``` + +## Features + +> [!WARNING] +> The following features can only be used with the nightly toolchain, and are only guaranteed to compile, not to be stable or production-ready. +> +> If you need a stable development experience, please **do not use** the `nightly` feature! diff --git a/docs/dev/pages/issues/.name b/docs/dev/pages/issues/.name new file mode 100644 index 0000000..b207fb4 --- /dev/null +++ b/docs/dev/pages/issues/.name @@ -0,0 +1 @@ +❓ Issues diff --git a/docs/dev-docs/pages/issues/remove-r-print-macro.md b/docs/dev/pages/issues/remove-r-print-macro.md index e5ef4a6..96f99ef 100644 --- a/docs/dev-docs/pages/issues/remove-r-print-macro.md +++ b/docs/dev/pages/issues/remove-r-print-macro.md @@ -1,4 +1,4 @@ -# Remove `r_print!` and `r_println!` Macros +<h1 align="center">Remove r_print! and r_println! Macros</h1> `r_print!` and `r_println!` are important macros in Mingling for use inside `#[help]` and `#[renderer]` functions, but their implementation is not clean: they implicitly introduce a `__renderer_inner_result` field. While this might look elegant at the API level, it is **incorrect** and even **objectionable**. @@ -85,3 +85,13 @@ More flexible, but blurs the boundary between logic functions like `#[chain]` an I lean toward **Option 1 (Explicit Return)**. There's no need to turn `RenderResult` into `ResRenderResult` as a global resource. As for rendering in logic functions like `#[chain]`, that should be handled by a separate system — not discussed here. + +## 🕘 Progress + +- [ ] In Progress + - [ ] Remove `r_println!` and `r_print!` macros + - [ ] Modify `#[renderer]` and `#[help]` macros, remove implicit injection + - [ ] Provide **no-return-value mode** and **RenderResult return value mode** for `#[renderer]` and `#[help]` macros + - [ ] Add new simplified syntax + - [ ] Update documentation and test cases, ensure **all pass** +- [ ] Complete diff --git a/docs/dev-docs/pages/issues/the-mod-pathfinder.md b/docs/dev/pages/issues/the-mod-pathfinder.md index 676251d..676251d 100644 --- a/docs/dev-docs/pages/issues/the-mod-pathfinder.md +++ b/docs/dev/pages/issues/the-mod-pathfinder.md diff --git a/docs/dev-docs/pages/issues/the-shit-time.md b/docs/dev/pages/issues/the-shit-time.md index f524f42..9d6c429 100644 --- a/docs/dev-docs/pages/issues/the-shit-time.md +++ b/docs/dev/pages/issues/the-shit-time.md @@ -83,6 +83,16 @@ fn desc_add() -> String { t!("cmd.add.desc") } +// Or + +#[completion(CMDAdd)] +fn desc_add(_ctx: &ShellContext) -> Suggest { + // If using rust_i18n + suggest{ + t!("cmd.add.desc") + } +} + // Collected and generated by `gen_program!()` // Generate something like get_dispatcher_desc(id: &ThisProgram) -> String // Match the corresponding function using enum values inside ThisProgram diff --git a/docs/dev/pages/templates/.name b/docs/dev/pages/templates/.name new file mode 100644 index 0000000..9e73889 --- /dev/null +++ b/docs/dev/pages/templates/.name @@ -0,0 +1 @@ +📄 Templates diff --git a/docs/dev-docs/pages/templates/doc.md b/docs/dev/pages/templates/doc.md index e8a9308..e8a9308 100644 --- a/docs/dev-docs/pages/templates/doc.md +++ b/docs/dev/pages/templates/doc.md diff --git a/docs/doc.html b/docs/doc.html index 783ccb4..a63fdd3 100644 --- a/docs/doc.html +++ b/docs/doc.html @@ -51,7 +51,7 @@ auto2top: true, loadSidebar: true, maxLevel: 0, - subMaxLevel: 3, + subMaxLevel: 0, search: { placeholder: "Search", noData: "No matches found.", |
