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 {
|
||||
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.IncreasePadding()
|
||||
for _, repo := range l.repositories {
|
||||
log.WithField("link", repo.link()).Info(repo.name)
|
||||
if repo.description != "" {
|
||||
for _, repo := range l.Repositories {
|
||||
log.Info(repo.Link())
|
||||
if repo.Description != "" {
|
||||
log.IncreasePadding()
|
||||
log.Info(repo.description)
|
||||
log.Info(repo.Description)
|
||||
log.DecreasePadding()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/PuerkitoBio/goquery"
|
||||
"github.com/muesli/termenv"
|
||||
)
|
||||
|
||||
func trendingLang(lang string, timeframes []string) (Language, error) {
|
||||
|
@ -69,6 +70,6 @@ type Repository struct {
|
|||
Description string `json:"description"`
|
||||
}
|
||||
|
||||
func (r Repository) link() string {
|
||||
return fmt.Sprintf("https://github.com/%s", r.Name)
|
||||
func (r Repository) Link() string {
|
||||
return termenv.Hyperlink(fmt.Sprintf("https://github.com/%s", r.Name), r.Name)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue