Documentation
¶
Index ¶
- func If[T any](condition bool, ifTrue, ifFalse T) T
- type CSSGenerator
- type CommentNode
- type Element
- func A(attrs attrs.Props, children ...Node) *Element
- func Abbr(attrs attrs.Props, children ...Node) *Element
- func Address(attrs attrs.Props, children ...Node) *Element
- func Area(attrs attrs.Props) *Element
- func Article(attrs attrs.Props, children ...Node) *Element
- func Aside(attrs attrs.Props, children ...Node) *Element
- func Audio(attrs attrs.Props, children ...Node) *Element
- func B(attrs attrs.Props, children ...Node) *Element
- func Base(attrs attrs.Props) *Element
- func Blockquote(attrs attrs.Props, children ...Node) *Element
- func Body(attrs attrs.Props, children ...Node) *Element
- func Br(attrs attrs.Props) *Element
- func Button(attrs attrs.Props, children ...Node) *Element
- func Cite(attrs attrs.Props, children ...Node) *Element
- func Code(attrs attrs.Props, children ...Node) *Element
- func Data(attrs attrs.Props, children ...Node) *Element
- func Datalist(attrs attrs.Props, children ...Node) *Element
- func Dd(attrs attrs.Props, children ...Node) *Element
- func Details(attrs attrs.Props, children ...Node) *Element
- func Dialog(attrs attrs.Props, children ...Node) *Element
- func Div(attrs attrs.Props, children ...Node) *Element
- func Dl(attrs attrs.Props, children ...Node) *Element
- func Dt(attrs attrs.Props, children ...Node) *Element
- func Em(attrs attrs.Props, children ...Node) *Element
- func Fieldset(attrs attrs.Props, children ...Node) *Element
- func FigCaption(attrs attrs.Props, children ...Node) *Element
- func Figure(attrs attrs.Props, children ...Node) *Element
- func Footer(attrs attrs.Props, children ...Node) *Element
- func Form(attrs attrs.Props, children ...Node) *Element
- func H1(attrs attrs.Props, children ...Node) *Element
- func H2(attrs attrs.Props, children ...Node) *Element
- func H3(attrs attrs.Props, children ...Node) *Element
- func H4(attrs attrs.Props, children ...Node) *Element
- func H5(attrs attrs.Props, children ...Node) *Element
- func H6(attrs attrs.Props, children ...Node) *Element
- func Head(attrs attrs.Props, children ...Node) *Element
- func Header(attrs attrs.Props, children ...Node) *Element
- func Hgroup(attrs attrs.Props, children ...Node) *Element
- func Hr(attrs attrs.Props) *Element
- func Html(attrs attrs.Props, children ...Node) *Element
- func I(attrs attrs.Props, children ...Node) *Element
- func IFrame(attrs attrs.Props, children ...Node) *Element
- func Img(attrs attrs.Props) *Element
- func Input(attrs attrs.Props) *Element
- func Kbd(attrs attrs.Props, children ...Node) *Element
- func Label(attrs attrs.Props, children ...Node) *Element
- func Legend(attrs attrs.Props, children ...Node) *Element
- func Li(attrs attrs.Props, children ...Node) *Element
- func Link(attrs attrs.Props) *Element
- func Main(attrs attrs.Props, children ...Node) *Element
- func Map(attrs attrs.Props, children ...Node) *Element
- func Mark(attrs attrs.Props, children ...Node) *Element
- func Menu(attrs attrs.Props, children ...Node) *Element
- func Meta(attrs attrs.Props) *Element
- func Meter(attrs attrs.Props, children ...Node) *Element
- func Nav(attrs attrs.Props, children ...Node) *Element
- func NoScript(attrs attrs.Props, children ...Node) *Element
- func Ol(attrs attrs.Props, children ...Node) *Element
- func Optgroup(attrs attrs.Props, children ...Node) *Element
- func Option(attrs attrs.Props, content TextNode) *Element
- func Output(attrs attrs.Props, children ...Node) *Element
- func P(attrs attrs.Props, children ...Node) *Element
- func Pre(attrs attrs.Props, children ...Node) *Element
- func Progress(attrs attrs.Props, children ...Node) *Element
- func Q(attrs attrs.Props, children ...Node) *Element
- func Rp(attrs attrs.Props, children ...Node) *Element
- func Rt(attrs attrs.Props, children ...Node) *Element
- func Ruby(attrs attrs.Props, children ...Node) *Element
- func Samp(attrs attrs.Props, children ...Node) *Element
- func Script(attrs attrs.Props, children ...Node) *Element
- func Section(attrs attrs.Props, children ...Node) *Element
- func Select(attrs attrs.Props, children ...Node) *Element
- func Small(attrs attrs.Props, children ...Node) *Element
- func Source(attrs attrs.Props, children ...Node) *Element
- func Span(attrs attrs.Props, children ...Node) *Element
- func Strong(attrs attrs.Props, children ...Node) *Element
- func Style(attrs attrs.Props, children ...Node) *Element
- func Sub(attrs attrs.Props, children ...Node) *Element
- func Summary(attrs attrs.Props, children ...Node) *Element
- func Sup(attrs attrs.Props, children ...Node) *Element
- func TBody(attrs attrs.Props, children ...Node) *Element
- func TFoot(attrs attrs.Props, children ...Node) *Element
- func THead(attrs attrs.Props, children ...Node) *Element
- func Table(attrs attrs.Props, children ...Node) *Element
- func Td(attrs attrs.Props, children ...Node) *Element
- func Textarea(attrs attrs.Props, content TextNode) *Element
- func Th(attrs attrs.Props, children ...Node) *Element
- func Time(attrs attrs.Props, children ...Node) *Element
- func Title(attrs attrs.Props, children ...Node) *Element
- func Tr(attrs attrs.Props, children ...Node) *Element
- func U(attrs attrs.Props, children ...Node) *Element
- func Ul(attrs attrs.Props, children ...Node) *Element
- func Var(attrs attrs.Props, children ...Node) *Element
- func Video(attrs attrs.Props, children ...Node) *Element
- type Node
- type NoneNode
- type RawNode
- type RenderOptions
- type TextNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CSSGenerator ¶ added in v0.25.0
type CSSGenerator interface {
GenerateCSS() string // TODO: Change to CSS()
}
type CommentNode ¶ added in v0.13.0
type CommentNode string
func Comment ¶ added in v0.13.0
func Comment(comment string) CommentNode
Comment creates a CommentNode.
func (CommentNode) Render ¶ added in v0.13.0
func (c CommentNode) Render() string
func (CommentNode) RenderTo ¶ added in v0.13.0
func (c CommentNode) RenderTo(builder *strings.Builder, opts RenderOptions)
func (CommentNode) RenderWithOptions ¶ added in v0.17.0
func (c CommentNode) RenderWithOptions(opts RenderOptions) string
type Element ¶
func Blockquote ¶ added in v0.2.0
Blockquote creates a <blockquote> element.
func FigCaption ¶ added in v0.10.0
FigCaption creates a <figcaption> element.
func Optgroup ¶ added in v0.17.0
Optgroup creates an <optgroup> element to group <option>s within a <select> element.
func (*Element) RenderTo ¶ added in v0.4.0
func (e *Element) RenderTo(builder *strings.Builder, opts RenderOptions)
func (*Element) RenderWithOptions ¶ added in v0.17.0
func (e *Element) RenderWithOptions(opts RenderOptions) string
type Node ¶ added in v0.5.0
type Node interface { RenderTo(builder *strings.Builder, opts RenderOptions) Render() string RenderWithOptions(opts RenderOptions) string }
func TransformEach ¶
TransformEach maps a slice of items to a slice of Elements using the provided function
type NoneNode ¶ added in v0.16.0
type NoneNode struct{}
NoneNode represents a node that renders nothing.
func None ¶ added in v0.16.0
func None() NoneNode
None creates a NoneNode, representing a no-operation in rendering.
func (NoneNode) RenderTo ¶ added in v0.16.0
func (n NoneNode) RenderTo(builder *strings.Builder, opts RenderOptions)
RenderTo for NoneNode does nothing.
func (NoneNode) RenderWithOptions ¶ added in v0.17.0
func (n NoneNode) RenderWithOptions(opts RenderOptions) string
RenderWithOptions for NoneNode returns an empty string.
type RawNode ¶ added in v0.15.0
type RawNode string
func (RawNode) RenderTo ¶ added in v0.15.0
func (r RawNode) RenderTo(builder *strings.Builder, opts RenderOptions)
func (RawNode) RenderWithOptions ¶ added in v0.17.0
func (t RawNode) RenderWithOptions(opts RenderOptions) string
type RenderOptions ¶ added in v0.17.0
type RenderOptions struct { // DisableHtmlPreamble disables the doctype preamble for the HTML tag if it exists in the rendering tree DisableHtmlPreamble bool StyleManager CSSGenerator }
type TextNode ¶ added in v0.5.0
type TextNode string
func (TextNode) RenderTo ¶ added in v0.5.0
func (t TextNode) RenderTo(builder *strings.Builder, opts RenderOptions)
func (TextNode) RenderWithOptions ¶ added in v0.17.0
func (t TextNode) RenderWithOptions(opts RenderOptions) string
Click to show internal directories.
Click to hide internal directories.