import logging import os import re import shutil import subprocess from http.server import HTTPServer, SimpleHTTPRequestHandler from pathlib import Path import typer from ruff.__main__ import find_ruff_bin logging.basicConfig(level=logging.INFO) mkdocs_name = "mkdocs.yml" docs_path = Path("docs") en_docs_path = Path("") app = typer.Typer() @app.callback() def callback() -> None: # For MacOS with Cairo os.environ["DYLD_FALLBACK_LIBRARY_PATH"] = "/opt/homebrew/lib" def generate_readme_content() -> str: en_index = en_docs_path / "docs" / "index.md" content = en_index.read_text("utf-8") match_pre = re.search(r"\n\n", content) if not match_pre: raise RuntimeError("Couldn't find pre section (