html

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2020 License: Apache-2.0 Imports: 5 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(w io.Writer, root Block) error

func RenderMinified

func RenderMinified(w io.Writer, root Block) error

func RenderMinifiedString

func RenderMinifiedString(root Block) (string, error)

func RenderString

func RenderString(root Block) (string, error)

Types

type AttrPair

type AttrPair struct {
	Key   string
	Value interface{}
}

type Attributes

type Attributes []AttrPair

func Action

func Action(action interface{}) Attributes

func Attr

func Attr(key string, value interface{}) Attributes

func Charset

func Charset(charset interface{}) Attributes

func Checked

func Checked() Attributes

func Class

func Class(class interface{}) Attributes

func Content

func Content(name interface{}) Attributes

func Data

func Data(key string, value interface{}) Attributes

func Defer

func Defer() Attributes

func For

func For(fo interface{}) Attributes

func Href

func Href(href interface{}) Attributes

func Id

func Id(id interface{}) Attributes

func Method

func Method(method interface{}) Attributes

func Name

func Name(name interface{}) Attributes

func Rel

func Rel(rel interface{}) Attributes

func Src

func Src(src interface{}) Attributes

func Styles

func Styles(style string) Attributes

func Type

func Type(typ interface{}) Attributes

func Value

func Value(value interface{}) Attributes

func (Attributes) Action

func (a Attributes) Action(action interface{}) Attributes

func (Attributes) Attr

func (a Attributes) Attr(key string, id interface{}) Attributes

func (Attributes) Charset

func (a Attributes) Charset(charset interface{}) Attributes

func (Attributes) Checked

func (a Attributes) Checked() Attributes

func (Attributes) Class

func (a Attributes) Class(class interface{}) Attributes

func (Attributes) Content

func (a Attributes) Content(name interface{}) Attributes

func (Attributes) Data

func (a Attributes) Data(key string, value interface{}) Attributes

func (Attributes) Defer

func (a Attributes) Defer() Attributes

func (Attributes) For

func (a Attributes) For(fo interface{}) Attributes

func (Attributes) Href

func (a Attributes) Href(href interface{}) Attributes

func (Attributes) Id

func (a Attributes) Id(id interface{}) Attributes

func (Attributes) Method

func (a Attributes) Method(method interface{}) Attributes

func (Attributes) Name

func (a Attributes) Name(name interface{}) Attributes

func (Attributes) Rel

func (a Attributes) Rel(rel interface{}) Attributes

func (Attributes) Src

func (a Attributes) Src(src interface{}) Attributes

func (Attributes) Styles

func (a Attributes) Styles(style string) Attributes

func (Attributes) Type

func (a Attributes) Type(typ interface{}) Attributes

func (Attributes) Value

func (a Attributes) Value(value interface{}) Attributes

type Block

type Block interface {
	RenderHTML() Block
}

func A

func A(attr Attributes, children ...Block) Block

func Body

func Body(attr Attributes, children ...Block) Block

func Br

func Br() Block

func Button

func Button(attr Attributes, children ...Block) Block

func Div

func Div(attr Attributes, children ...Block) Block

func Doctype

func Doctype(arg string) Block

func Elem

func Elem(el string, attr Attributes, children ...Block) Block

func Form

func Form(attr Attributes, children ...Block) Block

func H1

func H1(attr Attributes, children ...Block) Block

func H2

func H2(attr Attributes, children ...Block) Block

func H3

func H3(attr Attributes, children ...Block) Block

func H4

func H4(attr Attributes, children ...Block) Block

func H5

func H5(attr Attributes, children ...Block) Block

func H6

func H6(attr Attributes, children ...Block) Block
func Head(attr Attributes, children ...Block) Block

func Hr

func Hr(attr Attributes) Block

func Html

func Html(attr Attributes, children ...Block) Block

func I

func I(attr Attributes, children ...Block) Block

func Iframe

func Iframe(attr Attributes, children ...Block) Block

func Img

func Img(attr Attributes, children ...Block) Block

func Input

func Input(attr Attributes, children ...Block) Block

func Label

func Label(attr Attributes, children ...Block) Block

func Li

func Li(attr Attributes, children ...Block) Block
func Link(attr Attributes, children ...Block) Block

func Main

func Main(attr Attributes, children ...Block) Block

func Meta

func Meta(attr Attributes, children ...Block) Block
func Nav(attr Attributes, children ...Block) Block

func Noscript

func Noscript(attr Attributes, children ...Block) Block

func P

func P(attr Attributes, children ...Block) Block

func Pre

func Pre(attr Attributes, children ...Block) Block

func Script

func Script(attr Attributes, children ...Block) Block

func Span

func Span(attr Attributes, children ...Block) Block

func Strong

func Strong(attr Attributes, children ...Block) Block

func Style

func Style(attr Attributes, children ...Block) Block

func Textarea

func Textarea(attr Attributes, children ...Block) Block

func Title

func Title(attr Attributes, children ...Block) Block

func Ul

func Ul(attr Attributes, children ...Block) Block

type Blocks

type Blocks []Block

func (*Blocks) Add

func (b *Blocks) Add(block Block)

func (*Blocks) AddBlocks

func (b *Blocks) AddBlocks(blocks Blocks)

func (Blocks) RenderHTML

func (Blocks) RenderHTML() Block

type CSS

type CSS template.CSS

func (CSS) RenderHTML

func (CSS) RenderHTML() Block

type Comment

type Comment string

func (Comment) RenderHTML

func (Comment) RenderHTML() Block

type Element

type Element struct {
	Type string
	Attributes
	Children Blocks
	Options  Option
}

func (Element) RenderHTML

func (Element) RenderHTML() Block

type HTML

type HTML template.HTML

func (HTML) RenderHTML

func (HTML) RenderHTML() Block

type HTMLAttr

type HTMLAttr template.HTMLAttr

func (HTMLAttr) RenderHTML

func (HTMLAttr) RenderHTML() Block

type JS

type JS template.JS

func (JS) RenderHTML

func (JS) RenderHTML() Block

type JSStr

type JSStr template.JSStr

func (JSStr) RenderHTML

func (JSStr) RenderHTML() Block

type Option

type Option int8
const (
	Void Option = 1 << iota
	SelfClose
	CSSElement
	JSElement
	NoWhitespace
)

type Text

type Text string

func (Text) RenderHTML

func (Text) RenderHTML() Block

type URL

type URL template.URL

func (URL) RenderHTML

func (URL) RenderHTML() Block

type UnsafeString

type UnsafeString string

func (UnsafeString) RenderHTML

func (UnsafeString) RenderHTML() Block

Jump to

Keyboard shortcuts

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