import os TARGET_DIR = "src/content/docs/szmgr" def leading_space(text: str) -> str: """Returns only the leading space of a line""" return " " * (len(text) - len(text.lstrip())) files = [f for f in os.listdir(TARGET_DIR) if f.endswith(".md")] for f in files: print(f"\t- {f}") lines = [] with open(os.path.join(TARGET_DIR, f), "r") as file: lines = file.readlines() dl_mode_active = False dl_indent = "" for i in range(len(lines) - 1): l = lines[i] l2 = lines[i+1] indent = leading_space(l) if "**⚠️ WARNING**\\" in l: lines[i] = indent + "> [!WARNING]\n" lines[i+1] = indent + "> " + l2.lstrip() elif "**💡 TIP**\\" in l: lines[i] = indent + "> [!TIP]\n" lines[i+1] = indent + "> " + l2.lstrip() elif "**📌 NOTE**\\" in l: lines[i] = indent + "> [!NOTE]\n" lines[i+1] = indent + "> " + l2.lstrip() elif "**❗ IMPORTANT**\\" in l: lines[i] = indent + "> [!IMPORTANT]\n" lines[i+1] = indent + "> " + l2.lstrip() if "