from __future__ import annotations import tempfile from pathlib import Path def write_markdown_export(content: str, project_name: str = "site-intelligence") -> str: safe = "".join(ch.lower() if ch.isalnum() else "-" for ch in project_name).strip("-") safe = safe or "site-intelligence" out_dir = Path(tempfile.mkdtemp(prefix="sis_export_")) path = out_dir / f"{safe}-site-analysis.md" path.write_text(content, encoding="utf-8") return str(path)