Reference book page numbers missing in TOC and on song pages #25

Closed
opened 2026-03-17 14:38:02 +01:00 by shahondin1624 · 0 comments

Description

The songbook supports cross-references to other songbooks via {ref: bookId pageNumber} directives in songs and reference_books configuration in songbook.yaml. These should appear as:

  1. In the TOC: Additional columns showing page numbers in other songbooks (one column per reference book)
  2. On song pages: A footer showing reference book abbreviations and corresponding page numbers

Both features have rendering code (TocRenderer for TOC columns, PdfBookRenderer for song page footer), but the reference information is not appearing in the rendered output. This could be due to:

  • The reference data not being parsed correctly from song files
  • The referenceBooks config not being loaded properly
  • Conditional rendering guards preventing output (e.g., empty references map)
  • The recent overflow/split changes (PR #20) breaking the footer positioning

Acceptance Criteria

  • When reference_books is configured in songbook.yaml and songs contain {ref: ...} directives, the TOC displays additional columns with reference book abbreviations as headers and page numbers in the data rows
  • When a song has references, a footer on the song page shows the reference book abbreviations and corresponding page numbers, separated from the song content by a line
  • The toc.highlight_column configuration correctly highlights the specified column in the TOC
  • Songs without references do not show an empty footer
  • Existing tests pass
  • The reference footer is correctly positioned on the last page of multi-page songs

Relevant Code

  • parser/.../ChordProParser.kt — parsing of {ref: bookId pageNumber} directives
  • renderer-pdf/.../TocRenderer.kt — TOC reference columns
  • renderer-pdf/.../PdfBookRenderer.kt — song page reference footer
  • layout/.../MeasurementEngine.kt:94-99 — space reservation for reference footer
  • model/.../Song.ktreferences: Map<String, Int>
  • model/.../BookConfig.ktreferenceBooks: List<ReferenceBook>
## Description The songbook supports cross-references to other songbooks via `{ref: bookId pageNumber}` directives in songs and `reference_books` configuration in `songbook.yaml`. These should appear as: 1. **In the TOC**: Additional columns showing page numbers in other songbooks (one column per reference book) 2. **On song pages**: A footer showing reference book abbreviations and corresponding page numbers Both features have rendering code (`TocRenderer` for TOC columns, `PdfBookRenderer` for song page footer), but the reference information is not appearing in the rendered output. This could be due to: - The reference data not being parsed correctly from song files - The `referenceBooks` config not being loaded properly - Conditional rendering guards preventing output (e.g., empty references map) - The recent overflow/split changes (PR #20) breaking the footer positioning ## Acceptance Criteria - [ ] When `reference_books` is configured in `songbook.yaml` and songs contain `{ref: ...}` directives, the TOC displays additional columns with reference book abbreviations as headers and page numbers in the data rows - [ ] When a song has references, a footer on the song page shows the reference book abbreviations and corresponding page numbers, separated from the song content by a line - [ ] The `toc.highlight_column` configuration correctly highlights the specified column in the TOC - [ ] Songs without references do not show an empty footer - [ ] Existing tests pass - [ ] The reference footer is correctly positioned on the last page of multi-page songs ## Relevant Code - `parser/.../ChordProParser.kt` — parsing of `{ref: bookId pageNumber}` directives - `renderer-pdf/.../TocRenderer.kt` — TOC reference columns - `renderer-pdf/.../PdfBookRenderer.kt` — song page reference footer - `layout/.../MeasurementEngine.kt:94-99` — space reservation for reference footer - `model/.../Song.kt` — `references: Map<String, Int>` - `model/.../BookConfig.kt` — `referenceBooks: List<ReferenceBook>`
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shahondin1624/songbook#25