2023-01-26 20:58:13 +00:00
|
|
|
package main
|
|
|
|
|
2023-01-26 22:13:44 +00:00
|
|
|
func htmlElement(tag string, innerHTML string, args string) string {
|
2023-01-26 20:58:13 +00:00
|
|
|
return "<" + tag + " " + args + ">" + innerHTML + "</" + tag + ">"
|
|
|
|
}
|
|
|
|
|
2023-01-26 22:13:44 +00:00
|
|
|
func htmlLinkElement(innerHTML string, destination string, blank bool, args string) string {
|
2023-01-26 20:58:13 +00:00
|
|
|
b := ""
|
|
|
|
if blank {
|
|
|
|
b = "target=\"_blank\""
|
|
|
|
}
|
|
|
|
|
2023-01-26 22:13:44 +00:00
|
|
|
return htmlElement("a", innerHTML, " href=\""+destination+"\" "+b)
|
2023-01-26 20:58:13 +00:00
|
|
|
}
|
|
|
|
|
2023-01-26 22:13:44 +00:00
|
|
|
func htmlInputElement(name string, _type string, value string, args string) string {
|
2023-01-26 20:58:13 +00:00
|
|
|
return "<input name=\"" + name + "\" type=\"" + _type + "\" value=\"" + value + "\" " + args + ">"
|
|
|
|
}
|
|
|
|
|
2023-01-26 22:13:44 +00:00
|
|
|
func htmlNav(pages [][]string) string {
|
2023-01-26 20:58:13 +00:00
|
|
|
output := ""
|
|
|
|
|
|
|
|
for _, page := range pages {
|
2023-01-26 22:13:44 +00:00
|
|
|
output += htmlElement("li", htmlLinkElement(page[0], page[1], false, ""), "")
|
2023-01-26 20:58:13 +00:00
|
|
|
}
|
|
|
|
|
2023-01-26 22:13:44 +00:00
|
|
|
return htmlElement("nav", htmlElement("ul", output, ""), "")
|
2023-01-26 20:58:13 +00:00
|
|
|
}
|