Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

continuing to update readme

  • Loading branch information...
commit b2714eb8181181caa7d7b01807083c54b5c91a61 1 parent 9b94079
@chaslemley authored
Showing with 27 additions and 4 deletions.
  1. +27 −4 README.md
View
31 README.md
@@ -1,21 +1,44 @@
-# slim
+# slim.clj
Simple Templating for Clojure
+based on Andrew Stone's Slim : <http://github.com/stonean/slim>
## Usage
+####1. Create a slim template file
+
+ ; content of views/template.html.slim
+ - (defn greeting [name] (str "Hello, " name))
+
div
+ h1
+ = (greeting "Slim.clj")
p(id='foo' class='bar') Hello World
+####2. Use the render-html function to convert the file to html
-
- user=> (use 'hiccup.core)
+ user=> (use 'slim.core)
nil
+
user=> (render-template "views/template.html.slim")
- "<div><p id='foo' class='bar'>Hello World</p></div>"
+ "<div><h1>Hello, Slim.clj</h1><p id='foo' class='bar'>Hello World</p></div>"
+
+####3. Slim.clj also includes integration with hiccup : <http://github.com/weavejester/hiccup>
+
+ ; content of views/hiccup.html.slim
+ div
+ = (html [:h1#garfield.heading.cats "Hello World"])
+
+/
+
+ user=> (render-template "views/hiccup.html.slim")
+ "<div><h1 class=\"heading cats\" id=\"garfield\">Hello World</h1></div>"
## Installation
+### Leiningen
+
+ [slim "0.1.1"]
## License
Please sign in to comment.
Something went wrong with that request. Please try again.