Skip to content

Commit fb69613

Browse files
committed
Document @text, improve readme. Closes #78
1 parent ea281c3 commit fb69613

1 file changed

Lines changed: 28 additions & 21 deletions

File tree

README.md

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,34 @@ The end result is the following structure:
3131

3232
## Install
3333

34-
`cargo install html-query`
34+
`brew install hq`, or `cargo install html-query`
35+
36+
## Special query syntax
37+
38+
### Text
39+
40+
`.foo | @text`
41+
42+
This will select the text content from the first element matching `.foo`.
43+
44+
### Selecting attributes
45+
46+
`.foo | @(href)`
47+
48+
This will select the `href` attribute from the first element matching `.foo`.
49+
50+
### Parents
51+
52+
`.foo | @parent`
53+
54+
This will return the parent element from the first element matching `.foo`.
55+
56+
### Siblings
57+
58+
`.foo | @sibling(1)`
59+
60+
This will return the sibling element from the first element matching `.foo`.
61+
3562

3663
## Examples
3764

@@ -58,23 +85,3 @@ the _sibling_ `.athing` element, and extracts the user and post time from that:
5885
]
5986
}
6087
```
61-
62-
## Special query syntax
63-
64-
### Selecting attributes
65-
66-
`.foo | @(href)`
67-
68-
This will select the `href` attribute from the first element matching `.foo`.
69-
70-
### Parents
71-
72-
`.foo | @parent`
73-
74-
This will return the parent element from the first element matching `.foo`.
75-
76-
### Siblings
77-
78-
`.foo | @sibling(1)`
79-
80-
This will return the sibling element from the first element matching `.foo`.

0 commit comments

Comments
 (0)