package server import ( "fmt" "io/ioutil" "net/http" "path" "github.com/gomarkdown/markdown" ) func notesFile(p Path, w http.ResponseWriter, r *http.Request) { b, _ := ioutil.ReadFile(p.Local) notesFileHead(p, w) content := markdown.ToHTML(b, nil, nil) fmt.Fprintf(w, "%s\n", content) } func notesFileHead(p Path, w http.ResponseWriter) { fmt.Fprintf(w, ` `, path.Join("/edit/", p.BaseHREF)) }