html

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2018 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ModuleName = "html.sky"

ModuleName defines the expected name for this Module when used in skylark's load() function, eg: load('html.sky', 'html')

Variables

This section is empty.

Functions

func NewDocument

func NewDocument(thread *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, kwargs []skylark.Tuple) (skylark.Value, error)

NewDocument creates a skylark selection from input text

func NewSelectionStruct

func NewSelectionStruct(s *goquery.Selection) *skylarkstruct.Struct

NewSelectionStruct creates a skylark struct from a goquery selection

Types

type Selection

type Selection struct {
	// contains filtered or unexported fields
}

Selection is a wrapper for a goquery selection mapping to skylark values

func (*Selection) Attr

func (s *Selection) Attr(thread *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, kwargs []skylark.Tuple) (skylark.Value, error)

Attr gets the specified attribute's value for the first element in the Selection. To get the value for each element individually, use a looping construct such as Each or Map method

func (*Selection) Children

func (s *Selection) Children(thread *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, kwargs []skylark.Tuple) (skylark.Value, error)

Children gets the child elements of each element in the Selection. It returns a new Selection object containing these elements

func (*Selection) ChildrenFiltered

func (s *Selection) ChildrenFiltered(thread *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, kwargs []skylark.Tuple) (skylark.Value, error)

ChildrenFiltered gets the child elements of each element in the Selection, filtered by the specified selector. It returns a new Selection object containing these elements

func (*Selection) Contents

func (s *Selection) Contents(thread *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, kwargs []skylark.Tuple) (skylark.Value, error)

Contents gets the children of each element in the Selection, including text and comment nodes. It returns a new Selection object containing these elements

func (*Selection) Filter

func (s *Selection) Filter(thread *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, kwargs []skylark.Tuple) (skylark.Value, error)

Filter reduces the set of matched elements to those that match the selector string. It returns a new Selection object for this subset of matching elements

func (*Selection) Find

func (s *Selection) Find(thread *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, kwargs []skylark.Tuple) (skylark.Value, error)

Find gets the descendants of each element in the current set of matched elements, filtered by a selector. It returns a new Selection object containing these matched element

func (*Selection) Get

func (s *Selection) Get(thread *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, kwargs []skylark.Tuple) (skylark.Value, error)

Get retrieves the underlying node at the specified index. Get without parameter is not implemented, since the node array is available on the Selection object

func (*Selection) Has

func (s *Selection) Has(thread *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, kwargs []skylark.Tuple) (skylark.Value, error)

Has reduces the set of matched elements to those that have a descendant that matches the selector. It returns a new Selection object with the matching elements

func (*Selection) Parent

func (s *Selection) Parent(thread *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, kwargs []skylark.Tuple) (skylark.Value, error)

Parent gets the parent of each element in the Selection. It returns a new Selection object containing the matched elements

func (*Selection) ParentsUntil

func (s *Selection) ParentsUntil(thread *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, kwargs []skylark.Tuple) (skylark.Value, error)

ParentsUntil gets the ancestors of each element in the Selection, up to but not including the element matched by the selector. It returns a new Selection object containing the matched elements

func (*Selection) Siblings

func (s *Selection) Siblings(thread *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, kwargs []skylark.Tuple) (skylark.Value, error)

Siblings gets the siblings of each element in the Selection. It returns a new Selection object containing the matched elements

func (*Selection) Struct

func (s *Selection) Struct() *skylarkstruct.Struct

Struct returns a skylark struct of methods

func (*Selection) Text

func (s *Selection) Text(thread *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, kwargs []skylark.Tuple) (skylark.Value, error)

Text gets the combined text contents of each element in the set of matched elements, including their descendants

Jump to

Keyboard shortcuts

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