aboutsummaryrefslogtreecommitdiff
path: root/dev_tools/src/bin/docs-code-box-fix.rs
diff options
context:
space:
mode:
authorWeicao-CatilGrass <1992414357@qq.com>2026-05-09 14:31:42 +0800
committerWeicao-CatilGrass <1992414357@qq.com>2026-05-09 14:51:14 +0800
commitf5cdf5cc7c3bd434ff7a88c73b33f96c4d3b6562 (patch)
treecb62ded889ad8cd0eafb43c94e2085a0416d22b2 /dev_tools/src/bin/docs-code-box-fix.rs
parentc0a29ccd2cd56e75c2b422b3cd9ca65d76a554da (diff)
Add CI tooling and cargo alias `ci`
Diffstat (limited to 'dev_tools/src/bin/docs-code-box-fix.rs')
-rw-r--r--dev_tools/src/bin/docs-code-box-fix.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/dev_tools/src/bin/docs-code-box-fix.rs b/dev_tools/src/bin/docs-code-box-fix.rs
index db97592..21d2cce 100644
--- a/dev_tools/src/bin/docs-code-box-fix.rs
+++ b/dev_tools/src/bin/docs-code-box-fix.rs
@@ -1,6 +1,8 @@
use std::fs;
use std::path::Path;
+use tools::println_cargo_style;
+
/// Docsify code blocks require that blank lines before and after code blocks are not completely empty,
/// but must contain at least one space, otherwise code block rendering will have issues.
///
@@ -9,7 +11,7 @@ use std::path::Path;
const DOCS_DIR: &str = "./docs";
fn main() {
- println!("Fixing code box empty lines in docs/**/*.md ...");
+ println_cargo_style!("Fixing: code box empty lines in docs/**/*.md ...");
let repo_root = find_git_repo().expect("Cannot find git repo root");
let docs_dir = repo_root.join(DOCS_DIR);
@@ -32,15 +34,16 @@ fn main() {
let new_content = fix_code_box_empty_lines(&content);
if new_content != content {
fs::write(path, &new_content).unwrap();
- println!(" Fixed: {}", path.display());
+ println_cargo_style!("Fixed: {}", path.display());
fixed_count += 1;
}
file_count += 1;
});
- println!(
- "Done. Scanned {} files, fixed {} files.",
- file_count, fixed_count
+ println_cargo_style!(
+ "Done: Scanned {} files, fixed {} files.",
+ file_count,
+ fixed_count
);
}