diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-07-10 16:23:18 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-07-10 16:26:13 +0800 |
| commit | abbabd9c55daa79b07cd9ba81037568958794a91 (patch) | |
| tree | 6bed622d2b500473669f64d6b73c75ba51668946 /docs | |
| parent | 73d0f0185f94a8733dfb5eb538298447ab8977b3 (diff) | |
chore(docs): rename dev-docs directory to dev
Update sidebar link for remove-r-print-macro to use full description
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/dev/README.md (renamed from docs/dev-docs/README.md) | 0 | ||||
| -rw-r--r-- | docs/dev/_sidebar.md (renamed from docs/dev-docs/_sidebar.md) | 2 | ||||
| -rw-r--r-- | docs/dev/index.html (renamed from docs/dev-docs/index.html) | 0 | ||||
| -rw-r--r-- | docs/dev/pages/abouts/.name (renamed from docs/dev-docs/pages/abouts/.name) | 0 | ||||
| -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/code-verify-system.md (renamed from docs/dev-docs/pages/abouts/code-verify-system.md) | 0 | ||||
| -rw-r--r-- | docs/dev/pages/issues/.name (renamed from docs/dev-docs/pages/issues/.name) | 0 | ||||
| -rw-r--r-- | docs/dev/pages/issues/remove-r-print-macro.md (renamed from docs/dev-docs/pages/issues/remove-r-print-macro.md) | 14 | ||||
| -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) | 0 | ||||
| -rw-r--r-- | docs/dev/pages/templates/.name (renamed from docs/dev-docs/pages/templates/.name) | 0 | ||||
| -rw-r--r-- | docs/dev/pages/templates/doc.md (renamed from docs/dev-docs/pages/templates/doc.md) | 0 |
12 files changed, 8 insertions, 8 deletions
diff --git a/docs/dev-docs/README.md b/docs/dev/README.md index a2eede9..a2eede9 100644 --- a/docs/dev-docs/README.md +++ b/docs/dev/README.md diff --git a/docs/dev-docs/_sidebar.md b/docs/dev/_sidebar.md index dd735c4..0c49615 100644 --- a/docs/dev-docs/_sidebar.md +++ b/docs/dev/_sidebar.md @@ -3,7 +3,7 @@ * [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) + * [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 diff --git a/docs/dev-docs/index.html b/docs/dev/index.html index e62268d..e62268d 100644 --- a/docs/dev-docs/index.html +++ b/docs/dev/index.html diff --git a/docs/dev-docs/pages/abouts/.name b/docs/dev/pages/abouts/.name index d5a4a33..d5a4a33 100644 --- a/docs/dev-docs/pages/abouts/.name +++ b/docs/dev/pages/abouts/.name 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-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-docs/pages/issues/.name b/docs/dev/pages/issues/.name index f99478d..f99478d 100644 --- a/docs/dev-docs/pages/issues/.name +++ b/docs/dev/pages/issues/.name 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..3de8f61 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**. @@ -20,7 +20,7 @@ macro_rules! my_println { r_println!("Custom: {}", format!($($arg)*)); }; } - + #[renderer] fn render_something(_p: ResultSomething) { // Although this function body has __renderer_inner_result injected, @@ -34,7 +34,7 @@ fn render_something(_p: ResultSomething) { my_println!("{}", box_val); // Compile error: cannot find __renderer_inner_result } ``` - + ## Deeper Issues I have to admit, this is an early design flaw. After re-examining the code, I found the problem goes beyond "can't be wrapped". @@ -58,11 +58,11 @@ fn render_something(prev: ResultSomething) -> RenderResult { result.println(prev.to_string()); // or write!(result, "{}", prev.to_string()); - + result // return here } ``` - + Clear boundaries — the entire rendering process is confined within the function body decorated by `#[help]` or `#[renderer]`, without introducing extra out-of-scope dependencies. The trade-off is slightly more boilerplate compared to the original approach. ### Option 2: Resource Injection @@ -73,11 +73,11 @@ fn render_something(prev: ResultSomething, result: &mut ResRenderResult) { result.println(prev.to_string()); // or write!(result, "{}", prev.to_string()); - + result // return here } ``` - + More flexible, but blurs the boundary between logic functions like `#[chain]` and rendering functions like `#[help]`. ### Preferred Direction 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..f524f42 100644 --- a/docs/dev-docs/pages/issues/the-shit-time.md +++ b/docs/dev/pages/issues/the-shit-time.md diff --git a/docs/dev-docs/pages/templates/.name b/docs/dev/pages/templates/.name index 1e1408c..1e1408c 100644 --- a/docs/dev-docs/pages/templates/.name +++ b/docs/dev/pages/templates/.name 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 |
