-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
26 lines (23 loc) · 848 Bytes
/
Copy pathMakefile
File metadata and controls
26 lines (23 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
.PHONY: md-padding list-md
# Find all Markdown and MDX files, excluding node_modules, build, and skills directories
MD_FILES := $(shell find . \( -name "*.md" -o -name "*.mdx" \) \
-not -path "./node_modules/*" \
-not -path "./build/*" \
-not -path "./skills/*")
# 主命令:格式化所有 Markdown 文件
md-padding:
@echo "正在处理 $(words $(MD_FILES)) 个 Markdown 文件..."
@for file in $(MD_FILES); do \
echo "处理: $$file"; \
npx md-padding -i "$$file" \
--ignore-patterns '<SponsorIframe[\s\S]*?\/>' \
--ignore-patterns ':::.*[\s\S]*?:::' || echo "警告: $$file 处理失败"; \
done
@echo "✅ 全部处理完成!"
# 显示将被处理的文件列表
list-md:
@echo "将处理以下 Markdown 文件:"
@for file in $(MD_FILES); do \
echo " - $$file"; \
done
@echo "总计: $(words $(MD_FILES)) 个文件"