[AI]
MVP готов
This commit is contained in:
@@ -8,6 +8,8 @@ app = typer.Typer()
|
||||
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@app.command()
|
||||
def convert(
|
||||
input_dir: Path = typer.Option(..., "--input", "-i", help="Папка с исходниками"),
|
||||
@@ -16,9 +18,24 @@ def convert(
|
||||
template: Optional[Path] = typer.Option(None, "--template", "-t", help="Шаблон .dotx"),
|
||||
theme: Optional[str] = typer.Option(None, "--theme", "-T", help="Название темы (gost, academic...)"),
|
||||
plugins_dir: Optional[Path] = typer.Option(None, "--plugins", "-p", help="Папка с плагинами"),
|
||||
dry_run: bool = typer.Option(False, "--dry-run", help="Только показать, что будет сделано"),
|
||||
quiet: bool = typer.Option(False, "--quiet", "-q", help="Не выводить логи"),
|
||||
verbose: bool = typer.Option(False, "--verbose", "-v", help="Включить отладочные сообщения"),
|
||||
):
|
||||
log_level = logging.DEBUG if verbose else logging.INFO
|
||||
if quiet:
|
||||
log_level = logging.WARNING
|
||||
elif verbose:
|
||||
log_level = logging.DEBUG
|
||||
else:
|
||||
log_level = logging.INFO
|
||||
|
||||
logging.basicConfig(level=log_level, format='%(levelname)s: %(message)s')
|
||||
|
||||
if dry_run:
|
||||
logger.info("Режим --dry-run: файлы не будут созданы")
|
||||
for doc_dir in input_dir.iterdir():
|
||||
if doc_dir.is_dir() and (doc_dir / "document.md").exists():
|
||||
logger.info(f"Будет обработан: {doc_dir.name}")
|
||||
return
|
||||
|
||||
process_document(input_dir, output_dir, style_config, template, theme, plugins_dir)
|
||||
Reference in New Issue
Block a user