Refactor table rendering: replace plain text with InlineSpan for rich text support, update row preparation, and improve PDF formatting logic.

This commit is contained in:
Sebastian Unterschütz
2026-05-14 21:40:08 +02:00
parent 2d3e544d4f
commit 427372b82b
5 changed files with 130 additions and 47 deletions
+6 -6
View File
@@ -56,10 +56,10 @@ type Appendix struct {
Kind AppendixKind
Landscape bool // true → render on a landscape A4 page (15 mm symmetric margins)
Title string
Path string // image path (Kind == AppendixKindImage)
TableData [][]string // table rows (Kind == AppendixKindTable)
Lang string // language label (Kind == AppendixKindCode)
Code string // source code (Kind == AppendixKindCode)
Path string // image path (Kind == AppendixKindImage)
TableData [][][]InlineSpan // table rows (Kind == AppendixKindTable)
Lang string // language label (Kind == AppendixKindCode)
Code string // source code (Kind == AppendixKindCode)
}
// IHKRenderer is the central PDF generator for IHK Chemnitz project documentation.
@@ -172,7 +172,7 @@ func (r *IHKRenderer) AddAppendix(titlePath string) {
}
// AddTableAppendix registers a table annex entry.
func (r *IHKRenderer) AddTableAppendix(title string, data [][]string) {
func (r *IHKRenderer) AddTableAppendix(title string, data [][][]InlineSpan) {
if len(data) == 0 {
log.Printf("warning: @TabelleAnhang %q has no table data — skipped", title)
return
@@ -211,7 +211,7 @@ func (r *IHKRenderer) AddLandscapeAppendix(titlePath string) {
}
// AddTableAppendixLandscape registers a table annex entry rendered on a landscape page.
func (r *IHKRenderer) AddTableAppendixLandscape(title string, data [][]string) {
func (r *IHKRenderer) AddTableAppendixLandscape(title string, data [][][]InlineSpan) {
if len(data) == 0 {
log.Printf("warning: @TabelleAnhangQuer %q has no table data — skipped", title)
return