Documentation
¶
Overview ¶
Package i provides constructors and methods for the HTML <i> element.
The <i>: The Idiomatic Text element represents a range of text that is set off from the normal text for some reason, such as idiomatic text, technical terms, taxonomical designations, among others. Historically, these have been presented using italicized type, which is the original source of the <i> naming of this element.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( TagOpen = []byte("<i") TagClose = []byte("</i>") )
Byte constants for HTML rendering.
Functions ¶
func New ¶
New creates a new italic element with optional child nodes. Example: i.New() Renders: <i></i>
func RawText ¶
func RawText(str string) *element
RawText creates a new i element with raw text content. Uses text.RawText which is not HTML-escaped. Example: i.RawText("<cite>The Origin of Species</cite>") Renders: <i><cite>The Origin of Species</cite></i>
func RawTextf ¶
RawTextf creates a new i element with formatted raw text content. Uses text.RawTextf which is not HTML-escaped. Example: i.RawTextf("<cite>%s</cite>", headline) Renders: <i><cite>Breaking News</cite></i>
func Static ¶
func Static(str string) *element
Static creates a new i element with static text content. Uses text.Static which is not HTML-escaped and is JIT-optimisable. Example: i.Static("et cetera") Renders: <i>et cetera</i>