abbr

package
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(nodes ...node.Node) *element

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

func RawTextf(format string, args ...any) *element

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

func Textf(format string, args ...any) *element

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

func Titled(abbreviation string, title string) *element

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>

Types

type Element

type Element = element

Element is an exported alias for the private element type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL