summaryrefslogtreecommitdiff
path: root/indexHtml.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-12 13:52:55 -0600
committerJeff Carr <[email protected]>2024-01-12 13:52:55 -0600
commite6e9b548cbe027416d5c3924cf4c131d2dd4fe1f (patch)
treeb68b1d095e1667906529e77e0d9b1552ce78f484 /indexHtml.go
parente34f8f57342fe940901c73c9d3fb391680eb7ecc (diff)
90% there
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'indexHtml.go')
-rw-r--r--indexHtml.go45
1 files changed, 39 insertions, 6 deletions
diff --git a/indexHtml.go b/indexHtml.go
index fcf9815..e025ea3 100644
--- a/indexHtml.go
+++ b/indexHtml.go
@@ -2,7 +2,10 @@ package main
import (
"fmt"
+ "strings"
"net/http"
+
+ "go.wit.com/log"
)
/*
@@ -58,7 +61,7 @@ func indexBodyStart(w http.ResponseWriter) {
fmt.Fprintln(w, " <div class=\"container\">")
fmt.Fprintln(w, " <div class=\"row\">")
fmt.Fprintln(w, " <table class=\"u-full-width\">")
- fmt.Fprintln(w, " <thead>")
+// fmt.Fprintln(w, " <thead>")
fmt.Fprintln(w, " <tr>")
fmt.Fprintln(w, " <th>Package</th>")
fmt.Fprintln(w, " <th>go get</th>")
@@ -66,16 +69,46 @@ func indexBodyStart(w http.ResponseWriter) {
fmt.Fprintln(w, " <th>github mirror</th>")
fmt.Fprintln(w, " <th>Documentation</th>")
fmt.Fprintln(w, " </tr>")
- fmt.Fprintln(w, " </thead>")
+// fmt.Fprintln(w, " </thead>")
fmt.Fprintln(w, " <tbody>")
fmt.Fprintln(w, "")
}
-func indexBodyRepo(w http.ResponseWriter, repourl string) {
- fmt.Fprintln(w, " <tr> <td><h5>log/ (needed for the gui)</h5></td> <td></td> <td></td> <td></td> <td></td> </tr>")
+func insertHTMLnote(w http.ResponseWriter, i int, parts []string) {
+ log.Info("comment # line:", i, strings.Join(parts, " "))
+ fmt.Fprintln(w, " <tr> <td><h5>", strings.Join(parts, " "), "</h5></td> <td></td> <td></td> <td></td> <td></td> </tr>")
+}
+
+func indexBodyScanConfig(w http.ResponseWriter) {
+ log.Info("indexBodyScanConfig() START")
+ for i, line := range configfile {
+ // log.Info("config file line:", i, line)
+ fields := strings.Fields(line)
+ if (len(fields) == 0) {
+ continue
+ }
+ if (fields[0] == "#") {
+ insertHTMLnote(w, i, fields[0:])
+ // log.Info("comment # line:", i, line)
+ continue
+ }
+ if (len(fields) == 2) {
+ 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)
+ }
+ log.Info("indexBodyScanConfig() END")
+}
+
+func indexBodyRepo(w http.ResponseWriter, gourl string, giturl string, github 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>log</td>")
- fmt.Fprintln(w, " <td> <a href=\"//go.wit.com/log\">go.wit.com/log</a></td>")
+ fmt.Fprintln(w, " <td>", gourl, "</td>")
+ fmt.Fprintln(w, " <td> <a href=\"//", gourl, "\">", gourl, "</a></td>")
fmt.Fprintln(w, " <td> <a href=\"//git.wit.org/wit/log\">git.wit.org/wit/log</a></td>")
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/go.wit.com/log\"> <img src=\"goReference.svg\" alt=\"Go Reference\" /> </a> </td>")