aboutsummaryrefslogtreecommitdiffstats
path: root/markdown.go
blob: 4e1d8a35838e0de7790cf8ae2fe106f185447983 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package main

import (
	"gopkg.in/russross/blackfriday.v2"
	"io/ioutil"
)

// Takes the path to a markdown file and outputs the processed HTML in a string
func processMarkdown(path string) (md string, err error) {
	data, err := ioutil.ReadFile(path)
	if err != nil {
		return
	}

	md = string(blackfriday.Run(data))
	return
}