Part of epic: #30
Depends on: #33 (HTML render must exist first)
What
Add render_png() method to TearsheetGenerator that takes a headless screenshot of the HTML tearsheet and saves it as a 1200x900px PNG. This image is embedded directly in the README as the primary demo artifact — a recruiter sees the output quality before running a single line of code.
Implementation options (choose one)
Option A — playwright (preferred)
def render_png(self, output_path: str) -> None:
from playwright.sync_api import sync_playwright
html = self.render_html()
with sync_playwright() as p:
browser = p.chromium.launch()
page = browser.new_page(viewport={'width': 1200, 'height': 900})
page.set_content(html)
page.screenshot(path=output_path, full_page=False)
browser.close()
Option B — selenium (fallback if playwright not available)
Acceptance Criteria
Part of epic: #30
Depends on: #33 (HTML render must exist first)
What
Add
render_png()method toTearsheetGeneratorthat takes a headless screenshot of the HTML tearsheet and saves it as a 1200x900px PNG. This image is embedded directly in the README as the primary demo artifact — a recruiter sees the output quality before running a single line of code.Implementation options (choose one)
Option A — playwright (preferred)
Option B — selenium (fallback if playwright not available)
Acceptance Criteria
render_png(path)saves a 1200x900px PNG without manual browser interaction/outputs/demo/tearsheet_AAPL.pngembed works on GitHubplaywrightorseleniumadded torequirements-dev.txt(not main, since it's optional)