This commit is contained in:
Max Richter
2025-09-24 21:32:27 +02:00
parent 26c303d9cf
commit 66ab9ca7fc
21 changed files with 450 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
module git.max-richter.dev/max/marka/parser
go 1.24.5
go 1.25.1
require (
git.max-richter.dev/max/marka/registry v0.0.0-20250817132016-6db87db32567

View File

@@ -23,6 +23,8 @@ func DetectType(markdownContent string) (string, error) {
return "", fmt.Errorf("failed to compile template: %w", err)
}
fmt.Println("Content:", markdownContent)
blocks := matcher.MatchBlocksFuzzy(markdownContent, defaultSchema, 0.3)
result, err := decoders.Parse(blocks)
@@ -30,6 +32,8 @@ func DetectType(markdownContent string) (string, error) {
return "", fmt.Errorf("failed to parse blocks: %w", err)
}
fmt.Println("Result: ", result)
if result, ok := result.(map[string]any); ok {
if contentType, ok := result["@type"]; ok {
return contentType.(string), nil