Documentation
¶
Index ¶
- Variables
- func Cited(str string, cite string) *element
- func New(nodes ...node.Node) *element
- func RawText(content string) *element
- func RawTextf(format string, args ...any) *element
- func Static(content string) *element
- func Text(content string) *element
- func Textf(format string, args ...any) *element
- type Element
Constants ¶
This section is empty.
Variables ¶
var ( TagOpen = []byte("<q") TagClose = []byte("</q>") AttrCite = []byte(" cite=\"") )
Byte constants for HTML rendering.
Functions ¶
func Cited ¶ added in v0.3.0
Cited Creates a q element with text content and a citation URL. Uses text.Text which HTML-escapes the output. Example: q.Cited("To be or not to be", "https://example.com/hamlet") Renders: <q cite="https://example.com/hamlet">To be or not to be</q>
func New ¶
New Creates a new q element with optional child nodes. Example: q.New(text.Text("To be or not to be")) Renders: <q>To be or not to be</q>
func RawText ¶
func RawText(content string) *element
RawText Creates a new q element with raw text content. Uses text.RawText which is not HTML-escaped. Example: q.RawText("<em>Important</em> quote") Renders: <q><em>Important</em> quote</q>
func RawTextf ¶
RawTextf Creates a new q element with formatted raw text content. Uses text.RawTextf which is not HTML-escaped. Example: q.RawTextf("<em>%s</em> said it best", author) Renders: <q><em>Orwell</em> said it best</q>
func Static ¶
func Static(content string) *element
Static Creates a new q element with static text content. Uses text.Static which is not HTML-escaped and is JIT-optimisable. Example: q.Static("Knowledge is power") Renders: <q>Knowledge is power</q>