Documentation ¶
Overview ¶
Package html provides some basic data structures for declaring HTML elements using Go code.
Index ¶
- func Escape(s string) string
- func Minify(w io.Writer, r io.Reader) error
- func Unescape(s string) string
- type Attrs
- type Node
- func A(href, text string) *Node
- func Abbr(title, text string) *Node
- func Article(children ...*Node) *Node
- func Aside(children ...*Node) *Node
- func B(text string) *Node
- func Blockquote(text string) *Node
- func Br() *Node
- func Button(text string) *Node
- func Caption(text string) *Node
- func Div(children ...*Node) *Node
- func Em(text string) *Node
- func P(children ...*Node) *Node
- func Small(text string) *Node
- func Span(children ...*Node) *Node
- func Text(text string) *Node
- func (n *Node) AddAttr(name string, value interface{}) *Node
- func (n *Node) AddClass(cls string) *Node
- func (n *Node) Append(node *Node) *Node
- func (n *Node) AppendChild(c *Node)
- func (n *Node) AppendTo(node *Node) *Node
- func (n *Node) Attr(name string) string
- func (n *Node) DelAttr(name string) *Node
- func (n *Node) Disable(name string) *Node
- func (n *Node) Enable(name string) *Node
- func (n *Node) HTML() template.HTML
- func (n *Node) LastChild() *Node
- func (n *Node) NChildren() int
- func (n *Node) Prepend(node *Node) *Node
- func (n *Node) PrependTo(node *Node) *Node
- func (n *Node) RemoveAttr(name string, value interface{}) *Node
- func (n *Node) RemoveClass(cls string) *Node
- func (n *Node) Render(buf *bytes.Buffer)
- func (n *Node) SetAttr(name string, value interface{}) *Node
- func (n *Node) String() string
- func (n *Node) WriteTo(w io.Writer) (int, error)
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Minify ¶
Minify removes insignificant whitespace from the given HTML. Please, keep in mind that this function could break your HTML if you're using embedded scripts or if you rely on automatical semicolon insertion, because multiple whitespaces (' ', '\n', '\t' and '\r') will be collapsed into a single ' ' character. Formatting inside pre and textarea tags is preserved.
Types ¶
type Node ¶
type Node struct { Type Type Tag string Attrs Attrs Content string Next *Node Children *Node Open bool }
func Blockquote ¶
func (*Node) AppendChild ¶
func (*Node) RemoveAttr ¶
func (*Node) RemoveClass ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.