bdf-preview: style corrections

This commit is contained in:
Přemysl Eric Janouch 2019-04-25 19:59:43 +02:00
parent 81927e9017
commit 5cef6b240a
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 16 additions and 16 deletions

View File

@ -20,21 +20,21 @@ type fontItem struct {
var fonts = map[string]fontItem{} var fonts = map[string]fontItem{}
var tmpl = template.Must(template.New("list").Parse(` var tmpl = template.Must(template.New("list").Parse(`
<!DOCTYPE html> <!DOCTYPE html>
<html><body> <html><body>
<table border='1' cellpadding='3' style='border-collapse: collapse'> <table border='1' cellpadding='3' style='border-collapse: collapse'>
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Preview</th> <th>Preview</th>
<tr> <tr>
{{range $k, $v := . }} {{- range $k, $v := . }}
<tr> <tr>
<td>{{$k}}</td> <td>{{ $k }}</td>
<td><img src='?name={{$k}}'></td> <td><img src='?name={{ $k }}'></td>
</tr> </tr>
{{end}} {{- end }}
</table> </table>
</body></html> </body></html>
`)) `))
func handle(w http.ResponseWriter, r *http.Request) { func handle(w http.ResponseWriter, r *http.Request) {
@ -87,7 +87,7 @@ func main() {
fonts[filename] = fontItem{Font: font, Preview: img} fonts[filename] = fontItem{Font: font, Preview: img}
} }
log.Println("Starting server") log.Println("starting server")
http.HandleFunc("/", handle) http.HandleFunc("/", handle)
log.Fatal(http.ListenAndServe(":8080", nil)) log.Fatal(http.ListenAndServe(":8080", nil))
} }