aboutsummaryrefslogtreecommitdiffstats
path: root/markdown.go
diff options
context:
space:
mode:
authorEddy Pedroni <eddy@0xf7.com>2020-01-28 22:06:16 +0100
committerEddy Pedroni <eddy@0xf7.com>2020-01-28 22:06:16 +0100
commit2c055e3ca001ee6064677a0db16172148e5edcef (patch)
tree46073b7ea2df58520ffc560af72ae2bdabf8bdd6 /markdown.go
parentce81b97e80ada42a223a7fd45c5abaa5c9667d75 (diff)
Added tentative page rendering, outline main function
Diffstat (limited to 'markdown.go')
-rw-r--r--markdown.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/markdown.go b/markdown.go
new file mode 100644
index 0000000..4e1d8a3
--- /dev/null
+++ b/markdown.go
@@ -0,0 +1,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
+}