diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-07-09 20:50:10 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-07-09 20:57:26 +0800 |
| commit | 52f478d71af90691a9e242d926b25d125e146ce8 (patch) | |
| tree | 42d2c4d8a50023a625047071f29cb15219355ed7 /docs/dev-docs | |
| parent | 3de8d5b41c49019f6c45efb874019de7009f2de7 (diff) | |
docs(sidebar): rename code-verify-system link to Markdown Code
Verification System
Diffstat (limited to 'docs/dev-docs')
| -rw-r--r-- | docs/dev-docs/_sidebar.md | 2 | ||||
| -rw-r--r-- | docs/dev-docs/pages/abouts/ai-translation-rule.md | 44 | ||||
| -rw-r--r-- | docs/dev-docs/pages/abouts/code-verify-system.md | 28 | ||||
| -rw-r--r-- | docs/dev-docs/pages/issues/the-mod-pathfinder.md | 10 | ||||
| -rw-r--r-- | docs/dev-docs/pages/issues/the-shit-time.md | 14 | ||||
| -rw-r--r-- | docs/dev-docs/pages/templates/doc.md | 8 |
6 files changed, 53 insertions, 53 deletions
diff --git a/docs/dev-docs/_sidebar.md b/docs/dev-docs/_sidebar.md index 57b1911..acdb46f 100644 --- a/docs/dev-docs/_sidebar.md +++ b/docs/dev-docs/_sidebar.md @@ -1,7 +1,7 @@ - [Welcome!](README) * Abouts * [AI Translation Rule](pages/abouts/ai-translation-rule) - * [code-verify-system](pages/abouts/code-verify-system) + * [Markdown Code Verification System](pages/abouts/code-verify-system) * Issues * [The Mod Pathfinder](pages/issues/the-mod-pathfinder) * [Some Situations Where You'd Be Like "Shit!"](pages/issues/the-shit-time) diff --git a/docs/dev-docs/pages/abouts/ai-translation-rule.md b/docs/dev-docs/pages/abouts/ai-translation-rule.md index e880964..b1f93f6 100644 --- a/docs/dev-docs/pages/abouts/ai-translation-rule.md +++ b/docs/dev-docs/pages/abouts/ai-translation-rule.md @@ -59,58 +59,58 @@ This is to keep git diffs friendly _(only modify parts that have truly changed)_ ```markdown # Translation Style Guide - + ## 1. Tone & Voice - + ### Preserve original tone - + Maintain the author's attitude, formality, and emotional register exactly as in the source. - + ### Synonymous substitution - + Use words with close or equivalent meaning where direct translation is awkward or unnatural. - + ## 2. Vocabulary & Abbreviation - + ### Abbreviation - + Apply standard English abbreviations (e.g., _info_ for information, _dept_ for department) to avoid overlong words, but only when clarity is not sacrificed. - + ### Concise expression - + Prefer shorter, more common alternatives (e.g., _use_ over _utilize_, _help_ over _facilitate_) unless the original tone demands formality. - + ## 3. Structural Rules - + ### Paragraph integrity - + Keep the original paragraph breaks and line spacing. - + ### Tag preservation - + Any inline Markdown formatting (bold, italic, code, links, lists) must be replicated exactly in translation. - + ### Example - + - Before: “请保持专业语气,但避免使用过长的学术词汇。” - After: “Keep a prof. tone, but avoid long academic words.” - + ### Minimal diff - + When translating or syncing English content against a known Chinese original, if the Chinese original's meaning is extremely close to the current English meaning, do not modify the English text. This is to keep git diffs friendly _(only modify parts that have truly changed)_. - + ## 4. Exceptions - + - If a term has no common abbreviation, use the full word. - If preserving tone requires a longer phrase, prioritize tone over brevity. ``` - + <p align="center" style="font-size: 0.85em; color: gray;"> Written by @Weicao-CatilGrass </p> diff --git a/docs/dev-docs/pages/abouts/code-verify-system.md b/docs/dev-docs/pages/abouts/code-verify-system.md index 59b98cb..61b66e8 100644 --- a/docs/dev-docs/pages/abouts/code-verify-system.md +++ b/docs/dev-docs/pages/abouts/code-verify-system.md @@ -14,11 +14,11 @@ You can also test a single file via command-line arg: ```sh ./run-tools.sh test-all-markdown-code docs/pages/1-getting-started.md ``` - + ```powershell .\run-tools.ps1 test-all-markdown-code docs/pages/1-getting-started.md ``` - + ## Default Rules Every verified ` ```rust ` code block gets the following injected automatically at compile time — no need to write them explicitly in the block: @@ -82,7 +82,7 @@ Each block (or each dedup-hash group) gets its own Cargo project: └── src/ └── main.rs ``` - + ### 3. Build Verification Compiled with `cargo build --release`, stderr inherited to the terminal for real-time progress. @@ -118,7 +118,7 @@ Marks the block **not to be compiled**. Use for illustrative snippets that can't // This block is illustrative only, won't be compiled fn placeholder() {} ``` - + ### `// BUILD TIME` Marks the block as a `build.rs` script instead of `src/main.rs`. The block code is wrapped in `fn main() { }` and written to `build.rs`. A stub `fn main() {}` is generated for `src/main.rs`. @@ -128,7 +128,7 @@ Marks the block as a `build.rs` script instead of `src/main.rs`. The block code // Features: ["builds", "pathf"] analyze_and_build_type_mapping().unwrap(); ``` - + ### `// Features: [...]` Declares the mingling crate features needed by this block, as a JSON string array. These features are written into `Cargo.toml`'s `[dependencies]`. @@ -136,7 +136,7 @@ Declares the mingling crate features needed by this block, as a JSON string arra ```rust // Features: ["full", "serde"] ``` - + ### `// Dependencies:` Declares external crate deps needed by the block. After `// Dependencies:`, each dep goes on one line: `// crate_name = "version"`. @@ -146,7 +146,7 @@ Declares external crate deps needed by the block. After `// Dependencies:`, each // serde = "1" // clap = "4" ``` - + > [!TIP] > > **Special handling**: @@ -172,7 +172,7 @@ This is useful when you want to show only the core logic while keeping the block @@@// This line is hidden but still compiled @@@fn setup() { /* hidden boilerplate */ } ``` - + ### How it works | Stage | Handling | @@ -216,23 +216,23 @@ Use `@@@` for: // Example code ... ``` ```` - + The above block compiles equivalently to: ```rust #![allow(dead_code)] #![allow(unused)] - + #[allow(unused_imports)] use mingling::prelude::*; - + // Example code ... - + fn main() {} - + mingling::macros::gen_program!(); ``` - + `Cargo.toml` will contain: ```toml diff --git a/docs/dev-docs/pages/issues/the-mod-pathfinder.md b/docs/dev-docs/pages/issues/the-mod-pathfinder.md index 5f8c902..676251d 100644 --- a/docs/dev-docs/pages/issues/the-mod-pathfinder.md +++ b/docs/dev-docs/pages/issues/the-mod-pathfinder.md @@ -27,13 +27,13 @@ mod sub { mingling::macros::pack!(ResultMyName = String); // directly creates ..::sub::ResultMyName } ``` - + There are a few exceptions, such as the implicit Dispatcher provided by `extra_macros`, but these can be inferred from the node name: ```rust dispatcher!("remote.add"); // although the type is unknown, we can infer CMDRemoteAdd and EntryRemoteAdd ``` - + And also `#[program_setup]`: ```rust @@ -42,7 +42,7 @@ fn custom_setup(program: &mut Program<ThisProgram>) { program.with_dispatchers((CMD1, CMD2, CMD3, CMD4, CMD5)); } ``` - + ## Pathf Output Format Uses TOML key-value pairs, formatted as follows: @@ -50,13 +50,13 @@ Uses TOML key-value pairs, formatted as follows: ```toml ResultRemoteAdd = "crate::mymod::ResultRemoteAdd" ``` - + Recommended storage location is under the target directory: ``` /target/{target}/{crate-name}/type-mapping.toml ``` - + ## Other Issues This solution is limited to Mingling's own syntax system. If types like `dispatcher!`, `pack!` are indirectly expanded through macros, the analyzer will not be able to discover them. diff --git a/docs/dev-docs/pages/issues/the-shit-time.md b/docs/dev-docs/pages/issues/the-shit-time.md index 77a8af9..f524f42 100644 --- a/docs/dev-docs/pages/issues/the-shit-time.md +++ b/docs/dev-docs/pages/issues/the-shit-time.md @@ -23,7 +23,7 @@ completion: --help -h --- Display helps --version -V --- Display versions ``` - + Currently, there is no workaround. Ideal solution: @@ -34,7 +34,7 @@ fn complete(ctx: &ShellContext) -> Suggest { // ... } ``` - + --- ## Why can't I register descriptions for commands? @@ -50,7 +50,7 @@ mycmd <tab> completion: add rm list <--- You cannot register descriptions for commands ``` - + Expected behavior: ``` @@ -60,7 +60,7 @@ add --- Add something rm --- Remove something list --- List something ``` - + Ideal solution: ```rust @@ -70,11 +70,11 @@ dispatcher! { /// Add Something <--- How to i18n? "add", CMDAdd => EntryAdd } - + // Ideally, it should satisfy the following two conditions: // 1. No need to use `with_dispatcher`, because `with_dispatcher` is disabled in `dispatch_tree` mode // 2. Must be able to accept String or &str at runtime - + // Current idea #[inline(always)] #[dispatcher_desc(EntryAdd)] @@ -82,7 +82,7 @@ fn desc_add() -> String { // If using rust_i18n 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-docs/pages/templates/doc.md b/docs/dev-docs/pages/templates/doc.md index a105af7..e8a9308 100644 --- a/docs/dev-docs/pages/templates/doc.md +++ b/docs/dev-docs/pages/templates/doc.md @@ -10,19 +10,19 @@ When writing a Helpdoc, you can use the following template to draft <p align="center"> Description </p> - + Content here - + <!-- To display playable code if needed --> <!--<iframe src="../play/play.html?tur=default.md&title=Title" height="600px"/>--> - + <p align="center" style="font-size: 0.85em; color: gray;"> Written by @Your-Name </p> ``` - + <p align="center" style="font-size: 0.85em; color: gray;"> Written by @Weicao-CatilGrass </p> |
