Documentation ¶
Index ¶
- func Render(blocks Block, minified bool) string
- func RenderMinified(root Block, w io.Writer) error
- func RenderMinifiedString(root Block) (string, error)
- func RenderString(root Block) (string, error)
- func RenderToWriter(w io.Writer, root Block) error
- type AttrPair
- type Attributes
- func Action(action interface{}) Attributes
- func Alt(name interface{}) Attributes
- func Attr(key string, value interface{}) Attributes
- func Charset(charset interface{}) Attributes
- func Checked() Attributes
- func Class(class interface{}) Attributes
- func Content(name interface{}) Attributes
- func Data(key string, value interface{}) Attributes
- func Defer() Attributes
- func For(fo interface{}) Attributes
- func Href(href interface{}) Attributes
- func ID(id interface{}) Attributes
- func Method(method interface{}) Attributes
- func Name(name interface{}) Attributes
- func Rel(rel interface{}) Attributes
- func Src(src interface{}) Attributes
- func Styles(style string) Attributes
- func Type(typ interface{}) Attributes
- func Value(value interface{}) Attributes
- func (a Attributes) Action(action interface{}) Attributes
- func (a Attributes) Alt(name interface{}) Attributes
- func (a Attributes) Attr(key string, id interface{}) Attributes
- func (a Attributes) Charset(charset interface{}) Attributes
- func (a Attributes) Checked() Attributes
- func (a Attributes) Class(class interface{}) Attributes
- func (a Attributes) Content(name interface{}) Attributes
- func (a Attributes) Data(key string, value interface{}) Attributes
- func (a Attributes) Defer() Attributes
- func (a Attributes) For(fo interface{}) Attributes
- func (a Attributes) Href(href interface{}) Attributes
- func (a Attributes) ID(id interface{}) Attributes
- func (a Attributes) Method(method interface{}) Attributes
- func (a Attributes) Name(name interface{}) Attributes
- func (a Attributes) Rel(rel interface{}) Attributes
- func (a Attributes) Src(src interface{}) Attributes
- func (a Attributes) Styles(style string) Attributes
- func (a Attributes) Type(typ interface{}) Attributes
- func (a Attributes) Value(value interface{}) Attributes
- type Block
- func A(attr Attributes, children ...Block) Block
- func Abbr(attr Attributes, children ...Block) Block
- func Acronym(attr Attributes, children ...Block) Block
- func Address(attr Attributes, children ...Block) Block
- func Area(attr Attributes) Block
- func Article(attr Attributes, children ...Block) Block
- func Aside(attr Attributes, children ...Block) Block
- func Audio(attr Attributes, children ...Block) Block
- func B(attr Attributes, children ...Block) Block
- func Base(attr Attributes) Block
- func Bdi(attr Attributes, children ...Block) Block
- func Bdo(attr Attributes, children ...Block) Block
- func Big(attr Attributes, children ...Block) Block
- func Blockquote(attr Attributes, children ...Block) Block
- func Body(attr Attributes, children ...Block) Block
- func Br() Block
- func Button(attr Attributes, children ...Block) Block
- func Canvas(attr Attributes, children ...Block) Block
- func Caption(attr Attributes, children ...Block) Block
- func Cite(attr Attributes, children ...Block) Block
- func Col(attr Attributes) Block
- func Colgroup(attr Attributes, children ...Block) Block
- func Datalist(attr Attributes, children ...Block) Block
- func Dd(attr Attributes, children ...Block) Block
- func Del(attr Attributes, children ...Block) Block
- func Details(attr Attributes, children ...Block) Block
- func Dfn(attr Attributes, children ...Block) Block
- func Dialog(attr Attributes, children ...Block) Block
- func Dir(attr Attributes, children ...Block) Block
- func Div(attr Attributes, children ...Block) Block
- func Dl(attr Attributes, children ...Block) Block
- func Doctype(arg string) Block
- func Dt(attr Attributes, children ...Block) Block
- func Elem(el string, attr Attributes, children ...Block) Block
- func Em(attr Attributes, children ...Block) Block
- func Embed(attr Attributes) Block
- func Fieldset(attr Attributes, children ...Block) Block
- func Figcaption(attr Attributes, children ...Block) Block
- func Figure(attr Attributes, children ...Block) Block
- func Footer(attr Attributes, children ...Block) Block
- func Form(attr Attributes, children ...Block) Block
- func Frameset(attr Attributes, children ...Block) Block
- func H1(attr Attributes, children ...Block) Block
- func H2(attr Attributes, children ...Block) Block
- func H3(attr Attributes, children ...Block) Block
- func H4(attr Attributes, children ...Block) Block
- func H5(attr Attributes, children ...Block) Block
- func H6(attr Attributes, children ...Block) Block
- func Head(attr Attributes, children ...Block) Block
- func Header(attr Attributes, children ...Block) Block
- func Hr(attr Attributes) Block
- func Html(attr Attributes, children ...Block) Block
- func I(attr Attributes, children ...Block) Block
- func Iframe(attr Attributes, children ...Block) Block
- func Img(attr Attributes) Block
- func Input(attr Attributes) Block
- func Ins(attr Attributes, children ...Block) Block
- func Kbd(attr Attributes, children ...Block) Block
- func Label(attr Attributes, children ...Block) Block
- func Legend(attr Attributes, children ...Block) Block
- func Li(attr Attributes, children ...Block) Block
- func Link(attr Attributes) Block
- func Main(attr Attributes, children ...Block) Block
- func Map(attr Attributes, children ...Block) Block
- func Mark(attr Attributes, children ...Block) Block
- func Meta(attr Attributes, children ...Block) Block
- func Meter(attr Attributes, children ...Block) Block
- func Nav(attr Attributes, children ...Block) Block
- func Noframes(attr Attributes, children ...Block) Block
- func Noscript(attr Attributes, children ...Block) Block
- func Object(attr Attributes) Block
- func Ol(attr Attributes, children ...Block) Block
- func Optgroup(attr Attributes, children ...Block) Block
- func Option(attr Attributes, children ...Block) Block
- func Output(attr Attributes) Block
- func P(attr Attributes, children ...Block) Block
- func Param(attr Attributes) Block
- func Picture(attr Attributes, children ...Block) Block
- func Pre(attr Attributes, children ...Block) Block
- func Progress(attr Attributes) Block
- func Q(attr Attributes, children ...Block) Block
- func Rp(attr Attributes, children ...Block) Block
- func Rt(attr Attributes, children ...Block) Block
- func Ruby(attr Attributes, children ...Block) Block
- func S(attr Attributes, children ...Block) Block
- func Samp(attr Attributes, children ...Block) Block
- func Script(attr Attributes, children ...Block) Block
- func Section(attr Attributes, children ...Block) Block
- func Select(attr Attributes, children ...Block) Block
- func Small(attr Attributes, children ...Block) Block
- func Source(attr Attributes) Block
- func Span(attr Attributes, children ...Block) Block
- func Strike(attr Attributes, children ...Block) Block
- func Strong(attr Attributes, children ...Block) Block
- func Style(attr Attributes, children ...Block) Block
- func Sub(attr Attributes, children ...Block) Block
- func Summary(attr Attributes, children ...Block) Block
- func Sup(attr Attributes, children ...Block) Block
- func Svg(attr Attributes, children ...Block) Block
- func Table(attr Attributes, children ...Block) Block
- func Tbody(attr Attributes, children ...Block) Block
- func Td(attr Attributes, children ...Block) Block
- func Template(attr Attributes, children ...Block) Block
- func Textarea(attr Attributes, children ...Block) Block
- func Tfoot(attr Attributes, children ...Block) Block
- func Th(attr Attributes, children ...Block) Block
- func Thead(attr Attributes, children ...Block) Block
- func Time(attr Attributes, children ...Block) Block
- func Title(attr Attributes, children ...Block) Block
- func Tr(attr Attributes, children ...Block) Block
- func Track(attr Attributes) Block
- func U(attr Attributes, children ...Block) Block
- func Ul(attr Attributes, children ...Block) Block
- func Var(attr Attributes, children ...Block) Block
- func Video(attr Attributes, children ...Block) Block
- func Wbr(attr Attributes, children ...Block) Block
- type Blocks
- type CSS
- type Comment
- type Element
- type ElementOption
- type HTML
- type HTMLAttr
- type JS
- type JSStr
- type Text
- type URL
- type UnsafeString
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderMinifiedString ¶
func RenderString ¶
Types ¶
type AttrPair ¶
type AttrPair struct { Key string Value interface{} }
AttrPair defines a n attribute key and value pair
type Attributes ¶
type Attributes []AttrPair
Attributes defines a list of attribute pairs
func Action ¶
func Action(action interface{}) Attributes
func Alt ¶
func Alt(name interface{}) Attributes
func Attr ¶
func Attr(key string, value interface{}) Attributes
Attr returns an attribute pair with the given key and value
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) Alt ¶
func (a Attributes) Alt(name interface{}) Attributes
func (Attributes) Attr ¶
func (a Attributes) Attr(key string, id interface{}) Attributes
Attr adds an attribute to the list of attribute pairs
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 Abbr ¶
func Abbr(attr Attributes, children ...Block) Block
func Acronym ¶
func Acronym(attr Attributes, children ...Block) Block
func Address ¶
func Address(attr Attributes, children ...Block) Block
func Area ¶
func Area(attr Attributes) Block
func Article ¶
func Article(attr Attributes, children ...Block) Block
func Aside ¶
func Aside(attr Attributes, children ...Block) Block
func Audio ¶
func Audio(attr Attributes, children ...Block) Block
func B ¶
func B(attr Attributes, children ...Block) Block
func Base ¶
func Base(attr Attributes) Block
func Bdi ¶
func Bdi(attr Attributes, children ...Block) Block
func Bdo ¶
func Bdo(attr Attributes, children ...Block) Block
func Big ¶
func Big(attr Attributes, children ...Block) Block
func Blockquote ¶
func Blockquote(attr Attributes, children ...Block) Block
func Body ¶
func Body(attr Attributes, children ...Block) Block
func Button ¶
func Button(attr Attributes, children ...Block) Block
func Canvas ¶
func Canvas(attr Attributes, children ...Block) Block
func Caption ¶
func Caption(attr Attributes, children ...Block) Block
func Cite ¶
func Cite(attr Attributes, children ...Block) Block
func Col ¶
func Col(attr Attributes) Block
func Colgroup ¶
func Colgroup(attr Attributes, children ...Block) Block
func Datalist ¶
func Datalist(attr Attributes, children ...Block) Block
func Dd ¶
func Dd(attr Attributes, children ...Block) Block
func Del ¶
func Del(attr Attributes, children ...Block) Block
func Details ¶
func Details(attr Attributes, children ...Block) Block
func Dfn ¶
func Dfn(attr Attributes, children ...Block) Block
func Dialog ¶
func Dialog(attr Attributes, children ...Block) Block
func Dir ¶
func Dir(attr Attributes, children ...Block) Block
func Div ¶
func Div(attr Attributes, children ...Block) Block
func Dl ¶
func Dl(attr Attributes, children ...Block) Block
func Dt ¶
func Dt(attr Attributes, children ...Block) Block
func Elem ¶
func Elem(el string, attr Attributes, children ...Block) Block
Elem returns a new ad-hoc element with the given name, attributes and children
func Em ¶
func Em(attr Attributes, children ...Block) Block
func Embed ¶
func Embed(attr Attributes) Block
func Fieldset ¶
func Fieldset(attr Attributes, children ...Block) Block
func Figcaption ¶
func Figcaption(attr Attributes, children ...Block) Block
func Figure ¶
func Figure(attr Attributes, children ...Block) Block
func Footer ¶
func Footer(attr Attributes, children ...Block) Block
func Form ¶
func Form(attr Attributes, children ...Block) Block
func Frameset ¶
func Frameset(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 ¶
func Head(attr Attributes, children ...Block) Block
func Header ¶
func Header(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) Block
func Input ¶
func Input(attr Attributes) Block
func Ins ¶
func Ins(attr Attributes, children ...Block) Block
func Kbd ¶
func Kbd(attr Attributes, children ...Block) Block
func Label ¶
func Label(attr Attributes, children ...Block) Block
func Legend ¶
func Legend(attr Attributes, children ...Block) Block
func Li ¶
func Li(attr Attributes, children ...Block) Block
func Link ¶
func Link(attr Attributes) Block
func Main ¶
func Main(attr Attributes, children ...Block) Block
func Map ¶
func Map(attr Attributes, children ...Block) Block
func Mark ¶
func Mark(attr Attributes, children ...Block) Block
func Meta ¶
func Meta(attr Attributes, children ...Block) Block
func Meter ¶
func Meter(attr Attributes, children ...Block) Block
func Nav ¶
func Nav(attr Attributes, children ...Block) Block
func Noframes ¶
func Noframes(attr Attributes, children ...Block) Block
func Noscript ¶
func Noscript(attr Attributes, children ...Block) Block
func Object ¶
func Object(attr Attributes) Block
func Ol ¶
func Ol(attr Attributes, children ...Block) Block
func Optgroup ¶
func Optgroup(attr Attributes, children ...Block) Block
func Option ¶
func Option(attr Attributes, children ...Block) Block
func Output ¶
func Output(attr Attributes) Block
func P ¶
func P(attr Attributes, children ...Block) Block
func Param ¶
func Param(attr Attributes) Block
func Picture ¶
func Picture(attr Attributes, children ...Block) Block
func Pre ¶
func Pre(attr Attributes, children ...Block) Block
func Progress ¶
func Progress(attr Attributes) Block
func Q ¶
func Q(attr Attributes, children ...Block) Block
func Rp ¶
func Rp(attr Attributes, children ...Block) Block
func Rt ¶
func Rt(attr Attributes, children ...Block) Block
func Ruby ¶
func Ruby(attr Attributes, children ...Block) Block
func S ¶
func S(attr Attributes, children ...Block) Block
func Samp ¶
func Samp(attr Attributes, children ...Block) Block
func Script ¶
func Script(attr Attributes, children ...Block) Block
func Section ¶
func Section(attr Attributes, children ...Block) Block
func Select ¶
func Select(attr Attributes, children ...Block) Block
func Small ¶
func Small(attr Attributes, children ...Block) Block
func Source ¶
func Source(attr Attributes) Block
func Span ¶
func Span(attr Attributes, children ...Block) Block
func Strike ¶
func Strike(attr Attributes, children ...Block) Block
func Strong ¶
func Strong(attr Attributes, children ...Block) Block
func Style ¶
func Style(attr Attributes, children ...Block) Block
func Sub ¶
func Sub(attr Attributes, children ...Block) Block
func Summary ¶
func Summary(attr Attributes, children ...Block) Block
func Sup ¶
func Sup(attr Attributes, children ...Block) Block
func Svg ¶
func Svg(attr Attributes, children ...Block) Block
func Table ¶
func Table(attr Attributes, children ...Block) Block
func Tbody ¶
func Tbody(attr Attributes, children ...Block) Block
func Td ¶
func Td(attr Attributes, children ...Block) Block
func Template ¶
func Template(attr Attributes, children ...Block) Block
func Textarea ¶
func Textarea(attr Attributes, children ...Block) Block
func Tfoot ¶
func Tfoot(attr Attributes, children ...Block) Block
func Th ¶
func Th(attr Attributes, children ...Block) Block
func Thead ¶
func Thead(attr Attributes, children ...Block) Block
func Time ¶
func Time(attr Attributes, children ...Block) Block
func Title ¶
func Title(attr Attributes, children ...Block) Block
func Tr ¶
func Tr(attr Attributes, children ...Block) Block
func Track ¶
func Track(attr Attributes) Block
func U ¶
func U(attr Attributes, children ...Block) Block
func Ul ¶
func Ul(attr Attributes, children ...Block) Block
func Var ¶
func Var(attr Attributes, children ...Block) Block
func Video ¶
func Video(attr Attributes, children ...Block) Block
func Wbr ¶
func Wbr(attr Attributes, children ...Block) Block
type Blocks ¶
type Blocks []Block
Blocks defines a list of HTML blocks
type Element ¶
type Element struct { Type string // The type of the element Attributes // The attributes for the element Children Blocks // The children for the element Options ElementOption // The options for the element }
Element defines a HTML element
func (Element) RenderHTML ¶
RenderHTML renders the element as HTML
type ElementOption ¶
type ElementOption int8
ElementOption defines the options for the elements
const ( // Void is the default (no options) Void ElementOption = 1 << iota // SelfClose defines the element as a self-closing element SelfClose // CSSElement defines the element as CSS element CSSElement // JSElement defines the element as a JS element JSElement // NoWhitespace defines that the element shouldn't add whitespace NoWhitespace )
type HTMLAttr ¶
func (HTMLAttr) RenderHTML ¶
type UnsafeString ¶
type UnsafeString string
func (UnsafeString) RenderHTML ¶
func (UnsafeString) RenderHTML() Block
Source Files ¶
Click to show internal directories.
Click to hide internal directories.