feat: add support for foreword/preface pages (Closes #1)

Add ForewordConfig to BookConfig, Foreword model type, ForewordParser for
text files (quote/paragraphs/signatures), ForewordPage in PageContent,
pipeline integration to insert foreword after TOC, and PDF rendering with
styled quote, horizontal rule separator, word-wrapped paragraphs, and
right-aligned signatures.

Also adds Gradle wrapper and adjusts build toolchain for JDK 25 compat.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit was merged in pull request #8.
This commit is contained in:
shahondin1624
2026-03-17 09:27:00 +01:00
parent e386501b57
commit 8e4728c55a
14 changed files with 792 additions and 7 deletions

View File

@@ -7,7 +7,12 @@ data class BookConfig(
val layout: LayoutConfig = LayoutConfig(),
val images: ImagesConfig = ImagesConfig(),
val referenceBooks: List<ReferenceBook> = emptyList(),
val output: OutputConfig = OutputConfig()
val output: OutputConfig = OutputConfig(),
val foreword: ForewordConfig? = null
)
data class ForewordConfig(
val file: String = "./foreword.txt"
)
data class BookMeta(

View File

@@ -0,0 +1,7 @@
package de.pfadfinder.songbook.model
data class Foreword(
val quote: String? = null,
val paragraphs: List<String> = emptyList(),
val signatures: List<String> = emptyList()
)

View File

@@ -10,6 +10,7 @@ sealed class PageContent {
data class SongPage(val song: Song, val pageIndex: Int) : PageContent() // pageIndex 0 or 1 for 2-page songs
data class FillerImage(val imagePath: String) : PageContent()
data object BlankPage : PageContent()
data class ForewordPage(val foreword: Foreword, val pageIndex: Int) : PageContent() // pageIndex 0 or 1 for multi-page forewords
}
data class LayoutResult(