Documentation
¶
Overview ¶
Package kbd provides constructors and methods for the HTML <kbd> element.
The <kbd> HTML element represents a span of inline text denoting textual user input from a keyboard, voice input, or any other text entry device. By convention, the user agent defaults to rendering the contents of a <kbd> element using its default monospace font, although this is not mandated by the HTML standard.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( TagOpen = []byte("<kbd") TagClose = []byte("</kbd>") )
Byte constants for HTML rendering.
Functions ¶
func New ¶
New creates a new kbd element with optional child nodes. Example: kbd.New() Renders: <kbd></kbd>
func RawText ¶
func RawText(str string) *element
RawText creates a new kbd element with raw text content. Uses text.RawText which is not HTML-escaped. Example: kbd.RawText("<kbd>Ctrl</kbd>+<kbd>C</kbd>") Renders: <kbd><kbd>Ctrl</kbd>+<kbd>C</kbd></kbd>
func RawTextf ¶
RawTextf creates a new kbd element with formatted raw text content. Uses text.RawTextf which is not HTML-escaped. Example: kbd.RawTextf("<kbd>%s</kbd>+<kbd>%s</kbd>", modifier, key) Renders: <kbd><kbd>Ctrl</kbd>+<kbd>C</kbd></kbd>
func Static ¶
func Static(str string) *element
Static creates a new kbd element with static text content. Uses text.Static which is not HTML-escaped and is JIT-optimisable. Example: kbd.Static("Enter") Renders: <kbd>Enter</kbd>