htm

package module
v0.0.0-...-6672268 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: BSD-3-Clause Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var URIComponentEncode = url.QueryEscape

Functions

func If

func If[T ~string | Result](cond bool, result T) T

func IfCall

func IfCall[T ~string | Result](cond bool, call func() T) T

func IfElse

func IfElse[T ~string | Result](cond bool, ifR T, elseR T) T

func IfElseCall

func IfElseCall[T ~string | Result](cond bool, ifCall func() T, elseCall func() T) T

func See

func See(what ...any) string

Types

type Attr

type Attr string

func JoinAttr

func JoinAttr(attrs ...Attr) Attr

func NewAttr

func NewAttr(nv ...string) Attr

type Result

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

contains well-formed HTML fragment

func Append

func Append(collect Result, frags ...Result) Result

func AsIs

func AsIs(a ...string) Result

func HTMLEncode

func HTMLEncode(a string) Result

Used to output HTML text, escaping HTML reserved characters <>&"

func JSStringEscape

func JSStringEscape(a string) Result

func Map

func Map[T any](a []T, f func(int) Result) Result

func NewElem

func NewElem(tag string, attr Attr, bodyEls ...Result) Result

func NewHTML

func NewHTML(cap int) Result

func Prepend

func Prepend(doctype string, html Result) Result

func (Result) IsEmpty

func (c Result) IsEmpty() bool

func (Result) String

func (c Result) String() string

Jump to

Keyboard shortcuts

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