mirror of
https://github.com/PuerkitoBio/goquery.git
synced 2024-04-21 12:31:36 +00:00
Update documentation to include manipulation functions
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
[](http://godoc.org/github.com/PuerkitoBio/goquery)
|
||||
|
||||
GoQuery brings a syntax and a set of features similar to [jQuery][] to the [Go language][go]. It is based on Go's [net/html package][html] and the CSS Selector library [cascadia][]. Since the net/html parser returns tokens (nodes), and not a full-featured DOM object, jQuery's manipulation and modification functions have been left off (no point in modifying data in the parsed tree of the HTML, it has no effect).
|
||||
GoQuery brings a syntax and a set of features similar to [jQuery][] to the [Go language][go]. It is based on Go's [net/html package][html] and the CSS Selector library [cascadia][]. Since the net/html parser returns tokens (nodes), and not a full-featured DOM object with a rendering engine, jQuery's stateful manipulation functions (like height(), css(), detach()) have been left off as they can't really be used.
|
||||
|
||||
Also, because the net/html parser requires UTF-8 encoding, so does goquery: it is the caller's responsibility to ensure that the source document provides UTF-8 encoded HTML.
|
||||
|
||||
|
||||
@@ -77,8 +77,17 @@ The various methods are split into files based on the category of behavior:
|
||||
- EachWithBreak()
|
||||
- Map()
|
||||
|
||||
* manipulation.go : methods for modifying the document
|
||||
- After...()
|
||||
- Append...()
|
||||
- Before...()
|
||||
- Clone()
|
||||
- Empty
|
||||
- Remove...()
|
||||
|
||||
* property.go : methods that inspect and get the node's properties values.
|
||||
- Attr()
|
||||
- Attr(), RemoveAttr(), SetAttr()
|
||||
- AddClass(), HasClass(), RemoveClass(), RemoveClasses(), ToggleClass()
|
||||
- Html()
|
||||
- Length()
|
||||
- Size(), which is an alias for Length()
|
||||
@@ -86,7 +95,6 @@ The various methods are split into files based on the category of behavior:
|
||||
|
||||
* query.go : methods that query, or reflect, a node's identity.
|
||||
- Contains()
|
||||
- HasClass()
|
||||
- Is...()
|
||||
|
||||
* traversal.go : methods to traverse the HTML document tree.
|
||||
|
||||
Reference in New Issue
Block a user