Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( TagOpen = []byte("<header") TagClose = []byte("</header>") )
Byte constants for HTML rendering.
Functions ¶
func New ¶
New Creates a new header element with the given child nodes. Example: header.New(h1.Text("Welcome"), p.Text("A brief introduction")) Renders: <header><h1>Welcome</h1><p>A brief introduction</p></header>
func RawText ¶ added in v0.3.0
func RawText(content string) *element
RawText Creates a new header element with raw text content. Uses text.RawText which is not HTML-escaped. Example: header.RawText("<h1>Welcome</h1>") Renders: <header><h1>Welcome</h1></header>
func RawTextf ¶ added in v0.3.0
RawTextf Creates a new header element with formatted raw text content. Uses text.RawTextf which is not HTML-escaped. Example: header.RawTextf("<h1>%s</h1>", title) Renders: <header><h1>Dashboard</h1></header>
func Static ¶ added in v0.3.0
func Static(content string) *element
Static Creates a new header element with static text content. Uses text.Static which is not HTML-escaped and is JIT-optimisable. Example: header.Static("Welcome") Renders: <header>Welcome</header>