html

package
v2.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const RawTag = "raw"

Variables

View Source
var Module = map[string]xgo.Object{
	"Renderer": &xgo.BuiltinFunction{
		Name: "Renderer",
		Value: func(args ...xgo.Object) (xgo.Object, error) {
			ret := &Renderer{}
			return ret, nil
		},
	},
}

Functions

This section is empty.

Types

type Element

type Element struct {
	xgo.ObjectImpl
	Tag      string
	Attr     map[string]string
	Children []*Element
	// The value makes sense only if
	// the tag is the "raw"
	Content string
	Final   bool
}

The type implements basic way to structrize HTML elements.

func MakeElements

func MakeElements(args ...xgo.Object) ([]*Element, error)

func (*Element) Add

func (el *Element) Add(
	args ...xgo.Object,
) (xgo.Object, error)

func (*Element) IndexGet

func (el *Element) IndexGet(
	index xgo.Object,
) (xgo.Object, error)

func (*Element) SetBody

func (el *Element) SetBody(
	args ...xgo.Object,
) (xgo.Object, error)

func (*Element) SetFinal

func (el *Element) SetFinal(
	args ...xgo.Object,
) (xgo.Object, error)

func (*Element) String

func (el *Element) String() string

The method renders the element to it's HTML representation.

func (*Element) TypeName

func (el *Element) TypeName() string

type Renderer

type Renderer struct {
	xgo.ObjectImpl
}

func (*Renderer) IndexGet

func (html *Renderer) IndexGet(
	index xgo.Object,
) (xgo.Object, error)

func (*Renderer) String

func (html *Renderer) String() string

func (*Renderer) TypeName

func (html *Renderer) TypeName() string

Jump to

Keyboard shortcuts

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