Initial commit: yu-zhi-ran platform with automation integration
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
在 Markdown 的 H2 标题前插入分隔线,第一个除外
|
||||
"""
|
||||
|
||||
MD_PATH = "/root/.openclaw/workspaces/yzr-yxl/projects/yu-zhi-ran/content/published/2026-04-14-上海阳台种菜一年/final-article.md"
|
||||
|
||||
with open(MD_PATH, "r", encoding="utf-8") as f:
|
||||
lines = f.readlines()
|
||||
|
||||
new_lines = []
|
||||
first_h2_seen = False
|
||||
for line in lines:
|
||||
if line.startswith("## "):
|
||||
if first_h2_seen:
|
||||
new_lines.append("---\n\n")
|
||||
else:
|
||||
first_h2_seen = True
|
||||
new_lines.append(line)
|
||||
|
||||
with open(MD_PATH, "w", encoding="utf-8") as f:
|
||||
f.writelines(new_lines)
|
||||
|
||||
print(f"✅ 已处理 {MD_PATH}")
|
||||
Reference in New Issue
Block a user