summaryrefslogtreecommitdiff
path: root/indexHtml.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-10 07:34:58 -0600
committerJeff Carr <[email protected]>2024-02-10 07:34:58 -0600
commit51a8d8d7d2b2444d9186843646594576a73ee490 (patch)
tree238478d889bc8f5592fda90b11a1c00905fde1f6 /indexHtml.go
parent0fec5555ddd8574a831fb9e7e1d0b69a44b49a21 (diff)
add package descriptions
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'indexHtml.go')
-rw-r--r--indexHtml.go53
1 files changed, 28 insertions, 25 deletions
diff --git a/indexHtml.go b/indexHtml.go
index a00ef10..a809229 100644
--- a/indexHtml.go
+++ b/indexHtml.go
@@ -6,8 +6,6 @@ import (
"strconv"
"strings"
"time"
-
- "go.wit.com/log"
)
func indexHeader(w http.ResponseWriter) {
@@ -38,14 +36,14 @@ func indexBodyStart(w http.ResponseWriter) {
fmt.Fprintln(w, " <table class=\"u-full-width\">")
// fmt.Fprintln(w, " <thead>")
fmt.Fprintln(w, " <tr>")
- fmt.Fprintln(w, " <th>Package</th>")
+ fmt.Fprintln(w, " <th>Package (IPv6 only)</th>")
fmt.Fprintln(w, " <th>Version</th>")
fmt.Fprintln(w, " <th>Age</th>")
fmt.Fprintln(w, " <th>Dev Version</th>")
- fmt.Fprintln(w, " <th>go get</th>")
- fmt.Fprintln(w, " <th>Authoritative sources (IPv6 only)</th>")
- fmt.Fprintln(w, " <th></th>")
- fmt.Fprintln(w, " <th>Documentation</th>")
+ fmt.Fprintln(w, " <th>Description</th>")
+ // fmt.Fprintln(w, " <th>Authoritative sources (IPv6 only)</th>")
+ // fmt.Fprintln(w, " <th></th>")
+ fmt.Fprintln(w, " <th>GO Docs</th>")
fmt.Fprintln(w, " </tr>")
// fmt.Fprintln(w, " </thead>")
fmt.Fprintln(w, " <tbody>")
@@ -58,7 +56,7 @@ func insertHTMLnote(w http.ResponseWriter, i int, parts []string) {
}
func indexBodyScanConfig(w http.ResponseWriter) {
- log.Info("indexBodyScanConfig() START")
+ // log.Info("indexBodyScanConfig() START")
for i, line := range configfile {
// log.Info("config file line:", i, line)
fields := strings.Fields(line)
@@ -71,24 +69,34 @@ func indexBodyScanConfig(w http.ResponseWriter) {
continue
}
if len(fields) == 2 {
- log.Info("short file line:", i, line)
+ // log.Info("short file line:", i, line)
gourl := fields[0]
giturl := fields[1]
indexBodyRepo(w, gourl, giturl, "")
continue
}
- log.Info("config file line:", i, line)
+ if len(fields) > 2 {
+ // log.Info("short file line:", i, line)
+ gourl := fields[0]
+ giturl := fields[1]
+ desc := strings.Join(fields[2:], " ")
+ desc = strings.TrimSpace(desc)
+ indexBodyRepo(w, gourl, giturl, desc)
+ continue
+ }
+ // log.Info("config file line:", i, line)
}
- log.Info("indexBodyScanConfig() END")
+ // log.Info("indexBodyScanConfig() END")
}
-func indexBodyRepo(w http.ResponseWriter, gourl string, giturl string, github string) {
+func indexBodyRepo(w http.ResponseWriter, gourl string, giturl string, desc string) {
// fmt.Fprintln(w, " <tr> <td><h5>log/ (needed for the gui)</h5></td> <td></td> <td></td> <td></td> <td></td> </tr>")
fmt.Fprintln(w, " <tr>")
- fmt.Fprintln(w, " <td>"+gourl+"</td>")
- for i, s := range versionMap {
- log.Println("found i =", i, "with", "s =", s)
- }
+ // fmt.Fprintln(w, " <td>"+gourl+"</td>")
+ fmt.Fprintln(w, " <td> <a href=\"//"+gourl+"\">"+gourl+"</a></td>")
+ // for i, s := range versionMap {
+ // log.Println("found i =", i, "with", "s =", s)
+ // }
var vtime, version string
gourl = strings.TrimSpace(gourl)
tmp, _ := versionMap[gourl]
@@ -117,16 +125,11 @@ func indexBodyRepo(w http.ResponseWriter, gourl string, giturl string, github st
}
fmt.Fprintln(w, " <td>"+version+"</td>") // version
- fmt.Fprintln(w, " <td>"+ vtime +"</td>") // dev version
+ fmt.Fprintln(w, " <td>"+vtime+"</td>") // dev version
fmt.Fprintln(w, " <td></td>") // dev version
- fmt.Fprintln(w, " <td> <a href=\"//"+gourl+"\">"+gourl+"</a></td>")
- fmt.Fprintln(w, " <td> <a href=\"//"+gourl+"\">"+giturl+"</a></td>")
- if github == "" {
- fmt.Fprintln(w, " <td></td>")
- } else {
- fmt.Fprintln(w, " <td> <a href=\"//github.com/wit-go/log\">github.com/wit-go/log</a></td>")
- }
- fmt.Fprintln(w, " <td> <a href=\"//pkg.go.dev/"+gourl+"\"> <img src=\"goReference.svg\" alt=\"pkg.go.dev docs\" /> </a> </td>")
+ fmt.Fprintln(w, " <td>"+desc+"</td>")
+ // fmt.Fprintln(w, " <td> <a href=\"//"+gourl+"\">"+giturl+"</a></td>")
+ fmt.Fprintln(w, " <td> <a href=\"//pkg.go.dev/"+gourl+"\"> <img src=\"goReference.svg\" alt=\"pkg.go.dev\" /> </a> </td>")
fmt.Fprintln(w, " </tr>")
fmt.Fprintln(w, "")
}