html

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddClass

func AddClass(class string) seed.Option

AddClass adds a class to the html element.

func Element

func Element(c seed.Seed) js.Element

Element returns the js Element of a seed.

func ID

func ID(root seed.Seed) string

ID returns the html ID of this seed.

func Render

func Render(c seed.Seed) []byte

Render renders the html of a seed.

func Set

func Set(html string) seed.Option

Set returns an option that sets the HTML associated with the seed.

func SetAttribute

func SetAttribute(name string, constant string) seed.Option

SetAttribute returns an option that sets an HTML attribute of this seed.

func SetAttributeTo

func SetAttributeTo(name string, variable client.String) seed.Option

SetAttributeTo returns an option that sets an HTML attribute of this seed.

func SetID

func SetID(id string) seed.Option

SetID returns an option that sets the HTML id associated with the seed.

func SetInnerText

func SetInnerText(constant string) seed.Option

SetInnerText returns an option that sets the HTML innerText associated with the seed.

func SetInnerTextTo

func SetInnerTextTo(variable client.String) seed.Option

SetInnerTextTo returns an option that sets the HTML innerText associated with the seed.

func SetStyle

func SetStyle(property, value string) seed.Option

SetStyle returns an option that sets the inline HTML style of the seed.

func SetTag

func SetTag(tag string) seed.Option

SetTag returns an option that sets the HTML tag associated with the seed.

Types

type Data

type Data struct {
	ID  *string
	Tag string

	Classes []string

	InnerHTML string

	Style map[string]string

	Attributes map[string]string
}

Data stores html data with a seed.

type Document

type Document struct {
	seed.Seed
	Head, Body seed.Seed
}

func New

func New() Document

func (Document) Render

func (doc Document) Render() []byte

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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