2026-02-16 23:43:05 +00:00
|
|
|
package html
|
|
|
|
|
|
2026-04-03 17:23:37 +00:00
|
|
|
// render.go: Render is a convenience function that renders a node tree to HTML.
|
|
|
|
|
// Example: Render(NewLayout("C").C(Raw("body")), NewContext()).
|
2026-02-16 23:43:05 +00:00
|
|
|
func Render(node Node, ctx *Context) string {
|
2026-04-03 18:05:06 +00:00
|
|
|
ctx = normaliseContext(ctx)
|
2026-04-03 16:55:48 +00:00
|
|
|
if node == nil {
|
|
|
|
|
return ""
|
|
|
|
|
}
|
2026-02-16 23:43:05 +00:00
|
|
|
return node.Render(ctx)
|
|
|
|
|
}
|