feat: Add core rules

This commit is contained in:
2026-06-06 13:03:00 +00:00
parent c75cd188c1
commit 75c6ab9975
583 changed files with 13580 additions and 50 deletions

22
scripts/add_css.py Normal file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env python3
"""Prepend a book-page.css link to every HTML file in html2/."""
from pathlib import Path
CSS_LINK = '<link rel="stylesheet" href="book-page.css">\n'
HTML2_DIR = Path(__file__).parent.parent / "html2"
def main():
files = sorted(HTML2_DIR.glob("*.html"), key=lambda p: int(p.stem) if p.stem.isdigit() else -1)
for path in files:
content = path.read_text(encoding="utf-8")
if CSS_LINK.strip() not in content:
path.write_text(CSS_LINK + content, encoding="utf-8")
print(f"updated {path.name}")
else:
print(f"skipped {path.name} (already has link)")
if __name__ == "__main__":
main()