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 was merged in pull request #10.
This commit is contained in:
@@ -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 = """
|
||||
|
||||
Reference in New Issue
Block a user