Permalink
Browse files

clojure code highlighting

  • Loading branch information...
1 parent fb72d64 commit dd8a05fb7b28a54e2350ef5632202d4d5d694d04 @logaan committed Sep 22, 2013
Showing with 18 additions and 16 deletions.
  1. +18 −16 README.md
View
@@ -20,22 +20,24 @@ a validation that checks each of it's arguments. `chain` will stop checking
once the first validation fails. This helps avoid overwhelming your users with
redundant error messages.
- (def common
- (join (present [:name])
- (present [:email])))
-
- (def password
- (chain (present [:password]
- (join (length-in 6 128 [:password])
- (match #"[a-zA-Z]" [:password])
- (match #"[0-9]" [:password]))
- (equals-field [:password] [:confirmation]))))
-
- (def signup
- (join common password)
-
- (def update
- common)
+```clojure
+(def common
+ (join (present [:name])
+ (present [:email])))
+
+(def password
+ (chain (present [:password]
+ (join (length-in 6 128 [:password])
+ (match #"[a-zA-Z]" [:password])
+ (match #"[0-9]" [:password]))
+ (equals-field [:password] [:confirmation]))))
+
+(def signup
+ (join common password)
+
+(def update
+ common)
+```
And of course all these validations could be run over any data. Whether you're
pulling it in from a web service, a database or a csv file somewhere.

0 comments on commit dd8a05f

Please sign in to comment.