package server
import (
"fmt"
"local/notes-server/config"
"net/http"
)
func head(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(config.Head + "\n"))
}
func foot(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(config.Foot + "\n"))
}
func block(w http.ResponseWriter, content string) {
fmt.Fprintf(w, "\n
\n%s\n
\n", content)
}
func h1(content string) string {
return h("1", content)
}
func h2(content string) string {
return h("2", content)
}
func h3(content string) string {
return h("3", content)
}
func h4(content string) string {
return h("4", content)
}
func h5(content string) string {
return h("5", content)
}
func h(level, content string) string {
return fmt.Sprintf("\n\n%s\n\n", level, content, level)
}