File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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()"`
You can’t perform that action at this time.
0 commit comments