Skip to content

Commit

Permalink
Update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangdingding committed Sep 20, 2024
1 parent a043373 commit 963be3b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
- [常见问题回答(FAQ)](/FAQ2022.md)
- 发版说明
<!-- 发版说明开始 -->
- [v3.161.1](release_notes/v3.161.1.md)
- [v3.160.3](release_notes/v3.160.3.md)
- [v3.160.2](release_notes/v3.160.2.md)
- [v3.161.1](/release_notes/v3.161.1.md)
- [v3.160.3](/release_notes/v3.160.3.md)
- [v3.160.2](/release_notes/v3.160.2.md)
<!-- 发版说明结束 -->
2 changes: 1 addition & 1 deletion scripts/merge_by_toc.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
for line in fp:
if not in_toc and not line.startswith("<!-- "):
in_toc = True
elif in_toc and not line.startswith('#') and line.strip():
elif in_toc and not line.startswith('#') and line.strip() and not line.lstrip().startswith("<!--"):
## get level from space length
level_space_str = level_pattern.findall(line)[0][:-1]
level = len(level_space_str) // 2 + 1 ## python divide get integer
Expand Down
2 changes: 1 addition & 1 deletion scripts/update_toc_with_release_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
release_notes_files = semver_valid_release_notes_files + semver_invalid_release_notes_files

# 构建发版说明的 markdown 链接列表
release_notes_links = '\n'.join([f"- [{file.replace('.md', '')}]({release_notes_dir}/{file})" for file in release_notes_files])
release_notes_links = '\n'.join([f"- [{file.replace('.md', '')}](/{release_notes_dir}/{file})" for file in release_notes_files])

# 读取 toc 内容
with open(toc_path, 'r', encoding='utf-8') as toc_file:
Expand Down

0 comments on commit 963be3b

Please sign in to comment.