Documentation
¶
Index ¶
- Variables
- func Audio(data string, nodes ...node.Node) *elementdeprecated
- func Flash(data string, nodes ...node.Node) *elementdeprecated
- func New(nodes ...node.Node) *element
- func PDF(data string, 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
- func Video(data string, nodes ...node.Node) *elementdeprecated
- type Element
Constants ¶
This section is empty.
Variables ¶
var ( TagOpen = []byte("<object") TagClose = []byte("</object>") AttrData = []byte(" data=\"") AttrType = []byte(" type=\"") AttrForm = []byte(" form=\"") AttrHeight = []byte(" height=\"") AttrName = []byte(" name=\"") AttrUseMap = []byte(" usemap=\"") AttrWidth = []byte(" width=\"") )
Byte constants for HTML rendering.
Functions ¶
func Flash
deprecated
func New ¶
New Creates a new object element with optional child nodes Example: object.New() Renders: <object></object>
func PDF ¶
PDF Creates an object element for PDF documents Example: object.PDF("/document.pdf") Renders: <object data="/document.pdf" type="application/pdf"></object>
func RawText ¶
func RawText(content string) *element
RawText Creates a new object element with raw fallback text content. Uses text.RawText which is not HTML-escaped. Example: object.RawText("<p>Fallback content</p>") Renders: <object><p>Fallback content</p></object>
func RawTextf ¶
RawTextf Creates a new object element with formatted raw fallback text content. Uses text.RawTextf which is not HTML-escaped. Example: object.RawTextf("<p>Cannot display <strong>%s</strong></p>", file) Renders: <object><p>Cannot display <strong>report.pdf</strong></p></object>
func Static ¶
func Static(content string) *element
Static Creates a new object element with static fallback text content. Uses text.Static which is not HTML-escaped and is JIT-optimisable. Example: object.Static("Loading content...") Renders: <object>Loading content...</object>
func Text ¶
func Text(content string) *element
Text Creates a new object element with fallback text content. Uses text.Text which HTML-escapes the output. Example: object.Text("Your browser does not support embedded objects.") Renders: <object>Your browser does not support embedded objects.</object>