From 8fb438873188ccc3ab376aeb42ef13a88296bb82 Mon Sep 17 00:00:00 2001 From: liuwei Date: Wed, 4 Jun 2025 11:55:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=B4=E6=97=B6=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/markdown_to_image.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/markdown_to_image.py b/utils/markdown_to_image.py index 9957acb..f39ec1d 100644 --- a/utils/markdown_to_image.py +++ b/utils/markdown_to_image.py @@ -6,6 +6,8 @@ from playwright.async_api import async_playwright import os import asyncio +from loguru import logger + # linux 下需要安装字体 # sudo apt-get install -y fonts-noto-cjk fonts-noto-cjk-extra @@ -240,8 +242,7 @@ async def convert_md_str_to_image(md_content, output_image): temp_html = f"temp_output_{timestamp}.html" md_str_to_html(md_content, temp_html) await html_to_image(temp_html, output_image) - os.remove(temp_html) - print(f"图片已生成:{output_image}") + logger.debug(f"图片已生成:{output_image}") return os.path.abspath(output_image)