wq

package module
v0.0.0-...-1c93dcf Latest Latest
Warning

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

Go to latest
Published: May 4, 2021 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	Send func(wit.Delta) // Send will be called as a result of this node's methods
}

Node represents one or more HTML nodes

func (Node) AddClass

func (n Node) AddClass(class string) Node

AddClass adds the provided class to matching elements

func (Node) Append

func (n Node) Append(html interface{}) Node

Append appends content to matched elements

func (Node) Clear

func (n Node) Clear() Node

Clear empties matched elements

func (Node) FirstChild

func (n Node) FirstChild() Node

FirstChild matches the first child of matched elements

func (Node) HTML

func (n Node) HTML(html interface{}) Node

HTML sets the inner HTML of matched elements. Accepts either a string or an HTMLSource as argument.

func (Node) InsertAfter

func (n Node) InsertAfter(html interface{}) Node

InsertAfter inserts content after matched elements

func (Node) InsertBefore

func (n Node) InsertBefore(html interface{}) Node

InsertBefore inserts content before matched elements

func (Node) LastChild

func (n Node) LastChild() Node

LastChild matches the last child of matched elements

func (Node) NextSibling

func (n Node) NextSibling() Node

NextSibling matches the previous sibling of matched elements

func (Node) Parent

func (n Node) Parent() Node

Parent matches the parents of matched elements

func (Node) Prepend

func (n Node) Prepend(html interface{}) Node

Prepend prepends content to matched elements

func (Node) PrevSibling

func (n Node) PrevSibling() Node

PrevSibling matches the previous sibling of matched elements

func (Node) Remove

func (n Node) Remove() Node

Remove removes matched elements

func (Node) Replace

func (n Node) Replace(html interface{}) Node

Replace replaces matching elements with the provided HTML

func (Node) ReplaceAttr

func (n Node) ReplaceAttr(attr map[string]string) Node

ReplaceAttr replaces the attributes of matching elements

func (Node) RmAttr

func (n Node) RmAttr(attrs ...string) Node

RmAttr removes the provided attributes from matching elements

func (Node) RmClass

func (n Node) RmClass(class string) Node

RmClass removes the provided class from matching elements

func (Node) RmStyles

func (n Node) RmStyles(styles ...string) Node

RmStyles removes the provided styles from matching elements

func (Node) Root

func (n Node) Root() Node

Root matches the root node

func (Node) S

func (n Node) S(selector interface{}) Selector

S returns a Selector. Accepts either a string or a wit.Selector as parameter.

func (Node) SetAttr

func (n Node) SetAttr(attr map[string]string) Node

SetAttr sets the attributes of matching elements

func (Node) SetStyles

func (n Node) SetStyles(styles map[string]string) Node

SetStyles sets the styles of matching elements

func (Node) Text

func (n Node) Text(text string) Node

Text sets the text content of matched elements

func (Node) Tx

func (n Node) Tx() Tx

Tx starts a transaction against the current node

type Selector

type Selector struct {
	Node
	// contains filtered or unexported fields
}

Selector encapsulates a CSS selector. Must be initialised by Node.S()

func (Selector) First

func (s Selector) First() Node

First returns a Node that applies deltas to the first matching element

type Tx

type Tx struct {
	Commit func()
	Node
}

Tx represents a transaction

Jump to

Keyboard shortcuts

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