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:
+6
-6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user