nav

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TagOpen  = []byte("<nav")
	TagClose = []byte("</nav>")
)

Byte constants for HTML rendering.

Functions

func New

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

New Creates a new nav element with optional child nodes Example: nav.New() Renders: <nav></nav>

func RawText

func RawText(content string) *element

RawText Creates a new nav element with raw text content. Uses text.RawText which is not HTML-escaped. Example: nav.RawText("<a href=\"/\">Home</a> | <a href=\"/about\">About</a>") Renders: <nav><a href="/">Home</a> | <a href="/about">About</a></nav>

func RawTextf

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

RawTextf Creates a new nav element with formatted raw text content. Uses text.RawTextf which is not HTML-escaped. Example: nav.RawTextf("<a href=\"%s\">Back</a>", url) Renders: <nav><a href="/about">Back</a></nav>

func Static

func Static(content string) *element

Static Creates a new nav element with static text content. Uses text.Static which is not HTML-escaped and is JIT-optimisable. Example: nav.Static("Navigation") Renders: <nav>Navigation</nav>

func Text

func Text(content string) *element

Text Creates a new nav element with text content. Uses text.Text which HTML-escapes the output. Example: nav.Text("Home | About | Contact") Renders: <nav>Home | About | Contact</nav>

func Textf

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

Textf Creates a new nav element with formatted text content. Uses text.Textf which HTML-escapes the output. Example: nav.Textf("Section: %s", section) Renders: <nav>Section: main</nav>

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