Documentation
¶
Overview ¶
Package summary provides constructors and methods for the HTML <summary> element.
The <summary> HTML element specifies a summary, caption, or legend for a <details> element's disclosure box.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( TagOpen = []byte("<summary") TagClose = []byte("</summary>") )
Byte constants for HTML rendering.
Functions ¶
func New ¶
New creates a new summary element with optional child nodes. Example: summary.New() Renders: <summary></summary>
func RawText ¶
func RawText(content string) *element
RawText creates a new summary element with raw text content. Uses text.RawText which is not HTML-escaped. Example: summary.RawText("<strong>Click</strong> to expand") Renders: <summary><strong>Click</strong> to expand</summary>
func RawTextf ¶
RawTextf creates a new summary element with formatted raw text content. Uses text.RawTextf which is not HTML-escaped. Example: summary.RawTextf("<strong>%s</strong>", title) Renders: <summary><strong>Dashboard</strong></summary>
func Static ¶
func Static(content string) *element
Static creates a new summary element with static text content. Uses text.Static which is not HTML-escaped and is JIT-optimisable. Example: summary.Static("Details") Renders: <summary>Details</summary>