summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-03-20 08:53:40 +0800
committer魏曹先生 <1992414357@qq.com>2026-03-20 08:53:40 +0800
commit552b7c26e9f151817328f0bb6461e96f6829c9f3 (patch)
tree95e01e8713b523a4983f4dd804f78eb54573416b
parente1f7bda5ab0c260c03d8789ed370d3adc89d5972 (diff)
Add windows path support in helpdoc_system_macros
-rw-r--r--Cargo.lock1
-rw-r--r--macros/helpdoc_system_macros/Cargo.toml1
-rw-r--r--macros/helpdoc_system_macros/src/lib.rs4
-rw-r--r--src/systems/comp/context.rs2
4 files changed, 7 insertions, 1 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 51796ef..6a8b29a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1041,6 +1041,7 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
name = "helpdoc_system_macros"
version = "0.1.0-dev"
dependencies = [
+ "just_fmt",
"proc-macro2",
"quote",
"syn",
diff --git a/macros/helpdoc_system_macros/Cargo.toml b/macros/helpdoc_system_macros/Cargo.toml
index c5c8483..39a58cf 100644
--- a/macros/helpdoc_system_macros/Cargo.toml
+++ b/macros/helpdoc_system_macros/Cargo.toml
@@ -7,6 +7,7 @@ version.workspace = true
proc-macro = true
[dependencies]
+just_fmt.workspace = true
proc-macro2.workspace = true
quote.workspace = true
syn.workspace = true
diff --git a/macros/helpdoc_system_macros/src/lib.rs b/macros/helpdoc_system_macros/src/lib.rs
index a9008bf..ce85f87 100644
--- a/macros/helpdoc_system_macros/src/lib.rs
+++ b/macros/helpdoc_system_macros/src/lib.rs
@@ -67,6 +67,10 @@ fn scan_directory(dir: &Path, entries: &mut Vec<(String, String)>, base_dir: &Pa
doc_name.to_string()
};
+ let full_doc_name = just_fmt::fmt_path::fmt_path(full_doc_name)
+ .unwrap()
+ .to_string_lossy()
+ .to_string();
entries.push((full_doc_name, lang.to_string()));
}
}
diff --git a/src/systems/comp/context.rs b/src/systems/comp/context.rs
index caa92e2..7fb8f43 100644
--- a/src/systems/comp/context.rs
+++ b/src/systems/comp/context.rs
@@ -1,4 +1,4 @@
-use clap::{Parser, command};
+use clap::Parser;
#[derive(Parser, Debug, Clone)]
#[command(author, version, about, long_about = None)]