wip
This commit is contained in:
@@ -40,19 +40,9 @@ func DetectType(markdownContent string) (string, error) {
|
||||
return "", fmt.Errorf("could not parse frontmatter")
|
||||
}
|
||||
|
||||
func MatchBlocks(markdownContent string) ([]matcher.Block, error) {
|
||||
func MatchBlocks(markdownContent, templateContent string) ([]matcher.Block, error) {
|
||||
markdownContent = strings.TrimSuffix(markdownContent, "\n")
|
||||
|
||||
contentType, err := DetectType(markdownContent)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not detect type: %w", err)
|
||||
}
|
||||
|
||||
templateContent, err := registry.GetTemplate(contentType)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not get schema: %w", err)
|
||||
}
|
||||
|
||||
tpl, err := template.CompileTemplate(templateContent)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to compile template: %w", err)
|
||||
|
Reference in New Issue
Block a user