Documentation
¶
Index ¶
- func New(nodes ...node.Node) *element
- func RawText(abbreviation string) *element
- func RawTextf(format string, args ...any) *element
- func Static(abbreviation string) *element
- func Text(abbreviation string) *element
- func Textf(format string, args ...any) *element
- func Titled(abbreviation string, title string) *element
- type Element
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New Creates a new abbreviation element without any initial attributes. Use for basic abbreviations where semantic markup is needed. Example: abbr.New() Renders: <abbr></abbr>
func RawText ¶
func RawText(abbreviation string) *element
RawText Creates a new abbreviation element with raw HTML content (unescaped). Example: abbr.RawText("<strong>HTML</strong>") Renders: <abbr><strong>HTML</strong></abbr>
func RawTextf ¶
RawTextf Creates a new abbr element with formatted raw text content as unescaped HTML using text.RawTextf. Example: abbr.RawTextf("Hello <em>%s</em>", "World") Renders: <abbr>Hello <em>World</em></abbr>
func Static ¶
func Static(abbreviation string) *element
Static Creates a new abbreviation element with static text content. Example: abbr.Static("HTML") Renders: <abbr>HTML</abbr>
func Text ¶
func Text(abbreviation string) *element
Text Creates a new abbreviation element with text content. Example: abbr.Text("HTML") Renders: <abbr>HTML</abbr>
func Textf ¶
Textf Creates a new abbr element with formatted text content using text.Textf. Example: abbr.Textf("Hello %s", "World") Renders: <abbr>Hello World</abbr>
func Titled ¶
Titled Creates a new abbreviation element with both the abbreviation text and its full expansion in the title attribute. This is the recommended approach for accessibility as it provides the expansion on hover. Example: abbr.Titled("HTML", "HyperText Markup Language") Renders: <abbr title="HyperText Markup Language">HTML</abbr>