feat: support inline images within song pages (Closes #2) #13

Merged
shahondin1624 merged 1 commits from feature/issue-2-support-inline-images-within-songs into main 2026-03-17 09:45:57 +01:00

Summary

  • Adds {image: path/to/image.png} ChordPro directive for embedding images inline within song sections
  • SongLine gains an optional imagePath field; when set, the line is an inline image (segments ignored)
  • PDF renderer scales images to fit within 80% content width and 40mm max height, centered horizontally
  • MeasurementEngine reserves 40mm + 2mm gap per inline image for layout height calculations
  • Four new tests: parser image directive, implicit verse creation, multiple images, measurement height

Test plan

  • All existing tests pass (gradle test)
  • New test: parse image directive within song section
  • New test: parse image directive outside section creates implicit verse
  • New test: parse multiple image directives
  • New test: inline image adds significant height in measurement

Closes #2

## Summary - Adds `{image: path/to/image.png}` ChordPro directive for embedding images inline within song sections - `SongLine` gains an optional `imagePath` field; when set, the line is an inline image (segments ignored) - PDF renderer scales images to fit within 80% content width and 40mm max height, centered horizontally - `MeasurementEngine` reserves 40mm + 2mm gap per inline image for layout height calculations - Four new tests: parser image directive, implicit verse creation, multiple images, measurement height ## Test plan - [x] All existing tests pass (`gradle test`) - [x] New test: parse image directive within song section - [x] New test: parse image directive outside section creates implicit verse - [x] New test: parse multiple image directives - [x] New test: inline image adds significant height in measurement Closes #2
shahondin1624 added 1 commit 2026-03-17 09:45:43 +01:00
Add {image: path} directive to embed images at any position within a song's
sections. SongLine gains an optional imagePath field; when set, the line
represents an inline image rather than chord/lyric content. The renderer
scales and centers images within the content width. MeasurementEngine
reserves 40mm height per inline image for layout calculations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
shahondin1624 merged commit 8dca7d7131 into main 2026-03-17 09:45:57 +01:00
shahondin1624 deleted branch feature/issue-2-support-inline-images-within-songs 2026-03-17 09:45:57 +01:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shahondin1624/songbook#13