package main
import (
"fmt"
"strings"
"net/http"
"go.wit.com/log"
)
func indexHeader(w http.ResponseWriter) {
fmt.Fprintln(w, "")
fmt.Fprintln(w, "")
fmt.Fprintln(w, "
")
// fmt.Fprintln(w, " ")
fmt.Fprintln(w, " ")
fmt.Fprintln(w, " ")
fmt.Fprintln(w, "")
}
func indexBodyStart(w http.ResponseWriter) {
// fmt.Fprintln(w, "
fmt.Fprintln(w, "")
fmt.Fprintln(w, " ")
fmt.Fprintln(w, "
")
fmt.Fprintln(w, "
")
// fmt.Fprintln(w, " ")
fmt.Fprintln(w, " ")
fmt.Fprintln(w, " Package | ")
fmt.Fprintln(w, " go get | ")
fmt.Fprintln(w, " Authoritative sources (IPv6 only) | ")
fmt.Fprintln(w, " | ")
fmt.Fprintln(w, " Documentation | ")
fmt.Fprintln(w, "
")
// fmt.Fprintln(w, " ")
fmt.Fprintln(w, " ")
fmt.Fprintln(w, "")
}
func insertHTMLnote(w http.ResponseWriter, i int, parts []string) {
log.Info("comment # line:", i, strings.Join(parts, " "))
fmt.Fprintln(w, " ", strings.Join(parts, " "), " | | | | |
")
}
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, " log/ (needed for the gui) | | | | |
")
fmt.Fprintln(w, " ")
fmt.Fprintln(w, " " + gourl + " | ")
fmt.Fprintln(w, " " + gourl + " | ")
fmt.Fprintln(w, " " + giturl + " | ")
if github == "" {
fmt.Fprintln(w, " | ")
} else {
fmt.Fprintln(w, " github.com/wit-go/log | ")
}
fmt.Fprintln(w, " | ")
fmt.Fprintln(w, "
")
fmt.Fprintln(w, "")
}
func indexDivEnd(w http.ResponseWriter) {
// fmt.Fprintln(w, "
fmt.Fprintln(w, " ")
fmt.Fprintln(w, "
")
fmt.Fprintln(w, "
")
fmt.Fprintln(w, "
")
}
func indexBodyEnd(w http.ResponseWriter) {
fmt.Fprintln(w, " ")
fmt.Fprintln(w, "