Skip to content

Commit

Permalink
Fixed readme format error
Browse files Browse the repository at this point in the history
  • Loading branch information
killme2008 committed Jul 17, 2012
1 parent 3ddc466 commit 8f29f57
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.md
Expand Up @@ -6,35 +6,35 @@ A Clojure library designed to render velocity template for ring in clojure.

* Adds dependency in leiningen project.clj:

[ring.velocity "0.1.0-SNAPSHOT"]
[ring.velocity "0.1.0-SNAPSHOT"]

* Create a directory named `templates` in your project directory to keep all velocity templates.
* Create a template `templates/test.vm`:

hello,$name,your age is $age.
hello,$name,your age is $age.
* Use ring.velocity in your namespace:

(use '[ring.velocity :only [render]])
(use '[ring.velocity :only [render]])
* Use `render` function to render template with vars:

(render "test.vm" :name "dennis" 29)
(render "test.vm" :name "dennis" 29)
The `test.vm` will be interpreted equals to:

hello,dennis,your age is 29.
hello,dennis,your age is 29.
* Use ring.velocity in compojure:

(defroutes app-routes
(GET "/" [] (render "test.vm" :name "dennis" :age 29))
(route/not-found "Not Found"))
(defroutes app-routes
(GET "/" [] (render "test.vm" :name "dennis" :age 29))
(route/not-found "Not Found"))
* Use ring.velocity in ring:

(use '[ring.util.response])
(response (render "test.vm" :name "dennis" :age 29))
(use '[ring.util.response])
(response (render "test.vm" :name "dennis" :age 29))

* Custom velocity properties,just put a file named `ring-velocity.properties` to your classpath or resource paths.

Expand Down

0 comments on commit 8f29f57

Please sign in to comment.