Search Index Build

This commit is contained in:
Simon Martens
2025-02-17 21:42:20 +01:00
parent d109f7a040
commit fd2fa157b2
18 changed files with 611 additions and 16 deletions

View File

@@ -3,6 +3,11 @@ package xmlmodels
import (
"encoding/json"
"encoding/xml"
"strings"
)
const (
CATEGORY_TYPE = "category"
)
type Category struct {
@@ -21,3 +26,20 @@ func (c Category) String() string {
data, _ := json.MarshalIndent(c, "", " ")
return string(data)
}
func (c Category) Readable(_ *Library) map[string]interface{} {
ret := map[string]interface{}{
"ID": c.ID,
"Names": strings.Join(c.Names, "; "),
}
for k, v := range c.AnnotationNote.Readable() {
ret[k] = v
}
return ret
}
func (c Category) Type() string {
return CATEGORY_TYPE
}