"""본심 4가지 샘플: 이미지와 텍스트가 어우러지는 방식.""" from __future__ import annotations import asyncio, sys, datetime, base64 from pathlib import Path ROOT = Path(__file__).parent.parent sys.path.insert(0, str(ROOT)) async def main(): from src.slide_measurer import capture_slide_screenshot out_dir = ROOT / "data" / "runs" / f"core_samples_{datetime.datetime.now().strftime('%Y%m%d_%H%M%S')}" out_dir.mkdir(parents=True, exist_ok=True) img_path = Path("D:/ad-hoc/cel/public/assets/images/dx1.png") img_b64 = base64.b64encode(img_path.read_bytes()).decode() img_src = f"data:image/png;base64,{img_b64}" common_css = """ * { margin:0; padding:0; box-sizing:border-box; } .core { width: 767px; font-family: 'Pretendard Variable', sans-serif; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 14px 18px; overflow: hidden; word-break: keep-all; } .core-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; } .core-label { background: #1e293b; color: #ffffff; font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 4px; } .popup-link { font-size: 10px; color: #2563eb; font-weight: 700; cursor: pointer; text-decoration: underline; } .core-text { font-size: 12px; color: #1e293b; line-height: 1.75; } .bp { padding-left: 14px; text-indent: -14px; margin-bottom: 5px; } .bp::before { content: '•'; display: inline-block; width: 14px; text-indent: 0; color: #1e293b; font-weight: 700; } .sp { padding-left: 28px; text-indent: -14px; margin-bottom: 4px; font-size: 11px; color: #475569; } .sp::before { content: '◦'; display: inline-block; width: 14px; text-indent: 0; color: #64748b; } .core-text b { font-weight: 700; color: #1e293b; } .key-msg { background: #f0f9ff; border: 2px solid #bae6fd; border-radius: 6px; padding: 5px 12px; text-align: center; font-size: 11px; font-weight: 700; color: #0c4a6e; margin-top: 8px; clear: both; } .key-msg em { color: #dc2626; font-style: normal; font-weight: 900; } """ text_content = """