prototyped svg reports

This commit is contained in:
2026-07-18 18:24:37 -06:00
parent 22e7b003f6
commit c51ad80dc6
106 changed files with 5450 additions and 46 deletions
+29
View File
@@ -0,0 +1,29 @@
package svg
import (
"fmt"
"html"
"maps"
"slices"
"strings"
)
type (
Style map[string]string
)
func (m Style) PrintKey() string {
return "style"
}
func (m Style) PrintValue() (string, bool) {
keys := slices.Collect(maps.Keys(m))
slices.Sort(keys)
parts := make([]string, len(m))
for i, k := range keys {
parts[i] = fmt.Sprintf(`%s: %s`, k, html.EscapeString(m[k]))
}
return fmt.Sprintf("%q", strings.Join(parts, "; ")), true
}