head

package
v0.85.0-pre.12 Latest Latest
Warning

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

Go to latest
Published: May 8, 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() element_def_kind

type BooleanAttribute

type BooleanAttribute string

func (BooleanAttribute) Type

func (BooleanAttribute) Type() element_def_kind

type Builder

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

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

func FromElements

func FromElements(els []*htmlutil.Element) *Builder

FromElements wraps existing elements into a Builder.

func NewBuilder

func NewBuilder() *Builder

NewBuilder creates an empty Builder.

func (*Builder) Add

func (b *Builder) Add(defs ...element_def)

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

func (*Builder) Append

func (b *Builder) Append(other *Builder)

Append appends all elements from other into b.

func (*Builder) As

func (b *Builder) As(as string) *Attr

func (*Builder) Attr

func (b *Builder) Attr(name, value string) *Attr

func (*Builder) AttrExists

func (b *Builder) AttrExists(name string) *Attr

func (*Builder) BoolAttr

func (b *Builder) BoolAttr(name string) BooleanAttribute

func (*Builder) Charset

func (b *Builder) Charset(charset string) *Attr

func (*Builder) Content

func (b *Builder) Content(content string) *Attr

func (*Builder) CrossOrigin

func (b *Builder) CrossOrigin(co string) *Attr

func (*Builder) DangerousInnerHTML

func (b *Builder) DangerousInnerHTML(content string) InnerHTML

DangerousInnerHTML returns an InnerHTML definition.

func (*Builder) Description

func (b *Builder) Description(desc string)

func (*Builder) Elements

func (b *Builder) Elements() []*htmlutil.Element

Elements returns the underlying element slice.

func (*Builder) Href

func (b *Builder) Href(href string) *Attr
func (b *Builder) Link(defs ...element_def)

func (*Builder) Meta

func (b *Builder) Meta(defs ...element_def)

func (*Builder) MetaCharset

func (b *Builder) MetaCharset(charset string)

func (*Builder) MetaNameContent

func (b *Builder) MetaNameContent(name, content string)

func (*Builder) MetaPropertyContent

func (b *Builder) MetaPropertyContent(prop, content string)

func (*Builder) Name

func (b *Builder) Name(name string) *Attr

func (*Builder) Property

func (b *Builder) Property(prop string) *Attr

func (*Builder) Rel

func (b *Builder) Rel(rel string) *Attr

func (*Builder) Script

func (b *Builder) Script(defs ...element_def)

func (*Builder) SelfClosing

func (b *Builder) SelfClosing() SelfClosing

SelfClosing returns a SelfClosing(true) definition.

func (*Builder) Src

func (b *Builder) Src(src string) *Attr

func (*Builder) Style

func (b *Builder) Style(defs ...element_def)

func (*Builder) TextContent

func (b *Builder) TextContent(content string) TextContent

TextContent returns a TextContent definition.

func (*Builder) Title

func (b *Builder) Title(title string)

func (*Builder) Type

func (b *Builder) Type(t string) *Attr

type InnerHTML

type InnerHTML string

func (InnerHTML) Type

func (InnerHTML) Type() element_def_kind

type Prepared

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

Prepared holds classified head elements ready for rendering.

type Renderer

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

func NewRenderer

func NewRenderer(namespace string) *Renderer

func (*Renderer) InitDedupeRules

func (r *Renderer) InitDedupeRules(b *Builder)

func (*Renderer) Prepare

func (r *Renderer) Prepare(
	els []*htmlutil.Element,
) *Prepared

func (*Renderer) Render

func (r *Renderer) Render(
	input *Prepared,
) (template.HTML, error)

type SelfClosing

type SelfClosing bool

func (SelfClosing) Type

func (SelfClosing) Type() element_def_kind

type Tag

type Tag string

func (Tag) Type

func (Tag) Type() element_def_kind

type TextContent

type TextContent string

func (TextContent) Type

func (TextContent) Type() element_def_kind

Jump to

Keyboard shortcuts

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