Skip to content

Instantly share code, notes, and snippets.

@mmcgrana
Created September 18, 2010 20:13
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmcgrana/586004 to your computer and use it in GitHub Desktop.
Save mmcgrana/586004 to your computer and use it in GitHub Desktop.
; dependencies:
; http://build.clojure.org/releases/org/clojure/clojure/1.2.0/clojure-1.2.0.jar
; http://github.com/downloads/sirthias/parboiled/parboiled4j-0.9.8.2.jar
; http://github.com/downloads/sirthias/pegdown/pegdown-0.8.5.3.jar
(import 'org.pegdown.PegDownProcessor)
(def input-text "
A First Level Header
====================
A Second Level Header
---------------------
Now is the time for all good men to come to
the aid of their country. This is just a
regular paragraph.
The quick brown fox jumped over the lazy
dog's back.
### Header 3
> This is a blockquote.
>
> This is the second paragraph in the blockquote.
>
> ## This is an H2 in a blockquote
Some source code:
(defn foo [bar]
(bat bar))
")
(defn render [input]
(.markdownToHtml (PegDownProcessor.) input))
(print (render input-text))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment