function

RenderDocument

RenderDocument renders a typed document without loading an editor or fetching referenced records. The block callback receives the generated payload codec; applications dispatch its Value union by concrete generated type. Missing callbacks fail explicitly. Use RenderHTML for deliberate raw recovery tooling.

Arguments

ArgumentTypeDescription
documentDocument[T]The document value.
blockfunc(T) (string, error)The block value.
nodesmap[string]func(store.Values) (string, error)The nodes value.

Returns

The declared result.

(string, error)

Full signature

func RenderDocument[T any]( document Document[T], block func(T) (string, error), nodes map[string]func(store.Values) (string, error), ) (string, error)

Source plugins/richtext/document.go:56

Related types

  • Document

    The exact generated Go value type for a versioned serialized Lexical document.

  • Values

    A map of field names to typed values.