Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Obsidian 项目打包导出器.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ def get_links(filename: str):
if not os.path.isfile(filename):
return []

# 新增文件类型过滤逻辑
allowed_extensions = ['.md', '.txt'] # 允许处理的文件类型
file_ext = os.path.splitext(filename)[1].lower()
if file_ext not in allowed_extensions:
return [] # 直接跳过非文本文件

try:
with open(filename, 'r', encoding='utf-8') as f:
note = f.read()
Expand Down Expand Up @@ -306,4 +312,4 @@ def interactive_mode():
linked_count = len(target_notes) - seed_count
print(f"📊 统计: {seed_count} 个种子文件 + {linked_count} 个关联文件")
print(f'创建新知识库在: {VAULT_DIR}/')
make_new_vault(target_notes)
make_new_vault(target_notes)