Skip to content

Commit

Permalink
fix bug and update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
foolin committed Apr 28, 2020
1 parent 3c978b7 commit fd6de97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
- [Install](#install)
- [Features](#features)
- [Docs](#docs)
- [Configuration](#configuration)
- [Usage](#usage)
- [Configuration](#configuration)
- [Struct Tag Grammar](#struct-tag-grammar)
- [Functions](#functions)
- [Builtin functions](#builtin-functions)
Expand Down Expand Up @@ -227,7 +227,7 @@ type ExamData struct {
> - eachTextJoin(sep) get each element text and join to string, return string.
> - nodeEq(index) reduces the set of matched elements to the one at the specified index, return Selection for nested struct.
> - eq(index) reduces the set of matched elements to the one at the specified index, return Selection for nested struct.
> - ...
Expand Down
11 changes: 6 additions & 5 deletions _examples/advance/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,21 @@ type PageData struct {
Title string `pagser:"title"`
H1 string `pagser:"h1"`
Navs []struct {
ID int `pagser:"->attrEmpty(id, -1)"`
Name string `pagser:"a"`
Url string `pagser:"a->attr(href)"`
ID int `pagser:"->attrEmpty(id, -1)"`
Name string `pagser:"a"`
Url string `pagser:"a->attr(href)"`
AbsUrl string `pagser:"a->absHref('https://github.com/foolin/pagser')"`
} `pagser:".navlink li"`
NavFirst struct {
ID int `pagser:"->attrEmpty(id, -1)"`
Name string `pagser:"a"`
Url string `pagser:"a->attr(href)"`
} `pagser:".navlink li->nodeEq(0)"`
} `pagser:".navlink li->eq(0)"`
NavLast *struct {
ID int `pagser:"->attrEmpty(id, -1)"`
Name string `pagser:"a"`
Url string `pagser:"a->attr(href)"`
} `pagser:".navlink li->nodeEq(-1)"`
} `pagser:".navlink li->eq(-1)"`
NavIds []int `pagser:".navlink li->eachAttrEmpty(id, -1)"`
NavTexts []string `pagser:".navlink li"`
NavEachTexts []string `pagser:".navlink li->eachText()"`
Expand Down

0 comments on commit fd6de97

Please sign in to comment.