Skip to content

Raynes/cegdown

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

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.

About

A thin Clojure wrapper for the pegdown markdown parsing library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •