als-document 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/parser/readme.md +1 -1
- package/query/readme.md +1 -1
- package/readme.md +9 -25
- package/selector/readme.md +4 -4
- package/selector/test.js +1 -1
package/package.json
CHANGED
package/parser/readme.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
HtmlParser is a class which build dom tree from html string.
|
|
4
4
|
|
|
5
5
|
* HtmlParser removes all html comments and they not included in dom tree.
|
|
6
|
-
* Contrary to regular dom, attribute includes class,id and style as attribute in addition to classList, id and style(as array).
|
|
6
|
+
* Contrary to regular dom, attribute includes class,id and style as attribute in addition to classList, id and style(as array) inside element's object.
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### Syntax
|
package/query/readme.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
## Query
|
|
2
|
-
Query is a class for parsing
|
|
2
|
+
Query is a class for parsing selectors inside html query. Query not supporting pseudo selectors so far.
|
|
3
3
|
You can use Query on frontend and on backend.
|
|
4
4
|
|
|
5
5
|
Query can be used on fronten and on backend.
|
package/readme.md
CHANGED
|
@@ -1,29 +1,13 @@
|
|
|
1
1
|
# Als-document
|
|
2
2
|
|
|
3
|
-
Builded from
|
|
3
|
+
Builded from scratch and tested.
|
|
4
4
|
All tested with als-test.
|
|
5
5
|
|
|
6
|
-
Als-document is a library which includes 3
|
|
6
|
+
Als-document is a library which includes 3 instruments:
|
|
7
7
|
* Html parser - for fast html string parsing and building dom tree
|
|
8
|
-
* Html query parser - for destructing css/html query to selectors
|
|
8
|
+
* Html query parser - for destructing css/html query to selectors to array of objects
|
|
9
9
|
* Html selector - for selecting elements with css/html query inside parsed dom tree
|
|
10
10
|
|
|
11
|
-
- [Als-document](#als-document)
|
|
12
|
-
- [Selector](#selector)
|
|
13
|
-
- [Basics](#basics)
|
|
14
|
-
- [FrontEnd usage](#frontend-usage)
|
|
15
|
-
- [BackEnd usage](#backend-usage)
|
|
16
|
-
- [Extra abilities](#extra-abilities)
|
|
17
|
-
- [HtmlParser](#htmlparser)
|
|
18
|
-
- [Syntax](#syntax)
|
|
19
|
-
- [Frontend example](#frontend-example)
|
|
20
|
-
- [Backend example](#backend-example)
|
|
21
|
-
- [Query](#query)
|
|
22
|
-
- [Syntax](#syntax-1)
|
|
23
|
-
- [Example](#example)
|
|
24
|
-
- [Attribs and check function](#attribs-and-check-function)
|
|
25
|
-
|
|
26
|
-
|
|
27
11
|
## Selector
|
|
28
12
|
|
|
29
13
|
Selector is a class which uses HtmlParser for parsing html and Query for parsing html/css query.
|
|
@@ -41,10 +25,10 @@ doc.$$(query:string):array
|
|
|
41
25
|
doc.$(query:string).$(query:qeury).$$(query:qeury)
|
|
42
26
|
```
|
|
43
27
|
|
|
44
|
-
``query`` - html/css query for selecting
|
|
45
|
-
``$`` - method return first element or null
|
|
46
|
-
``$$`` - return collection or empty array
|
|
47
|
-
Each element, has ``$`` and ``$$`` methods for selecting descendants
|
|
28
|
+
* ``query`` - html/css query for selecting
|
|
29
|
+
* ``$`` - method return first element or null
|
|
30
|
+
* ``$$`` - return collection or empty array
|
|
31
|
+
* Each element, has ``$`` and ``$$`` methods for selecting descendants
|
|
48
32
|
|
|
49
33
|
|
|
50
34
|
**Example**
|
|
@@ -103,7 +87,7 @@ doc.$('[inner$="00"]') //innerText ends with ".00"
|
|
|
103
87
|
HtmlParser is a class which build dom tree from html string.
|
|
104
88
|
|
|
105
89
|
* HtmlParser removes all html comments and they not included in dom tree.
|
|
106
|
-
* Contrary to regular dom, attribute includes class,id and style as attribute in addition to classList, id and style(as array).
|
|
90
|
+
* Contrary to regular dom, attribute includes class,id and style as attribute in addition to classList, id and style(as array) inside element's object.
|
|
107
91
|
|
|
108
92
|
|
|
109
93
|
### Syntax
|
|
@@ -220,7 +204,7 @@ console.log(HtmlParser.parse(html))
|
|
|
220
204
|
|
|
221
205
|
|
|
222
206
|
## Query
|
|
223
|
-
Query is a class for parsing
|
|
207
|
+
Query is a class for parsing selectors inside html query. Query not supporting pseudo selectors so far.
|
|
224
208
|
You can use Query on frontend and on backend.
|
|
225
209
|
|
|
226
210
|
Query can be used on fronten and on backend.
|
package/selector/readme.md
CHANGED
|
@@ -15,10 +15,10 @@ doc.$$(query:string):array
|
|
|
15
15
|
doc.$(query:string).$(query:qeury).$$(query:qeury)
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
``query`` - html/css query for selecting
|
|
19
|
-
``$`` - method return first element or null
|
|
20
|
-
``$$`` - return collection or empty array
|
|
21
|
-
Each element, has ``$`` and ``$$`` methods for selecting descendants
|
|
18
|
+
* ``query`` - html/css query for selecting
|
|
19
|
+
* ``$`` - method return first element or null
|
|
20
|
+
* ``$$`` - return collection or empty array
|
|
21
|
+
* Each element, has ``$`` and ``$$`` methods for selecting descendants
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
**Example**
|
package/selector/test.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
let Test = require('als-test')
|
|
2
2
|
// const HtmlSelector = require('./selector')
|
|
3
|
-
const {HtmlSelector} = require('
|
|
3
|
+
const {HtmlSelector} = require('als-document')
|
|
4
4
|
let {equal,greater,smaller,$greater, $smaller} = Test
|
|
5
5
|
|
|
6
6
|
module.exports = new Test('Selector tests',[
|