h5

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package h5 provides constructors and methods for the HTML <h5> element.

The <h5> HTML element represents the fifth highest level of section heading. It is typically used for very fine-grained content organization.

Index

Constants

This section is empty.

Variables

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

Byte constants for HTML rendering.

Functions

func New

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

New creates a new h5 element with the given child nodes. Example: h5.New(text.Text("Sub-point")) Renders: <h5>Sub-point</h5>

func RawText

func RawText(str string) *element

RawText creates a new h5 element with raw text content. Uses text.RawText which is not HTML-escaped. Example: h5.RawText("<em>Minor</em> Sub-point") Renders: <h5><em>Minor</em> Sub-point</h5>

func RawTextf

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

RawTextf creates a new h5 element with formatted raw text content. Uses text.RawTextf which is not HTML-escaped. Example: h5.RawTextf("<small>%s</small>", subtitle) Renders: <h5><small>A deeper look</small></h5>

func Static

func Static(str string) *element

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

func Text

func Text(str string) *element

Text creates a new h5 element with text content. Uses text.Text which HTML-escapes the output. Example: h5.Text("Section Title") Renders: <h5>Section Title</h5>

func Textf

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

Textf creates a new h5 element with formatted text content. Uses text.Textf which HTML-escapes the output. Example: h5.Textf("Chapter %d", num) Renders: <h5>Chapter 1</h5>

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