h1

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(nodes ...node.Node) *element

New Creates a new h1 element with the given child nodes. Example: h1.New(text.Text("Page Title")) Renders: <h1>Page Title</h1>

func RawText

func RawText(str string) *element

RawText Creates a new h1 element with raw text content as unescaped HTML. Example: h1.RawText("<b>Main</b> Heading") Renders: <h1><b>Main</b> Heading</h1>

func RawTextf

func RawTextf(format string, args ...any) *element

RawTextf Creates a new h1 element with formatted raw text content as unescaped HTML using text.RawTextf. Example: h1.RawTextf("Hello <em>%s</em>", "World") Renders: <h1>Hello <em>World</em></h1>

func Static

func Static(str string) *element

Static Creates a new h1 element with static text content. Example: h1.Static("Hello World") Renders: <h1>Hello World</h1>

func Text

func Text(str string) *element

Text Creates a new h1 element with text content (HTML-encoded). Example: h1.Text("<b>Main</b> Heading") Renders: <h1>&lt;b&gt;Main&lt;/b&gt; Heading</h1>

func Textf

func Textf(format string, args ...any) *element

Textf Creates a new h1 element with formatted text content using text.Textf. Example: h1.Textf("Hello %s", "World") Renders: <h1>Hello World</h1>

Types

type Element

type Element = element

Element is an exported alias for the private element type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL