import os import re base_path = r'E:\Wiki\2nd\10_Wiki\Topics' empty_files = [] def is_empty_template(content): # Check if Summary section is basically empty summary_match = re.search(r'## ๐Ÿ“Œ ํ•œ ์ค„ ํ†ต์ฐฐ \(The Karpathy Summary\)\n>\s*\n', content) # Check if Content section is basically empty content_match = re.search(r'## ๐Ÿ“– ๊ตฌ์กฐํ™”๋œ ์ง€์‹ \(Synthesized Content\)\s*## โš ๏ธ ๋ชจ์ˆœ', content, re.DOTALL) if summary_match and content_match: return True return False for root, dirs, files in os.walk(base_path): for f in files: if f.endswith('.md'): file_path = os.path.join(root, f) if len(file_path) > 240: continue try: with open(file_path, 'r', encoding='utf-8', errors='ignore') as f_obj: content = f_obj.read() if is_empty_template(content): empty_files.append(file_path) except: pass print(f"Found {len(empty_files)} empty template files.") for f in empty_files[:50]: print(f"{f}")