Поддержка тем
This commit is contained in:
Mikan
2025-12-08 17:21:41 +03:00
parent c262bffb41
commit 8da965234c
3 changed files with 46 additions and 3 deletions

View File

@@ -9,7 +9,13 @@ import logging
logger = logging.getLogger(__name__)
def process_document(input_dir: Path, output_dir: Path, style_config_path: Path, template_path: Optional[Path] = None):
def process_document(input_dir: Path, output_dir: Path, style_config_path: Path, template_path: Optional[Path] = None, theme_name: Optional[str] = None):
if theme_name:
theme_path = Path("resources/themes") / f"{theme_name}.yaml"
if theme_path.exists():
style_config_path = theme_path
else:
logger.warning(f"Тема {theme_name} не найдена, используем стандартный стиль")
for doc_dir in input_dir.iterdir():
if not doc_dir.is_dir():
continue