htmlutil

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EscapeString

func EscapeString(s string) template.HTML

func HTMLFormat

func HTMLFormat(s template.HTML, rawArgs ...any) template.HTML

func HTMLPrint

func HTMLPrint(w io.Writer, s template.HTML) (int, error)

func HTMLPrintTag

func HTMLPrintTag(w io.Writer, tag template.HTML, attrs map[string]string) (written int, err error)

func HTMLPrintf

func HTMLPrintf(w io.Writer, s template.HTML, rawArgs ...any) (int, error)

func ParseSizeAndClass

func ParseSizeAndClass(defaultSize int, defaultClass string, others ...any) (int, string)

ParseSizeAndClass get size and class from string with default values If present, "others" expects the new size first and then the classes to use

Types

type HTMLBuilder

type HTMLBuilder struct {
	// contains filtered or unexported fields
}

func (*HTMLBuilder) HTMLString

func (b *HTMLBuilder) HTMLString() template.HTML

func (*HTMLBuilder) String

func (b *HTMLBuilder) String() string

func (*HTMLBuilder) WriteFormat

func (b *HTMLBuilder) WriteFormat(fmt template.HTML, args ...any) *HTMLBuilder

func (*HTMLBuilder) WriteHTML

func (b *HTMLBuilder) WriteHTML(s template.HTML) *HTMLBuilder

func (*HTMLBuilder) WriteString

func (b *HTMLBuilder) WriteString(s string) *HTMLBuilder

type HTMLWriter

type HTMLWriter interface {
	OriginWriter() io.Writer
	WriteString(s string) HTMLWriter
	WriteHTML(s template.HTML) HTMLWriter
	WriteFormat(fmt template.HTML, args ...any) HTMLWriter
	Err() error
}

func NewHTMLWriter

func NewHTMLWriter(w io.Writer) HTMLWriter

Jump to

Keyboard shortcuts

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