package main import ( "bytes" "context" "git.dev.alexdunmow.com/block/core/blocks" ) // DoodleDividerBlockMeta defines metadata for the doodle_divider block. var DoodleDividerBlockMeta = blocks.BlockMeta{ Key: "doodle_divider", Title: "Doodle Divider", Description: "Hand-drawn divider in one of four motifs (beans, croissant, cup, leaf)", Source: "coffee", } // DoodleDividerBlock renders an inline SVG divider based on the motif. // Content shape: {"motif": "beans"} where motif is one of beans/croissant/cup/leaf. func DoodleDividerBlock(ctx context.Context, content map[string]any) string { motif := getString(content, "motif") switch motif { case "beans", "croissant", "cup", "leaf": // allowed default: motif = "beans" } var buf bytes.Buffer _ = doodleDividerComponent(motif).Render(ctx, &buf) return buf.String() }