Documentation
¶
Index ¶
- func Fragment(nodes ...node.Node) *element
- func FragmentRawText(str string) *element
- func FragmentRawTextf(format string, args ...any) *element
- func FragmentStatic(str string) *element
- func FragmentText(str string) *element
- func FragmentTextf(format string, args ...any) *element
- func New(nodes ...node.Node) *element
- func RawText(str string) *element
- func RawTextf(format string, args ...any) *element
- func Static(str string) *element
- func Text(str string) *element
- func Textf(format string, args ...any) *element
- type Element
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fragment ¶
Fragment Creates an html fragment without DOCTYPE declaration (for fragments or embedded use) Example: html.Fragment() Renders: <html></html>
func FragmentRawText ¶
func FragmentRawText(str string) *element
FragmentRawText Creates an html fragment without DOCTYPE declaration with raw text content Example: html.FragmentRawText("<body>Content</body>") Renders: <html><body>Content</body></html>
func FragmentRawTextf ¶
FragmentRawTextf Creates an html fragment without DOCTYPE declaration with formatted raw text content as unescaped HTML using text.RawTextf Example: html.FragmentRawTextf("Hello <em>%s</em>", "World") Renders: <html>Hello <em>World</em></html>
func FragmentStatic ¶
func FragmentStatic(str string) *element
FragmentStatic Creates an html fragment without DOCTYPE declaration with static text content Example: html.FragmentStatic("Hello World") Renders: <html>Hello World</html>
func FragmentText ¶
func FragmentText(str string) *element
FragmentText Creates an html fragment without DOCTYPE declaration with text content Example: html.FragmentText("Content") Renders: <html>Content</html>
func FragmentTextf ¶
FragmentTextf Creates an html fragment without DOCTYPE declaration with formatted text content using text.Textf Example: html.FragmentTextf("Hello %s", "World") Renders: <html>Hello World</html>
func New ¶
New Creates a complete HTML5 document with DOCTYPE declaration Example: html.New() Renders: <!DOCTYPE html><html></html>
func RawText ¶
func RawText(str string) *element
RawText Creates a complete HTML5 document with DOCTYPE declaration and raw text content Example: html.RawText("<body>Content</body>") Renders: <!DOCTYPE html><html><body>Content</body></html>
func RawTextf ¶
RawTextf Creates a complete HTML5 document with DOCTYPE declaration and formatted raw text content as unescaped HTML using text.RawTextf Example: html.RawTextf("Hello <em>%s</em>", "World") Renders: <!DOCTYPE html><html>Hello <em>World</em></html>
func Static ¶
func Static(str string) *element
Static Creates a complete HTML5 document with DOCTYPE declaration and static text content Example: html.Static("Hello World") Renders: <!DOCTYPE html><html>Hello World</html>