Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( TagOpen = []byte("<sub") TagClose = []byte("</sub>") )
Byte constants for HTML rendering.
Functions ¶
func New ¶
New Creates a new sub element with the given child nodes. Example: sub.New(text.Text("2")) Renders: <sub>2</sub>
func RawText ¶
func RawText(content string) *element
RawText Creates a new sub element with raw text content. Uses text.RawText which is not HTML-escaped. Example: sub.RawText("<var>i</var>") Renders: <sub><var>i</var></sub>
func RawTextf ¶
RawTextf Creates a new sub element with formatted raw text content. Uses text.RawTextf which is not HTML-escaped. Example: sub.RawTextf("<var>%s</var>", varName) Renders: <sub><var>x</var></sub>
func Static ¶
func Static(content string) *element
Static Creates a new sub element with static text content. Uses text.Static which is not HTML-escaped and is JIT-optimisable. Example: sub.Static("n") Renders: <sub>n</sub>