Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/weisjohn/cssrefs
Package cssrefs returns a slice of `Reference{URI, Token string}`s from an `io.Reader`.
https://github.com/weisjohn/cssrefs
Last synced: about 2 months ago
JSON representation
Package cssrefs returns a slice of `Reference{URI, Token string}`s from an `io.Reader`.
- Host: GitHub
- URL: https://github.com/weisjohn/cssrefs
- Owner: weisjohn
- License: mit
- Created: 2015-02-17T04:15:03.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-17T23:41:40.000Z (almost 10 years ago)
- Last Synced: 2024-06-21T12:52:27.043Z (7 months ago)
- Language: Go
- Size: 141 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cssrefs
Package cssrefs returns a slice of `Reference{URI, Token string}`s from an `io.Reader`.
### usage
```go
package mainimport (
"fmt"
"net/http""github.com/weisjohn/cssrefs"
)func main() {
resp, _ := http.Get("http://johnweis.com/css/main.css")
refs := cssrefs.All(resp.Body)for _, ref := range refs {
fmt.Println(ref.Token, ":", ref.URI)
}
}
```### output
```bash
$ go run example-cssrefs.go
css : fineprint.css
font : ../fonts/bootstrap/glyphicons-halflings-regular.eot
font : ../fonts/bootstrap/glyphicons-halflings-regular.eot?#iefix
font : ../fonts/bootstrap/glyphicons-halflings-regular.woff
font : ../fonts/bootstrap/glyphicons-halflings-regular.ttf
font : ../fonts/bootstrap/glyphicons-halflings-regular.svg#glyphicons_halflingsregular
img : ../img/[email protected]
img : ../img/light_honeycomb.png
```### struct
`cssrefs` returns a slice of `Reference`s
```go
type Reference struct {
URI, Token string
}
```### credits
Inspired by https://github.com/weisjohn/htmlrefs