Documentation
¶
Overview ¶
Package caption provides constructors and methods for the HTML <caption> element.
The <caption> HTML element specifies the caption (or title) of a table, providing the table an accessible description.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( TagOpen = []byte("<caption") TagClose = []byte("</caption>") )
Byte constants for HTML rendering.
Functions ¶
func New ¶
New creates a new caption element with the given child nodes. Example: caption.New(text.Text("My Table Caption")) Renders: <caption>My Table Caption</caption>
func RawText ¶
func RawText(str string) *element
RawText creates a new caption element with raw text content. Uses text.RawText which is not HTML-escaped. Example: caption.RawText("User Accounts") Renders: <caption>User Accounts</caption>
func RawTextf ¶
RawTextf creates a new caption element with formatted raw text content. Uses text.RawTextf which is not HTML-escaped. Example: caption.RawTextf("%s Revenue", "Monthly") Renders: <caption>Monthly Revenue</caption>
func Static ¶
func Static(str string) *element
Static creates a new caption element with static text content. Uses text.Static which is not HTML-escaped and is JIT-optimisable. Example: caption.Static("Monthly Revenue") Renders: <caption>Monthly Revenue</caption>