From 4a15618080c2b0fc97710b42b9245c5f382e67e6 Mon Sep 17 00:00:00 2001 From: Artiprocher Date: Wed, 3 Dec 2025 19:36:49 +0800 Subject: [PATCH] update doc --- examples/dev_tools/fix_path.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/examples/dev_tools/fix_path.py b/examples/dev_tools/fix_path.py index 0e6ef24..bfd1733 100644 --- a/examples/dev_tools/fix_path.py +++ b/examples/dev_tools/fix_path.py @@ -26,11 +26,18 @@ def fix_path(doc_root_path): context = read_file(file) matches = pattern.findall(context) + edited = False for match in matches: target = "](" + file_map[match.split("/")[-1].replace("](", "")] context = context.replace(match, target) - print(match, target) + if target != match: + print(match, target) + edited = True + print(file, match, target) - with open(file, "w", encoding="utf-8") as f: - f.write(context) + if edited: + with open(file, "w", encoding="utf-8") as f: + f.write(context) +fix_path("doc/zh") +fix_path("doc/en") \ No newline at end of file