A thin Clojure wrapper for the pegdown markdown parsing library
Clojure
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/me/raynes
test/cegdown
.gitignore
README.md
project.clj

README.md

cegdown

Cegdown is a simple little Clojure wrapper for the excellent Pegdown markdown parsing library.

Usage

You'll want to require it first:

user> (require '[me.raynes.cegdown :as md])
nil

Now you can generate some HTML from a bit of markdown:

user> (md/to-html "# hi\nhow are you")
"<h1>hi</h1><p>how are you</p>"

Pegdown has lots of extensions. You can use them with to-html. Just pass it a sequence of keywords. For example, if we wanted fenced code blocks (like this README uses):

user> (md/to-html "```clojure\n(+ 3 3)\n```" [:fenced-code-blocks])
"<pre><code class=\"clojure\">(+ 3 3)\n</code></pre>"

Easy enough, right?

License

Copyright © 2012 Anthony Grimes

Distributed under the Eclipse Public License, the same as Clojure.