Skip to content

Commit

Permalink
Update github.go
Browse files Browse the repository at this point in the history
  • Loading branch information
pacoxu authored Feb 28, 2022
1 parent 7000dba commit a00de61
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion github.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func makeMdTable(data [][]string, header []string) string {
table.SetBorders(tablewriter.Border{Left: true, Top: false, Right: true, Bottom: false})
table.SetCenterSeparator("|")
table.AppendBulk(data)
table.SetColWidth(300)
table.Render()
return tableString.String()
}
Expand All @@ -121,6 +122,13 @@ func makeReposString(repos []*github.Repository) string {
reposData := [][]string{}
for i, repo := range repos {
repoWithLink := fmt.Sprintf("[%s](%s)", *repo.Name, *repo.HTMLURL)
description := *repo.Description
if len(description) == 0 {
description = ""
} else {
fmt.Println(description)
description = strings.Replace(description, "\n", "<br>", -1)
}
reposData = append(
reposData,
[]string{
Expand All @@ -129,7 +137,7 @@ func makeReposString(repos []*github.Repository) string {
(*repo.UpdatedAt).String()[:10],
(*repo.CreatedAt).String()[:10],
strconv.Itoa(*repo.ForksCount),
strings.Replace(*repo.Description, "\n", "<br>", -1),
description,
},
)
}
Expand Down

0 comments on commit a00de61

Please sign in to comment.