Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( TagOpen = []byte("<samp") TagClose = []byte("</samp>") )
Byte constants for HTML rendering.
Functions ¶
func New ¶
New Creates a new samp element with optional child nodes Example: samp.New(text.Text("Output")) Renders: <samp>Output</samp>
func RawText ¶
func RawText(content string) *element
RawText Creates a new samp element with raw text content. Uses text.RawText which is not HTML-escaped. Example: samp.RawText("<strong>Warning:</strong> Low memory") Renders: <samp><strong>Warning:</strong> Low memory</samp>
func RawTextf ¶
RawTextf Creates a new samp element with formatted raw text content. Uses text.RawTextf which is not HTML-escaped. Example: samp.RawTextf("<code>%s</code>", output) Renders: <samp><code>OK</code></samp>
func Static ¶
func Static(content string) *element
Static Creates a new samp element with static text content. Uses text.Static which is not HTML-escaped and is JIT-optimisable. Example: samp.Static("Process completed") Renders: <samp>Process completed</samp>