This commit is contained in:
Team3
2026-06-06 02:26:42 +02:00
parent a8fbf83059
commit 18bb18bf4a
30 changed files with 1184 additions and 4880 deletions

View File

@@ -1,15 +1,30 @@
import re
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 _safe(name: str) -> str:
return name.replace("/", "_").replace("\x00", "")
def final_html_path(topic: str, format_name: str) -> Path:
return STORAGE_DIR / "html" / f"{safe_basename(topic, format_name)}.html"
def guide_content_path(topic: str, format_name: str) -> Path:
return STORAGE_DIR / "guides" / f"{_safe(topic)} - {format_name}.json"
def bausteine_path(topic: str) -> Path:
return STORAGE_DIR / "bausteine" / f"{_safe(topic)}.md"
def bausteine_topics() -> list[str]:
"""Themen, für die eine finale Baustein-Datei existiert (ohne Zwischendateien)."""
bdir = STORAGE_DIR / "bausteine"
if not bdir.is_dir():
return []
return [
p.stem for p in bdir.glob("*.md")
if not re.search(r"\.(recherche-\d+|auswahl)$", p.stem)
]
def project_dir(name: str) -> Path: