headels

package
v0.85.0-pre.6 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const AttrAnyValue = "\x00__vorma_headels_any__"

Variables

This section is empty.

Functions

This section is empty.

Types

type Attr

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

func (*Attr) KnownSafe

func (a *Attr) KnownSafe() *Attr

func (Attr) Type

func (Attr) Type() htmlutil_type

type BooleanAttribute

type BooleanAttribute string

func (BooleanAttribute) Type

func (BooleanAttribute) Type() htmlutil_type

type HeadEls

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

HeadEls is an ordered collection of HTML head elements. It is NOT safe for concurrent use; callers must synchronize externally.

func FromRaw

func FromRaw(els []*htmlutil.Element) *HeadEls

FromRaw wraps existing elements into a HeadEls.

func New

func New() *HeadEls

New creates an empty HeadEls.

func (*HeadEls) Add

func (h *HeadEls) Add(defs ...type_interface)

Add appends a new element built from the provided definitions. Panics if no Tag is provided.

func (*HeadEls) AddElements added in v0.83.0

func (h *HeadEls) AddElements(other *HeadEls)

AddElements appends all elements from other into h.

func (*HeadEls) As added in v0.83.0

func (h *HeadEls) As(as string) *Attr

func (*HeadEls) Attr

func (h *HeadEls) Attr(name, value string) *Attr

func (*HeadEls) AttrExists

func (h *HeadEls) AttrExists(name string) *Attr

func (*HeadEls) BoolAttr added in v0.83.0

func (h *HeadEls) BoolAttr(name string) BooleanAttribute

func (*HeadEls) Charset added in v0.83.0

func (h *HeadEls) Charset(charset string) *Attr

func (*HeadEls) Collect

func (h *HeadEls) Collect() []*htmlutil.Element

Collect returns the underlying element slice.

func (*HeadEls) Content

func (h *HeadEls) Content(content string) *Attr

func (*HeadEls) CrossOrigin added in v0.83.0

func (h *HeadEls) CrossOrigin(co string) *Attr

func (*HeadEls) DangerousInnerHTML added in v0.83.0

func (h *HeadEls) DangerousInnerHTML(content string) InnerHTML

DangerousInnerHTML returns an InnerHTML definition.

func (*HeadEls) Description

func (h *HeadEls) Description(desc string)

func (*HeadEls) Href

func (h *HeadEls) Href(href string) *Attr
func (h *HeadEls) Link(defs ...type_interface)

func (*HeadEls) Meta

func (h *HeadEls) Meta(defs ...type_interface)

func (*HeadEls) MetaCharset

func (h *HeadEls) MetaCharset(charset string)

func (*HeadEls) MetaNameContent added in v0.83.0

func (h *HeadEls) MetaNameContent(name, content string)

func (*HeadEls) MetaPropertyContent added in v0.83.0

func (h *HeadEls) MetaPropertyContent(prop, content string)

func (*HeadEls) Name

func (h *HeadEls) Name(name string) *Attr

func (*HeadEls) Property

func (h *HeadEls) Property(prop string) *Attr

func (*HeadEls) Rel

func (h *HeadEls) Rel(rel string) *Attr

func (*HeadEls) Script added in v0.83.0

func (h *HeadEls) Script(defs ...type_interface)

func (*HeadEls) SelfClosing added in v0.83.0

func (h *HeadEls) SelfClosing() SelfClosing

SelfClosing returns a SelfClosing(true) definition.

func (*HeadEls) Src added in v0.83.0

func (h *HeadEls) Src(src string) *Attr

func (*HeadEls) Style added in v0.83.0

func (h *HeadEls) Style(defs ...type_interface)

func (*HeadEls) TextContent added in v0.83.0

func (h *HeadEls) TextContent(content string) TextContent

TextContent returns a TextContent definition.

func (*HeadEls) Title

func (h *HeadEls) Title(title string)

func (*HeadEls) Type added in v0.83.0

func (h *HeadEls) Type(t string) *Attr

type InnerHTML

type InnerHTML string

func (InnerHTML) Type

func (InnerHTML) Type() htmlutil_type

type Instance

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

func NewInstance

func NewInstance(namespace string) *Instance

func (*Instance) InitUniqueRules

func (inst *Instance) InitUniqueRules(e *HeadEls)

func (*Instance) Render

func (inst *Instance) Render(input *SortedAndPreEscapedHeadEls) (template.HTML, error)

func (*Instance) ToSortedAndPreEscapedHeadEls

func (inst *Instance) ToSortedAndPreEscapedHeadEls(
	els []*htmlutil.Element,
) *SortedAndPreEscapedHeadEls

type SelfClosing

type SelfClosing bool

func (SelfClosing) Type

func (SelfClosing) Type() htmlutil_type

type SortedAndPreEscapedHeadEls

type SortedAndPreEscapedHeadEls struct {
	Title *htmlutil.Element
	Meta  []*htmlutil.Element
	Rest  []*htmlutil.Element
}

SortedAndPreEscapedHeadEls holds classified head elements ready for rendering.

type Tag

type Tag string

func (Tag) Type

func (Tag) Type() htmlutil_type

type TextContent

type TextContent string

func (TextContent) Type

func (TextContent) Type() htmlutil_type

Jump to

Keyboard shortcuts

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