Skip to content

Instantly share code, notes, and snippets.

@bouzuya
Created August 20, 2012 14:44
Show Gist options
  • Select an option

  • Save bouzuya/3404829 to your computer and use it in GitHub Desktop.

Select an option

Save bouzuya/3404829 to your computer and use it in GitHub Desktop.
(ns clj-ex-mkd.core
(:import (com.petebevin.markdown MarkdownProcessor)))
(defn markdown-to-html
[markdown]
(->
(MarkdownProcessor.)
(.markdown markdown)))
(defn read-markdown-file
[file-name]
(with-open [reader (clojure.java.io/reader file-name)]
(markdown-to-html (apply str (interpose "\n" (line-seq reader))))))
(defn -main
[& args]
(print (read-markdown-file "./README.md")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment