유형 B 파이프라인 연결: block_assembler type B 조립 + zone 기반 전환 시작
- block_assembler: _assemble_slide_html_type_b 추가 (filled/after용 HTML 생성) - fit_verifier: redistribute()가 ROLE_ZONE_MAP 대신 containers zone 사용 - renderer: render_slide_from_html()에 zone 기반 높이 탐색 추가 - pipeline: 팝업 HTML CSS를 콘텐츠 유형별(table/list/text) 분기 - run_from_stage1b: MDX 파일 하드코딩 제거 + layout_template 전달 추가 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -22,13 +22,8 @@ async def main(run_dir: str):
|
||||
|
||||
# Stage 1B context 로드
|
||||
ctx_json = json.loads((run / "stage_1b_context.json").read_text(encoding="utf-8"))
|
||||
# MDX 원본: samples에서 직접 읽기 (최신 원본 사용)
|
||||
samples_dir = Path(__file__).parent.parent / "samples"
|
||||
mdx_file = samples_dir / "mdx" / "01. 건설산업 DX의 올바른 이해(0127).mdx"
|
||||
if mdx_file.exists():
|
||||
raw_content = mdx_file.read_text(encoding="utf-8")
|
||||
else:
|
||||
raw_content = ctx_json.get("raw_content", "")
|
||||
# MDX 원본: context에서 가져옴 (어떤 MDX든 대응)
|
||||
raw_content = ctx_json.get("raw_content", "")
|
||||
|
||||
# Stage 1A 결과를 manual_layout으로 전달 (Stage 1A 스킵)
|
||||
# page_structure가 {"roles": {...}} 형태이면 roles 안쪽을 직접 전달
|
||||
@@ -41,9 +36,11 @@ async def main(run_dir: str):
|
||||
"page_structure": ps,
|
||||
"core_message": ctx_json.get("analysis", {}).get("core_message", ""),
|
||||
"title": ctx_json.get("analysis", {}).get("title", ""),
|
||||
"layout_template": ctx_json.get("analysis", {}).get("layout_template", "A"),
|
||||
}
|
||||
|
||||
print(f"=== Stage 1B 데이터 고정: {run.name} ===")
|
||||
layout = manual_layout.get("layout_template", "A")
|
||||
print(f"=== Stage 1B 데이터 고정: {run.name} (유형 {layout}) ===")
|
||||
print(f" topics: {len(ctx_json['topics'])}개")
|
||||
for t in ctx_json["topics"]:
|
||||
print(f" 꼭지{t['id']}: {t['title']} (st={len(t.get('structured_text',''))}자)")
|
||||
@@ -51,8 +48,8 @@ async def main(run_dir: str):
|
||||
# pipeline.py의 generate_slide() 호출
|
||||
from src.pipeline import generate_slide
|
||||
|
||||
# 이미지 base_path: samples/images/
|
||||
base_path = str(samples_dir / "images")
|
||||
# 이미지 base_path: context에서 가져옴
|
||||
base_path = ctx_json.get("base_path", "")
|
||||
async for event in generate_slide(raw_content, manual_layout=manual_layout, base_path=base_path):
|
||||
ev_type = event.get("event", "")
|
||||
ev_data = event.get("data", "")
|
||||
|
||||
Reference in New Issue
Block a user