aboutsummaryrefslogtreecommitdiff
path: root/wiki.go
diff options
context:
space:
mode:
Diffstat (limited to 'wiki.go')
-rw-r--r--wiki.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/wiki.go b/wiki.go
index cdb49c2..f809e62 100644
--- a/wiki.go
+++ b/wiki.go
@@ -5,6 +5,8 @@ import (
"net/http"
"os"
"text/template"
+
+ "github.com/russross/blackfriday"
)
type Page struct {
@@ -38,6 +40,10 @@ func (p *Page) render(w http.ResponseWriter, tmpl *template.Template) {
}
}
+func (p *Page) HTML() string {
+ return string(blackfriday.MarkdownCommon([]byte(p.Body)))
+}
+
func main() {
- http.ListenAndServe(":8080", nil)
+ http.ListenAndServe("localhost:8080", nil)
}