themes-art-deco/text_override.go
Alex Dunmow 9fbedf5ba1 initial: theme plugin art-deco
Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously
an unversioned directory inside ~/src/blockninja-themes/art-deco.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-06 14:11:19 +08:00

27 lines
708 B
Go

package main
import (
"bytes"
"context"
)
// ArtDecoTextBlock overrides the built-in "text" block when the Art Deco theme is active.
// Renders prose in Cormorant body with a classical italic drop-cap on the first paragraph.
// Content: {"text": "<rich HTML>", "class": "optional-extra-class"}
func ArtDecoTextBlock(ctx context.Context, content map[string]any) string {
data := TextOverrideData{
Text: getString(content, "text"),
Class: getString(content, "class"),
}
var buf bytes.Buffer
_ = artDecoTextComponent(data).Render(ctx, &buf)
return buf.String()
}
// TextOverrideData is the typed view for the text override component.
type TextOverrideData struct {
Text string
Class string
}