11 lines
295 B
Go
11 lines
295 B
Go
package html
|
|
|
|
// render.go: Render is a convenience function that renders a node tree to HTML.
|
|
// Example: Render(NewLayout("C").C(Raw("body")), NewContext()).
|
|
func Render(node Node, ctx *Context) string {
|
|
ctx = normaliseContext(ctx)
|
|
if node == nil {
|
|
return ""
|
|
}
|
|
return node.Render(ctx)
|
|
}
|