17 lines
431 B
Python
17 lines
431 B
Python
from pathlib import Path
|
|
|
|
from config import STORAGE_DIR, PROJECTS_DIR
|
|
|
|
|
|
def safe_basename(topic: str, format_name: str) -> str:
|
|
clean = topic.replace("/", "_").replace("\x00", "")
|
|
return f"{clean} - {format_name}"
|
|
|
|
|
|
def final_html_path(topic: str, format_name: str) -> Path:
|
|
return STORAGE_DIR / "html" / f"{safe_basename(topic, format_name)}.html"
|
|
|
|
|
|
def project_dir(name: str) -> Path:
|
|
return PROJECTS_DIR / name
|