Skip to content

Commit fd6de97

Browse files
committed
fix bug and update docs.
1 parent 3c978b7 commit fd6de97

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
- [Install](#install)
1212
- [Features](#features)
1313
- [Docs](#docs)
14-
- [Configuration](#configuration)
1514
- [Usage](#usage)
15+
- [Configuration](#configuration)
1616
- [Struct Tag Grammar](#struct-tag-grammar)
1717
- [Functions](#functions)
1818
- [Builtin functions](#builtin-functions)
@@ -227,7 +227,7 @@ type ExamData struct {
227227
228228
> - eachTextJoin(sep) get each element text and join to string, return string.
229229
230-
> - nodeEq(index) reduces the set of matched elements to the one at the specified index, return Selection for nested struct.
230+
> - eq(index) reduces the set of matched elements to the one at the specified index, return Selection for nested struct.
231231
232232
> - ...
233233

_examples/advance/main.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,21 @@ type PageData struct {
3636
Title string `pagser:"title"`
3737
H1 string `pagser:"h1"`
3838
Navs []struct {
39-
ID int `pagser:"->attrEmpty(id, -1)"`
40-
Name string `pagser:"a"`
41-
Url string `pagser:"a->attr(href)"`
39+
ID int `pagser:"->attrEmpty(id, -1)"`
40+
Name string `pagser:"a"`
41+
Url string `pagser:"a->attr(href)"`
42+
AbsUrl string `pagser:"a->absHref('https://github.com/foolin/pagser')"`
4243
} `pagser:".navlink li"`
4344
NavFirst struct {
4445
ID int `pagser:"->attrEmpty(id, -1)"`
4546
Name string `pagser:"a"`
4647
Url string `pagser:"a->attr(href)"`
47-
} `pagser:".navlink li->nodeEq(0)"`
48+
} `pagser:".navlink li->eq(0)"`
4849
NavLast *struct {
4950
ID int `pagser:"->attrEmpty(id, -1)"`
5051
Name string `pagser:"a"`
5152
Url string `pagser:"a->attr(href)"`
52-
} `pagser:".navlink li->nodeEq(-1)"`
53+
} `pagser:".navlink li->eq(-1)"`
5354
NavIds []int `pagser:".navlink li->eachAttrEmpty(id, -1)"`
5455
NavTexts []string `pagser:".navlink li"`
5556
NavEachTexts []string `pagser:".navlink li->eachText()"`

0 commit comments

Comments
 (0)