feat: renderer

This commit is contained in:
2025-08-19 17:20:24 +02:00
parent 6db87db325
commit 210b31aef8
38 changed files with 727 additions and 299 deletions

View File

@@ -4,6 +4,7 @@ import (
"fmt"
"git.max-richter.dev/max/marka/parser/utils"
renderUtils "git.max-richter.dev/max/marka/renderer/utils"
"git.max-richter.dev/max/marka/template"
"go.yaml.in/yaml/v4"
)
@@ -17,12 +18,15 @@ func Yaml(input string, block template.Block) (value any, error error) {
var out any
for _, f := range block.Fields {
if f.Hidden {
continue
}
if f.CodecType == template.CodecConst {
if f.Value != nil {
out = utils.SetPathValue(f.Path, f.Value, out)
}
} else {
if value, ok := res[f.Path]; ok {
if value, ok := renderUtils.GetValueFromPath(res, f.Path); ok {
out = utils.SetPathValue(f.Path, value, out)
}
}