change to hyperlinks
Signed-off-by: jolheiser <john.olheiser@gmail.com>main v0.0.2
parent
480035417b
commit
41648a142f
10
main.go
10
main.go
|
@ -34,14 +34,14 @@ func main() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithError(err).Fatal("could not get trending repositories")
|
log.WithError(err).Fatal("could not get trending repositories")
|
||||||
}
|
}
|
||||||
log.Styles[log.InfoLevel] = lipgloss.NewStyle().Foreground(lipgloss.Color(l.color)).Bold(true)
|
log.Styles[log.InfoLevel] = lipgloss.NewStyle().Foreground(lipgloss.Color(l.Color)).Bold(true)
|
||||||
log.Info(lang.Name)
|
log.Info(lang.Name)
|
||||||
log.IncreasePadding()
|
log.IncreasePadding()
|
||||||
for _, repo := range l.repositories {
|
for _, repo := range l.Repositories {
|
||||||
log.WithField("link", repo.link()).Info(repo.name)
|
log.Info(repo.Link())
|
||||||
if repo.description != "" {
|
if repo.Description != "" {
|
||||||
log.IncreasePadding()
|
log.IncreasePadding()
|
||||||
log.Info(repo.description)
|
log.Info(repo.Description)
|
||||||
log.DecreasePadding()
|
log.DecreasePadding()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/PuerkitoBio/goquery"
|
"github.com/PuerkitoBio/goquery"
|
||||||
|
"github.com/muesli/termenv"
|
||||||
)
|
)
|
||||||
|
|
||||||
func trendingLang(lang string, timeframes []string) (Language, error) {
|
func trendingLang(lang string, timeframes []string) (Language, error) {
|
||||||
|
@ -69,6 +70,6 @@ type Repository struct {
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r Repository) link() string {
|
func (r Repository) Link() string {
|
||||||
return fmt.Sprintf("https://github.com/%s", r.Name)
|
return termenv.Hyperlink(fmt.Sprintf("https://github.com/%s", r.Name), r.Name)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue