{escape(record.question)}
Answer: {escape(record.answer)}
{options} {solution}"""HTML export for visual inspection of MathVision-like records.""" from __future__ import annotations from html import escape from pathlib import Path from mathvision_explorer.dataset import MathVisionRecord def export_html(records: list[MathVisionRecord], output: Path) -> None: """Write a standalone HTML gallery for records.""" output.parent.mkdir(parents=True, exist_ok=True) cards = "\n".join(_render_card(record, output_dir=output.parent) for record in records) html = f"""
Options: {escape(', '.join(record.options))}
" solution = "" if record.solution: solution = f"{escape(record.solution)}
" return f"""Answer: {escape(record.answer)}
{options} {solution}