Documentation
¶
Index ¶
- func DateTime(datetime string, content string) *element
- func New(nodes ...node.Node) *element
- func RawText(content string) *element
- func RawTextf(format string, args ...any) *element
- func Static(content string) *element
- func Text(content string) *element
- func Textf(format string, args ...any) *element
- type Element
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DateTime ¶
DateTime Creates a new time element with datetime attribute and text content Example: time.DateTime("2023-12-25", "Christmas Day") Renders: <time datetime="2023-12-25">Christmas Day</time>
func New ¶
New Creates a new time element with optional child nodes Example: time.New() Renders: <time></time>
func RawText ¶
func RawText(content string) *element
RawText Creates a new time element with raw text content Example: time.RawText("December 25, 2023") Renders: <time>December 25, 2023</time>
func RawTextf ¶
RawTextf Creates a new time element with formatted raw text content as unescaped HTML. Example: time.RawTextf("Date: <em>%s</em>", "2023-12-25") Renders: <time>Date: <em>2023-12-25</em></time>
func Static ¶
func Static(content string) *element
Static Creates a new time element with static text content. Example: time.Static("Hello World") Renders: <time>Hello World</time>