Documentation
¶
Overview ¶
Package dt provides constructors and methods for the HTML <dt> element.
The <dt> HTML element specifies a term in a description or definition list, and as such must be used inside a <dl> element. It is usually followed by a <dd> element; however, multiple <dt> elements in a row indicate several terms that are all defined by the immediate next <dd> element.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( TagOpen = []byte("<dt") TagClose = []byte("</dt>") )
Byte constants for HTML rendering.
Functions ¶
func New ¶
New creates a new dt element with the given child nodes. Example: dt.New(text.Text("Term")) Renders: <dt>Term</dt>
func RawText ¶
func RawText(str string) *element
RawText creates a new dt element with raw text content. Uses text.RawText which is not HTML-escaped. Example: dt.RawText("<b>Term</b>") Renders: <dt><b>Term</b></dt>
func RawTextf ¶
RawTextf creates a new dt element with formatted raw text content. Uses text.RawTextf which is not HTML-escaped. Example: dt.RawTextf("<abbr>%s</abbr>", term) Renders: <dt><abbr>HTML</abbr></dt>
func Static ¶
func Static(str string) *element
Static creates a new dt element with static text content. Uses text.Static which is not HTML-escaped and is JIT-optimisable. Example: dt.Static("Glossary") Renders: <dt>Glossary</dt>