Documentation
¶
Overview ¶
Package primary provides constructors and methods for the HTML <main> element.
The <main> HTML element represents the dominant content of the <body> of a document. The main content area consists of content that is directly related to or expands upon the central topic of a document, or the central functionality of an application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( TagOpen = []byte("<main") TagClose = []byte("</main>") )
Byte constants for HTML rendering.
Functions ¶
func New ¶
New creates a new main element with optional child nodes Example: primary.New() Renders: <main></main>
func RawText ¶
func RawText(str string) *element
RawText creates a new main element with raw text content. Uses text.RawText which is not HTML-escaped. Example: primary.RawText("<h1>Title</h1><p>Content</p>") Renders: <main><h1>Title</h1><p>Content</p></main>
func RawTextf ¶
RawTextf creates a new main element with formatted raw text content. Uses text.RawTextf which is not HTML-escaped. Example: primary.RawTextf("<h1>%s</h1>", title) Renders: <main><h1>Dashboard</h1></main>
func Static ¶
func Static(str string) *element
Static creates a new main element with static text content. Uses text.Static which is not HTML-escaped and is JIT-optimisable. Example: primary.Static("Welcome") Renders: <main>Welcome</main>