feat: highlight the current book's column in the TOC (Closes #6)

Add TocConfig with highlightColumn field to BookConfig. TocRenderer now
applies a light gray background shading to the designated column header
and data cells, making it easy to visually distinguish the current book's
page numbers from reference book columns.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
shahondin1624
2026-03-17 09:35:27 +01:00
parent 8e4728c55a
commit 79688be51e
3 changed files with 67 additions and 11 deletions

View File

@@ -192,6 +192,28 @@ class ConfigParserTest {
config.foreword.shouldBeNull()
}
@Test
fun `parse config with toc highlight column`() {
val yaml = """
book:
title: "Test"
toc:
highlight_column: "CL"
""".trimIndent()
val config = ConfigParser.parse(yaml)
config.toc.highlightColumn shouldBe "CL"
}
@Test
fun `parse config without toc section uses defaults`() {
val yaml = """
book:
title: "Test"
""".trimIndent()
val config = ConfigParser.parse(yaml)
config.toc.highlightColumn.shouldBeNull()
}
@Test
fun `parse config ignores unknown properties`() {
val yaml = """