Skip to content

feat: embed markdown images in PDF and add H2 page breaks#2

Merged
kevinjourdain-improving merged 2 commits intomainfrom
feature_image_embedding_and_page_breaks
Feb 11, 2026
Merged

feat: embed markdown images in PDF and add H2 page breaks#2
kevinjourdain-improving merged 2 commits intomainfrom
feature_image_embedding_and_page_breaks

Conversation

@jglisson
Copy link
Collaborator

  • Add _copy_images_to_temp() to copy referenced images into the temp directory alongside the rendered HTML, preserving relative paths so Chromium can resolve them during PDF generation
  • Use a temp directory (mkdtemp) instead of a single temp file so image assets can be co-located with the HTML
  • Add .content img CSS rule (max-width: 100%, height: auto) to constrain images to the page width
  • Add page-break-before: always on .content h2 in print styles so each ## section starts on a new page (excludes .doc-subtitle)

- Add _copy_images_to_temp() to copy referenced images into the temp
  directory alongside the rendered HTML, preserving relative paths so
  Chromium can resolve them during PDF generation
- Use a temp directory (mkdtemp) instead of a single temp file so
  image assets can be co-located with the HTML
- Add .content img CSS rule (max-width: 100%, height: auto) to
  constrain images to the page width
- Add page-break-before: always on .content h2 in print styles so
  each ## section starts on a new page (excludes .doc-subtitle)
@jglisson jglisson requested a review from trayburn February 11, 2026 16:25
@kevinjourdain-improving kevinjourdain-improving merged commit 50d4575 into main Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants