File size: 472 Bytes
1b141db
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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)