Add support for code appendices: enable code blocks with language labels, line-number gutter, and directive-based integration.
This commit is contained in:
@@ -282,6 +282,38 @@ eine konfigurierbare Spaltenbreite für Tabellen umfassen.
|
||||
| Bildanhang | @Anhang: Titel \| Pfad | Fügt ein Bild als nummerierte Anlage in den Anhang ein |
|
||||
| Diagrammanhang | @AnhangUML: Titel | Rendert den folgenden Mermaid/PlantUML-Block als Anlage |
|
||||
|
||||
@AnhangCode: Implementierung – Tabellen-Renderer (prepareRow)
|
||||
|
||||
```go
|
||||
func (r *IHKRenderer) prepareRow(rawCells []string, numCols int,
|
||||
colW, lineHt float64, bold bool) tableRowData {
|
||||
|
||||
r.pdf.SetFont("Helvetica", map[bool]string{true: "B", false: ""}[bold], dinFontCaption)
|
||||
|
||||
cells := make([][]string, numCols)
|
||||
maxLines := 0
|
||||
for j := 0; j < numCols; j++ {
|
||||
raw := ""
|
||||
if j < len(rawCells) {
|
||||
raw = rawCells[j]
|
||||
}
|
||||
split := r.pdf.SplitLines([]byte(r.tr(raw)), colW-2)
|
||||
lines := make([]string, len(split))
|
||||
for k, b := range split {
|
||||
lines[k] = string(b)
|
||||
}
|
||||
if len(lines) == 0 {
|
||||
lines = []string{""}
|
||||
}
|
||||
cells[j] = lines
|
||||
if len(lines) > maxLines {
|
||||
maxLines = len(lines)
|
||||
}
|
||||
}
|
||||
return tableRowData{cells: cells, height: float64(maxLines) * lineHt}
|
||||
}
|
||||
```
|
||||
|
||||
@AnhangUML: Systemarchitektur – Datenflussdiagramm
|
||||
|
||||
```mermaid
|
||||
|
||||
Reference in New Issue
Block a user